Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_PrismDlg.h
1 //  File      : GeometryGUI_PrismDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9
10 #ifndef DIALOGBOX_PRISM_H
11 #define DIALOGBOX_PRISM_H
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
16
17 #include <BRepPrimAPI_MakePrism.hxx>
18
19 #include <qvariant.h>
20 #include <qdialog.h>
21
22 class QVBoxLayout; 
23 class QHBoxLayout; 
24 class QGridLayout; 
25 class QButtonGroup;
26 class QCheckBox;
27 class QGroupBox;
28 class QLabel;
29 class QLineEdit;
30 class QPushButton;
31 class QRadioButton;
32 class GeometryGUI;
33
34
35 //=================================================================================
36 // class    : GeometryGUI_PrismDlg
37 // purpose  :
38 //=================================================================================
39 class GeometryGUI_PrismDlg : public QDialog
40
41     Q_OBJECT
42
43 public:
44     GeometryGUI_PrismDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
45     ~GeometryGUI_PrismDlg();
46
47 private :
48
49     void Init( SALOME_Selection* Sel ) ;
50     void closeEvent( QCloseEvent* e ) ;
51     void enterEvent( QEvent* e);
52     void MakePrismSimulationAndDisplay( const TopoDS_Shape& S) ;
53
54     GEOM::GEOM_Gen_var myGeom ;               /* Current Geom object */
55     GeometryGUI*          myGeomGUI ;            /* Current GeomGUI object */
56     TopoDS_Shape          mySimulationTopoDs;    /* Shape used for simulation display */    
57     SALOME_Selection*     mySelection ;          /* User shape selection */
58     Standard_Real         myDx ;
59     Standard_Real         myDy ;
60     Standard_Real         myDz ;
61     Standard_Real         myHeight ;             /* Height used for prism (extrusion) */
62     TopoDS_Shape          myBaseTopo ;           /* topology used as base of prism */  
63     GEOM::GEOM_Shape_var        myGeomShape ;          /* that is myBaseTopo */
64     bool                  myOkBase ;
65     bool                  myOkLine ;             /* to check when arguments myDx, myDy, myDz are defined */
66     QLineEdit*            myEditCurrentArgument; /* Current LineEdit */    
67     int                   myConstructorId ;      /* Current constructor id = radio button id */    
68     Handle(GEOM_ShapeTypeFilter) myEdgeFilter;   /* Filters selection */
69
70     QButtonGroup* GroupConstructors;
71     QRadioButton* Constructor1;    
72     QGroupBox* GroupConstructor1;
73
74     QLineEdit* LineEditC1A1Base;
75     QLineEdit* LineEditC1A2Line;
76     QPushButton* SelectButtonC1A1Base;
77     QPushButton* SelectButtonC1A2Line;
78     QLabel* TextLabelBase;
79     QLabel* TextLabelVector;
80     GeometryGUI_SpinBox* SpinBox_C1A3Height;
81     QCheckBox* CheckBoxC3A1Reverse;
82     QLabel* TextLabelHeight;
83
84     QGroupBox* GroupButtons;
85     QPushButton* buttonApply;
86     QPushButton* buttonOk;
87     QPushButton* buttonCancel;
88
89 private slots:
90
91     void ConstructorsClicked(int constructorId);
92     void ClickOnOk();
93     void ClickOnCancel();
94     void ClickOnApply();
95     void SetEditCurrentArgument() ;
96     void SelectionIntoArgument() ;
97     void LineEditReturnPressed() ;
98     void DeactivateActiveDialog() ;
99     void ActivateThisDialog() ;
100     void ReverseVector(int state) ;
101     void ValueChangedInSpinBox( double newValue ) ;
102
103 protected:
104     QGridLayout* GeometryGUI_PrismDlgLayout;
105     QGridLayout* GroupConstructorsLayout;
106     QGridLayout* GroupConstructor1Layout;
107     QGridLayout* GroupButtonsLayout;
108 };
109
110 #endif // DIALOGBOX_PRISM_H