RoboDK Plug-In Interface
Loading...
Searching...
No Matches
legacymatrix2d.h
1/****************************************************************************
2**
3** Copyright (c) 2015-2026 RoboDK Global.
4** Contact: https://robodk.com/
5**
6** This file is part of the RoboDK API.
7**
8** Permission is hereby granted, free of charge, to any person obtaining a copy
9** of this software and associated documentation files (the "Software"), to deal
10** in the Software without restriction, including without limitation the rights
11** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12** copies of the Software, and to permit persons to whom the Software is
13** furnished to do so, subject to the following conditions:
14**
15** The above copyright notice and this permission notice shall be included in all
16** copies or substantial portions of the Software.
17**
18** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24** SOFTWARE.
25**
26** RoboDK is a registered trademark of RoboDK Global.
27**
28****************************************************************************/
29
30#ifndef ROBODK_LEGACY_MATRIX2D_H
31#define ROBODK_LEGACY_MATRIX2D_H
32
33
34#ifdef QT_GUI_LIB
35class QTextStream;
36class QDataStream;
37#endif // QT_GUI_LIB
38
39
40namespace robodk
41{
42
43namespace legacy
44{
45
55{
59 double* data;
60
64 int* size;
65
70
75
76 bool canFreeData;
77};
78
86Matrix2D* Matrix2D_Create();
87
95void Matrix2D_Delete(Matrix2D** matrix);
96
106void Matrix2D_SetDimensions(Matrix2D* matrix, int rows, int columns);
107
117int Matrix2D_GetDimension(const Matrix2D* matrix, int dimension);
118
124int Matrix2D_ColumnCount(const Matrix2D* matrix);
125
131int Matrix2D_RowCount(const Matrix2D* matrix);
132
136double Matrix2D_Get(const Matrix2D* matrix, int row, int column);
137
141void Matrix2D_Set(const Matrix2D* matrix, int row, int column, double value);
142
146double* Matrix2D_GetColumn(const Matrix2D* matrix, int column);
147
155bool Matrix2D_Copy(const Matrix2D* source, Matrix2D* destination);
156
157#ifdef QT_GUI_LIB
161void Matrix2D_DebugArray(const double* array, int size);
162
166void Matrix2D_Debug(const Matrix2D* matrix);
167
173void Matrix2D_Save(QTextStream* stream, Matrix2D* matrix, bool csv = false);
174
178void Matrix2D_Save(QDataStream* stream, Matrix2D* matrix);
179
183void Matrix2D_Load(QDataStream* stream, Matrix2D** matrix);
184#endif // QT_GUI_LIB
185
186} // namespace legacy
187
188} // namespace robodk
189
190
191#endif // ROBODK_LEGACY_MATRIX2D_H
The Matrix2D struct represents a variable size 2D matrix.
double * data
Pointer to the data.
int * size
Pointer to the size array.
int allocatedSize
Allocated size.
int numDimensions
Number of dimensions (usually 2).