Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_CenterMassDlg.h
1 //  File      : GeometryGUI_CenterMassDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Heade$
8
9
10 #ifndef DIALOGBOX_CMASS_H
11 #define DIALOGBOX_CMASS_H
12
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15
16 #include <BRepGProp.hxx>
17 #include <GProp_GProps.hxx>
18 #include <GProp_PrincipalProps.hxx>
19
20 #include <qvariant.h>
21 #include <qdialog.h>
22
23 class QVBoxLayout; 
24 class QHBoxLayout; 
25 class QGridLayout; 
26 class QButtonGroup;
27 class QGroupBox;
28 class QLabel;
29 class QLineEdit;
30 class QPushButton;
31 class QRadioButton;
32 class GeometryGUI;
33
34 //=================================================================================
35 // class    : GeometryGUI_CenterMassDlg
36 // purpose  :
37 //=================================================================================
38 class GeometryGUI_CenterMassDlg : public QDialog
39
40     Q_OBJECT
41
42 public:
43     GeometryGUI_CenterMassDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
44     ~GeometryGUI_CenterMassDlg();
45
46 private:
47
48     void Init( SALOME_Selection* Sel ) ;
49     void closeEvent( QCloseEvent* e ) ;
50     void enterEvent ( QEvent * ) ;                /* mouse enter the QWidget */
51     bool CalculateAndDisplayCenterMass() ;
52
53     GEOM::GEOM_Gen_var myGeom ;                /* Current GeomI object */
54     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
55     SALOME_Selection*     mySelection ;           /* User shape selection */
56     TopoDS_Shape          mySimulationTopoDs;     /* Shape used for simulation display */
57
58     GEOM::GEOM_Shape_var        myGeomShape ;           /* is myBase */
59     TopoDS_Shape          myShape ;               /* Shape argument */
60     gp_Pnt                myCenterMass ;
61     bool                  myOkCenterMass ;        /* true after center of mass simulation calculation */
62     
63     int                   myConstructorId ;       /* Current constructor id = radio button id */
64     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */
65
66     QGroupBox* GroupButtons;
67     QPushButton* buttonOk;
68     QPushButton* buttonCancel;
69     QPushButton* buttonApply;
70     QButtonGroup* GroupConstructors;
71     QRadioButton* Constructor1;
72     QGroupBox* GroupC1;
73     QPushButton* SelectButtonC1A1;
74     QLineEdit* LineEdit_X;
75     QLabel* TextLabel_Z;
76     QLineEdit* LineEdit_Z;
77     QLabel* TextLabelC1A1;
78     QLineEdit* LineEdit_Y;
79     QLabel* TextLabel_Y;
80     QLabel* TextLabel_X;
81     QLabel* TextLabel_Center;
82     QLineEdit* LineEditC1A1;
83
84 private slots:
85
86     void ConstructorsClicked(int constructorId);
87     void ClickOnCancel();
88     void ClickOnOk() ;
89     void ClickOnApply();
90     void SetEditCurrentArgument() ;
91     void LineEditReturnPressed() ;
92     void SelectionIntoArgument() ;
93     void DeactivateActiveDialog() ;
94     void ActivateThisDialog() ;
95
96 protected:
97     QGridLayout* GeometryGUI_CenterMassDlgLayout;
98     QGridLayout* GroupButtonsLayout;
99     QGridLayout* GroupConstructorsLayout;
100     QGridLayout* GroupC1Layout;
101 };
102
103 #endif // DIALOGBOX_CMASS_H