Salome HOME
4f4cbe53d2dfb3e9266d045f0b6d5c9af5a6d08a
[modules/geom.git] / src / GEOMGUI / GeometryGUI_PlaneDlg.h
1 //  File      : GeometryGUI_PlaneDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9
10 #ifndef DIALOGBOX_PLANE_H
11 #define DIALOGBOX_PLANE_H
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15 #include "GEOM_FaceFilter.hxx"
16 #include "GeometryGUI_SpinBox.h"
17
18 #include <BRepBuilderAPI_MakeFace.hxx>
19 #include <gp_Pnt.hxx>
20
21 #include <qvariant.h>
22 #include <qdialog.h>
23
24 class QVBoxLayout; 
25 class QHBoxLayout; 
26 class QGridLayout; 
27 class QButtonGroup;
28 class QFrame;
29 class QGroupBox;
30 class QLineEdit;
31 class QPushButton;
32 class QRadioButton;
33 class QToolButton;
34 class QLabel;
35 class GeometryGUI;
36
37 //=================================================================================
38 // class    : GeometryGUI_PlaneDlg
39 // purpose  :
40 //=================================================================================
41 class GeometryGUI_PlaneDlg : public QDialog
42
43     Q_OBJECT
44
45 public:
46     GeometryGUI_PlaneDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
47     ~GeometryGUI_PlaneDlg();
48
49 private :
50  
51     void Init( SALOME_Selection* Sel ) ;
52     void closeEvent( QCloseEvent* e ) ;
53     void enterEvent( QEvent* e);
54
55     GEOM::GEOM_Gen_var    myGeom ;                /* Current Geom object */
56     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
57     TopoDS_Shape          mySimulationTopoDs;     /* Shape used for simulation display */    
58     SALOME_Selection*     mySelection ;           /* User shape selection */    
59     gp_Pnt                myPoint1 ;              /* Point on the plane */
60
61     Standard_Real         myDx ;
62     Standard_Real         myDy ;
63     Standard_Real         myDz ;
64     Standard_Real         myTrimSize ;
65
66     bool                  myOkPoint1 ;            /* true when argument is defined */
67     bool                  myOkDirection ;
68     bool                  myOkCoordinates ;
69     bool                  myOkPlanarFace ;
70     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */   
71     int                   myConstructorId ;       /* Current constructor id = radio button id */
72     
73     Handle(GEOM_ShapeTypeFilter) myVertexFilter;  /* Filters selection */
74     Handle(GEOM_ShapeTypeFilter) myEdgeFilter;    /* Filters selection */
75     Handle(GEOM_FaceFilter)      myFaceFilter;    /* Filters selection */
76
77     // Constructors
78     QButtonGroup* GroupConstructors;
79     QRadioButton* Constructor1;
80     QRadioButton* Constructor2;
81     QRadioButton* Constructor3;
82
83     // Constructor with a point + direction (vector)
84     QGroupBox* GroupPointDirection;
85
86     QLabel* TextLabelPt1;
87     QPushButton* SelectButtonPt1;
88     QLineEdit* LineEditPt1;
89     
90     QLabel* TextLabelDirection;
91     QPushButton* SelectButtonDirection;
92     QLineEdit* LineEditDirection;
93     
94     QLabel* TextLabelC1Size;
95     GeometryGUI_SpinBox*  SpinBox_C1Size ;
96
97     // Constructor with a point + dx, dy, dz coordinates
98     QGroupBox* GroupPointPlusCoordinates;
99
100     QLabel* TextLabelPt2;
101     QPushButton* SelectButtonPt2;
102     QLineEdit* LineEditPt2;
103
104     QLabel* TextLabelCoordinates;
105     QLabel* TextLabel_DX;
106     QLabel* TextLabel_DY;
107     QLabel* TextLabel_DZ;
108     GeometryGUI_SpinBox*  SpinBox_DX ;
109     GeometryGUI_SpinBox*  SpinBox_DY ;
110     GeometryGUI_SpinBox*  SpinBox_DZ ;
111
112     QLabel* TextLabelC2Size;
113     GeometryGUI_SpinBox*  SpinBox_C2Size ;
114
115     // Constructor with a face
116     QGroupBox* GroupFace;
117
118     QLabel* TextLabelFace;
119     QPushButton* SelectButtonFace;
120     QLineEdit* LineEditFace;
121
122     QLabel* TextLabelC3Size;
123     GeometryGUI_SpinBox* SpinBox_C3Size ;
124
125     // BUTTONS
126     QGroupBox*   GroupButtons;
127     QPushButton* buttonApply;
128     QPushButton* buttonOk;
129     QPushButton* buttonCancel;
130
131 private slots:
132
133     void ConstructorsClicked(int constructorId);
134     void ClickOnOk();
135     void ClickOnCancel();
136     void ClickOnApply();
137     void SetEditCurrentArgument() ;
138     void SelectionIntoArgument() ;
139     void LineEditReturnPressed() ;
140     void DeactivateActiveDialog() ;
141     void ActivateThisDialog() ;
142     void MakePlaneSimulationAndDisplay( const gp_Pnt& P, 
143                                         const Standard_Real dx,
144                                         const Standard_Real dy,
145                                         const Standard_Real dz,
146                                         const Standard_Real trimSize ) ;
147     void ValueChangedInSpinBox( double newValue ) ;
148
149 protected:
150
151     QGridLayout* GeometryGUI_PlaneDlgLayout;
152     QGridLayout* GroupButtonsLayout;
153     QGridLayout* GroupPointDirectionLayout;
154     QGridLayout* GroupConstructorsLayout;
155     QGridLayout* GroupPointPlusCoordinatesLayout;
156     QGridLayout* GroupFaceLayout;
157     QHBoxLayout* Layout2 ;
158 };
159
160 #endif // DIALOGBOX_PLANE_H