1 // File : GeometryGUI_CenterMassDlg.h
3 // Author : Lucien PIGNOLONI
5 // Module : GeometryGUI
6 // Copyright : OPEN CASCADE
10 #ifndef DIALOGBOX_CMASS_H
11 #define DIALOGBOX_CMASS_H
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
16 #include <BRepGProp.hxx>
17 #include <GProp_GProps.hxx>
18 #include <GProp_PrincipalProps.hxx>
34 //=================================================================================
35 // class : GeometryGUI_CenterMassDlg
37 //=================================================================================
38 class GeometryGUI_CenterMassDlg : public QDialog
43 GeometryGUI_CenterMassDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
44 ~GeometryGUI_CenterMassDlg();
48 void Init( SALOME_Selection* Sel ) ;
49 void closeEvent( QCloseEvent* e ) ;
50 void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
51 bool CalculateAndDisplayCenterMass() ;
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 */
58 GEOM::GEOM_Shape_var myGeomShape ; /* is myBase */
59 TopoDS_Shape myShape ; /* Shape argument */
61 bool myOkCenterMass ; /* true after center of mass simulation calculation */
63 int myConstructorId ; /* Current constructor id = radio button id */
64 QLineEdit* myEditCurrentArgument; /* Current LineEdit */
66 QGroupBox* GroupButtons;
67 QPushButton* buttonOk;
68 QPushButton* buttonCancel;
69 QPushButton* buttonApply;
70 QButtonGroup* GroupConstructors;
71 QRadioButton* Constructor1;
73 QPushButton* SelectButtonC1A1;
74 QLineEdit* LineEdit_X;
76 QLineEdit* LineEdit_Z;
77 QLabel* TextLabelC1A1;
78 QLineEdit* LineEdit_Y;
81 QLabel* TextLabel_Center;
82 QLineEdit* LineEditC1A1;
86 void ConstructorsClicked(int constructorId);
90 void SetEditCurrentArgument() ;
91 void LineEditReturnPressed() ;
92 void SelectionIntoArgument() ;
93 void DeactivateActiveDialog() ;
94 void ActivateThisDialog() ;
97 QGridLayout* GeometryGUI_CenterMassDlgLayout;
98 QGridLayout* GroupButtonsLayout;
99 QGridLayout* GroupConstructorsLayout;
100 QGridLayout* GroupC1Layout;
103 #endif // DIALOGBOX_CMASS_H