1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : EntityGUI_SketcherDlg.h
23 // Author : Damien COQUERET, Open CASCADE S.A.S.
26 #ifndef ENTITYGUI_SKETCHERDLG_H
27 #define ENTITYGUI_SKETCHERDLG_H
29 #include <GEOMBase_Helper.h>
36 class EntityGUI_1Spin;
37 class EntityGUI_2Spin;
38 class EntityGUI_3Spin;
39 class EntityGUI_4Spin;
40 class EntityGUI_Point;
43 class EntityGUI_Skeleton;
47 # define COORD_MIN -1e+15
48 # define COORD_MAX +1e+15
49 # define MAX_NUMBER 100000
50 # define DBL_DIGITS_DISPLAY 16
53 //=================================================================================
54 // class : EntityGUI_Dlg
56 //=================================================================================
57 class EntityGUI_SketcherDlg : public QDialog, GEOMBase_Helper
62 EntityGUI_SketcherDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0,
64 ~EntityGUI_SketcherDlg();
66 bool eventFilter (QObject* object, QEvent* event);
69 void initSpinBox( QDoubleSpinBox*,
70 double, double, double = 0.1,
73 // redefined from GEOMBase_Helper
74 virtual GEOM::GEOM_IOperations_ptr createOperation();
75 virtual bool isValid( QString& );
76 virtual bool execute( ObjectList& );
78 void closeEvent( QCloseEvent* );
79 void keyPressEvent( QKeyEvent* );
83 void enterEvent( QEvent* );
85 void setEnabledUndo( bool );
86 void setEnabledRedo( bool );
88 QString GetNewCommand();
90 virtual void displayPreview( GEOM::GEOM_Object_ptr,
98 bool createShapes( GEOM::GEOM_Object_ptr,
104 int myConstructorDirId;
110 QLineEdit* myEditCurrentArgument; /* Current LineEdit */
112 QStringList myCommand;
113 QStringList myUndoCommand;
115 Standard_Real myX, myY, myDX, myDY;
116 Standard_Real myLength, myAngle, myRadius;
117 Standard_Real myLastX1, myLastY1;
118 Standard_Real myLastX2, myLastY2;
120 EntityGUI_Skeleton* MainWidget;
122 EntityGUI_Point* GroupPt;
123 EntityGUI_Dir1* GroupD1;
124 EntityGUI_Dir2* GroupD2;
126 EntityGUI_1Sel* Group1Sel;
127 EntityGUI_1Spin* Group1Spin;
128 EntityGUI_2Spin* Group2Spin;
129 EntityGUI_3Spin* Group3Spin;
130 EntityGUI_4Spin* Group4Spin;
132 GeometryGUI* myGeometryGUI;
134 QString myHelpFileName;
139 enum SketchState { FIRST_POINT, NEXT_POINT };
141 enum SketchType { PT_ABS, PT_RELATIVE, PT_SEL,
142 DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y,
143 DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y,
144 DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
145 DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y };
149 void ClickOnCancel();
154 void LineEditReturnPressed();
155 void SelectionIntoArgument();
156 void SetEditCurrentArgument();
157 void DeactivateActiveDialog();
158 void ActivateThisDialog();
159 void TypeClicked( int );
160 void DestClicked( int );
161 void PointClicked( int );
162 void Dir1Clicked( int );
163 void Dir2Clicked( int );
164 void ValueChangedInSpinBox( double );
165 void SetDoubleSpinBoxStep( double );
168 #endif // ENTITYGUI_SKETCHERDLG_H