-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathSketcher_Property.hxx
302 lines (247 loc) · 5.79 KB
/
Sketcher_Property.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
/**
* \file Sketcher_Property.hxx
* \brief Header file for the class Sketcher_Property
* \author <a href="mailto:[email protected]?subject=Sketcher_Property.hxx">Sergei Maslov</a>
*/
#ifndef Sketcher_Property_H
#define Sketcher_Property_H
#include <qvariant.h>
#include <qwidget.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <TCollection_ExtendedString.hxx>
#include <ElCLib.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Ax3.hxx>
#include "Sketcher_Object.hxx"
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QComboBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
//base class for editing object classes
class Sketcher_Property : public QWidget
{
Q_OBJECT
public:
//methods
/**
* \fn Sketcher_Property( QWidget* parent, const char* name, WFlags fl )
* \brief Constructs a Sketcher_Property which is a child of 'parent', with the name 'name' and widget flags set to 'f'
* \param parent QWidget*
* \param name const char*
* \param fl WFlags
*/
Sketcher_Property( QWidget* parent = 0, const char* name = 0);
/**
* \fn ~Sketcher_Property()
* \brief destructor
*/
~Sketcher_Property();
/**
* \fn SetContext(Handle(AIS_InteractiveContext)& theContext)
* \brief set context
* \return void
* \param theContext Handle(AIS_InteractiveContext)&
*/
void SetContext (Handle(AIS_InteractiveContext)& theContext);
/**
* \fn SetAx3(const gp_Ax3& theAx3)
* \brief set coordinate system
* \return void
* \param theAx3 const gp_Ax3&
*/
void SetAx3 (const gp_Ax3& theAx3);
/**
* \fn SetObject(Handle(Sketcher_Object)& CurObject)
* \brief set Sketcher_Object, show dialog window
* \return void
* \param CurObject Handle(Sketcher_Object)&
*/
void SetObject(Handle(Sketcher_Object)& CurObject);
//members
QLabel* TextLabelID;
QLineEdit* LineEditID;
QGroupBox* GroupBoxGP;
QLabel* TextLabelPoint1;
QLineEdit* LineEditPoint1;
QGroupBox* GroupBoxAttributes;
QLabel* TextLabelColor;
QComboBox* ComboBoxColor;
QLabel* TextLabelType;
QComboBox* ComboBoxType;
QLabel* TextLabelStyle;
QComboBox* ComboBoxStyle;
QLabel* TextLabelWidth;
QComboBox* ComboBoxWidth;
QPushButton* PushButtonOK;
QPushButton* PushButtonCancel;
QPushButton* PushButtonApply;
private slots:
/**
* \fn onOK()
* \brief clicking on "OK" button handler
* \return void
*/
void onOK();
/**
* \fn onApply()
* \brief clicking on "Apply" button handler
* \return void
*/
void onApply();
protected:
//methods
/**
* \fn Init()
* \brief Constructs a supplementary elements
* \return void
*/
void Init();
/**
* \fn SetGeometry()
* \brief show object geometry in dialog window
* \return void
*/
virtual void SetGeometry() = 0;
/**
* \fn CheckGeometry()
* \brief check geometry for change
* \return bool
*/
virtual bool CheckGeometry() = 0;
/**
* \fn GetGeometry()
* \brief create new object
* \return bool
*/
virtual bool GetGeometry() = 0;
/**
* \fn SetID()
* \brief set object name to LineEditID
* \return void
*/
void SetID ();
/**
* \fn GetID()
* \brief get text from LineEditID
* \return TCollection_ExtendedString
*/
TCollection_ExtendedString GetID ();
/**
* \fn SetCoord(QLineEdit* le,const gp_Pnt2d& p)
* \brief set point coordinate to le
* \return void
* \param le QLineEdit*
* \param p const gp_Pnt2d&
*/
void SetCoord(QLineEdit* le,const gp_Pnt2d& p);
/**
* \fn CheckCoord(QLineEdit* le,const gp_Pnt2d& p)
* \brief get point coordinate from le
* \return bool
* \param le QLineEdit*
* \param p const gp_Pnt2d&
*/
bool CheckCoord(QLineEdit* le, gp_Pnt2d& p);
/**
* \fn CheckAttributies()
* \brief check attributes for change
* \return void
*/
void CheckAttributies();
/**
* \fn GetAttributies()
* \brief set attributes to object
* \return void
*/
void GetAttributies();
/**
* \fn GetName()
* \brief check name and type of object for change
* \return void
*/
void GetName();
/**
* \fn SetColor()
* \brief show object color in dialog window
* \return void
*/
void SetColor();
/**
* \fn GetColor()
* \brief get object color from dialog window
* \return Quantity_NameOfColor
*/
Quantity_NameOfColor GetColor();
/**
* \fn SetObjectType()
* \brief show object type in dialog window
* \return void
*/
void SetObjectType();
/**
* \fn GetObjectType()
* \brief get object type from dialog window
* \return Sketcher_ObjectType
*/
Sketcher_ObjectType GetObjectType();
/**
* \fn SetObjectStyle()
* \brief show object line style in dialog window
* \return void
*/
void SetObjectStyle();
/**
* \fn GetObjectStyle()
* \brief get object line style from dialog window
* \return Aspect_TypeOfLine
*/
Aspect_TypeOfLine GetObjectStyle();
/**
* \fn SetWidth()
* \brief show object line width in dialog window
* \return void
*/
void SetWidth();
/**
* \fn GetWidth()
* \brief get object line width from dialog window
* \return Standard_Real
*/
Standard_Real GetWidth();
//members
QGridLayout* PropertyLayout;
QGridLayout* GroupBoxGPLayout;
QGridLayout* GroupBoxAttributesLayout;
bool isPointWindow;
const QString StartCoord,MidCoord,EndCoord;
const QRegExp NumberExpr;
QString NumName;
Handle(AIS_InteractiveContext) myContext;
gp_Ax3 myCoordinateSystem;
Handle(Sketcher_Object) mySObject;
Handle(AIS_InteractiveObject) myAIS_Object;
TCollection_ExtendedString myID,tempID;
Quantity_NameOfColor myNameOfColor;
Sketcher_ObjectType myObjectType;
Aspect_TypeOfLine myObjectStyle;
Standard_Real myWidth;
Handle(Prs3d_Drawer) myDrawer;
Handle(Prs3d_LineAspect) myPrs3dAspect;
gp_Pnt2d firstPnt2d,tempPnt2d;
};
#endif // Sketcher_Property_H