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