itom  3.0.0
sharedStructuresPrimitives.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 //#ifndef SHAREDSTRUCTURESPRIMITIVES_H
29 //#define SHAREDSTRUCTURESPRIMITIVES_H
30 //
31 //#include "typeDefs.h"
32 //#include "../DataObject/dataobj.h"
33 //
34 //#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC) //only moc this file in itomCommonQtLib but not in other libraries or executables linking against this itomCommonQtLib
35 //
36 //#define PRIM_ELEMENTLENGTH 11 /** \brief number of elements within the geometricPrimitives */
37 //
38 //
40 //* \brief This union was defined for adressing geometricPrimitives.
41 // \detail The union geometricPrimitives contains an array called cells with the size of PRIM_ELEMENTLENGTH.
42 // The cells contain:
43 // 0. The unique index of the current primitive, castable to int32 with a maximum up to 16bit index values
44 // 1. Type flag 0000FFFF and further flags e.g. read&write only FFFF0000
45 // 2. First coordinate with x value
46 // 3. First coordinate with y value
47 // 4. First coordinate with z value
48 // All other values depends on the primitiv type and may change between each type.
49 // A point is defined as idx, flags, centerX0, centerY0, centerZ0
50 // A line is defined as idx, flags, x0, y0, z0, x1, y1, z1
51 // A ellipse is defined as idx, flags, centerX, centerY, centerZ, r1, r2
52 // A circle is defined as idx, flags, centerX, centerY, centerZ, r
53 // A rectangle is defined as idx, flags, x0, y0, z0, x1, y1, z1, alpha
54 // A square is defined as idx, flags, centerX, centerY, centerZ, a, alpha
55 // A polygon is defined as idx, flags, posX, posY, posZ, directionX, directionY, directionZ, idx, numIdx
56 // \author Wolfram Lyda, twip optical solutions GmbH, Stuttgart
57 // \date 12.2013
58 //*/
59 //
60 //struct ITOMCOMMONQT_EXPORT geometricPrimitives
61 //{
62 //
64 // struct point
65 // {
66 // ito::float32 idx;
67 // ito::float32 flags;
68 // ito::float32 x0;
69 // ito::float32 y0;
70 // ito::float32 z0;
71 // };
72 //
73 // struct line
74 // {
75 // ito::float32 idx;
76 // ito::float32 flags;
77 // ito::float32 x0;
78 // ito::float32 y0;
79 // ito::float32 z0;
80 // ito::float32 x1;
81 // ito::float32 y1;
82 // ito::float32 z1;
83 // };
84 //
85 // struct elipse
86 // {
87 // ito::float32 idx;
88 // ito::float32 flags;
89 // ito::float32 centerX;
90 // ito::float32 centerY;
91 // ito::float32 centerZ;
92 // ito::float32 r1;
93 // ito::float32 r2;
94 // ito::float32 alpha;
95 // };
96 //
97 // struct circle
98 // {
99 // ito::float32 idx;
100 // ito::float32 flags;
101 // ito::float32 centerX;
102 // ito::float32 centerY;
103 // ito::float32 centerZ;
104 // ito::float32 r1;
105 // };
106 //
107 // struct retangle
108 // {
109 // ito::float32 idx;
110 // ito::float32 flags;
111 // ito::float32 x0;
112 // ito::float32 y0;
113 // ito::float32 z0;
114 // ito::float32 x1;
115 // ito::float32 y1;
116 // ito::float32 z1;
117 // ito::float32 alpha;
118 // };
119 //
120 // struct square
121 // {
122 // ito::float32 idx;
123 // ito::float32 flags;
124 // ito::float32 centerX;
125 // ito::float32 centerY;
126 // ito::float32 centerZ;
127 // ito::float32 a;
128 // ito::float32 alpha;
129 // };
130 //
131 // struct polygoneElement
132 // {
133 // ito::float32 idx;
134 // ito::float32 flags;
135 // ito::float32 x0;
136 // ito::float32 y0;
137 // ito::float32 z0;
138 // ito::float32 directionX;
139 // ito::float32 directionY;
140 // ito::float32 directionZ;
141 // ito::float32 pointIdx;
142 // ito::float32 pointNumber;
143 // };
144 //*/
145 // ito::float32 cells[PRIM_ELEMENTLENGTH];
146 //};
147 //
148 //
149 //
150 //namespace ito
151 //{
152 //
153 // /** \class PrimitiveContainer
154 // * \detail This is a container to store geometric primitives.
155 // The enum tPrimitive of this file defines the geometric primitives for all plots.
156 // \author Wolfram Lyda, twip optical solutions GmbH, Stuttgart
157 // \date 12.2013
158 // */
159 // class ITOMCOMMONQT_EXPORT PrimitiveContainer
160 // {
161 // public:
162 //
163 // /** \enum tPrimitive
164 // * \detail Discribes the different primtive types
165 // \sa itom1DQwtPlot, itom2DQwtPlot
166 // */
167 // enum tPrimitive
168 // {
169 // tNoType = 0, /**! NoType for pick*/
170 // tMultiPointPick = 6, /**! Multi point pick*/
171 // tPoint = 101, /**! Element is tPoint or order to pick points*/
172 // tLine = 102, /**! Element is tLine or order to pick lines*/
173 // tRectangle = 103, /**! Element is tRectangle or order to pick rectangles*/
174 // tSquare = 104, /**! Element is tSquare or order to pick squares*/
175 // tEllipse = 105, /**! Element is tEllipse or order to pick ellipses*/
176 // tCircle = 106, /**! Element is tCircle or order to pick circles*/
177 // tPolygon = 110, /**! Element is tPolygon or order to pick polygon*/
178 // tMoveLock = 0x00010000, /**! Element is readOnly */
179 // tRotateLock = 0x00020000, /**! Element can not be moved */
180 // tResizeLock = 0x00040000, /**! Element can not be moved */
181 // tTypeMask = 0x0000FFFF, /**! Mask for the type space */
182 // tFlagMask = 0xFFFF0000 /**! Mask for the flag space */
183 // };
184 //
186 // PrimitiveContainer(DataObject primitives = DataObject());
187 // ~PrimitiveContainer();
188 //
189 //
190 //
191 // inline int getNumberOfRows() const {return m_primitives.getSize(0);};
192 // inline int getNumberOfElements(const int type) const;
193 // inline int getFirstElementRow(const int type) const;
194 // inline ito::float32* getElementPtr(const int row);
195 // inline const ito::float32* getElementPtr(const int row) const;
196 // inline int getIndexFromRow(const int row) const;
197 // inline int getRowFromIndex(const int idx) const;
198 //
199 // inline bool isElement(const int row) const;
200 // void clear(void);
201 //
202 // ito::RetVal addElement(const int type, ito::float32 * cells);
203 // ito::RetVal changeElement(const int type, ito::float32 * cells);
204 // ito::RetVal removeElement(const int row);
205 //
206 // ito::RetVal copyGeometricElements(const ito::DataObject &rhs);
207 //
208 // private:
209 //
210 // ito::DataObject m_primitives;
211 // cv::Mat * m_internalMat;
213 //
214 // };
215 //
216 //
217 //}
218 //
219 //#endif //#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC)
220 //
221 //#endif //SHAREDSTRUCTURESPRIMITIVES_H