Salome HOME
c64f817001e8b5b1c90929f184c3f21fb62dc67b
[modules/geom.git] / src / GEOMGUI / GeometryGUI_InertiaDlg.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_InertiaDlg.h
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #ifndef DIALOGBOX_INERTIA_H
30 #define DIALOGBOX_INERTIA_H
31
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34
35 #include <BRepGProp.hxx>
36 #include <GProp_GProps.hxx>
37 #include <GProp_PrincipalProps.hxx>
38
39 #include <qvariant.h>
40 #include <qdialog.h>
41
42 class QVBoxLayout; 
43 class QHBoxLayout; 
44 class QGridLayout; 
45 class QButtonGroup;
46 class QGroupBox;
47 class QLabel;
48 class QLineEdit;
49 class QPushButton;
50 class QRadioButton;
51 class GeometryGUI;
52
53
54 //=================================================================================
55 // class    : GeometryGUI_InertiaDlg
56 // purpose  :
57 //=================================================================================
58 class GeometryGUI_InertiaDlg : public QDialog
59
60     Q_OBJECT
61
62 public:
63     GeometryGUI_InertiaDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
64     ~GeometryGUI_InertiaDlg();
65
66     void Init( SALOME_Selection* Sel ) ;
67     void closeEvent( QCloseEvent* e ) ;
68     void enterEvent ( QEvent * ) ;                /* mouse enter the QWidget */
69     void CalculateAndDisplayInertia(const TopoDS_Shape& S) ;
70
71     GEOM::GEOM_Gen_var myGeom ;                /* Current GeomI object */
72     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
73     SALOME_Selection*     mySelection ;
74
75     int                   myConstructorId ;       /* Current constructor id = radio button id */
76     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */
77
78
79     QButtonGroup* GroupConstructors;
80     QRadioButton* Constructor1;
81     QGroupBox* GroupC1;
82     QLabel* TextLabelC1A1;
83     QPushButton* SelectButtonC1A1;
84     QLineEdit* LineEditC1A1;
85     QLabel* TextLabel_Matrix;
86     QLabel* TextLabelMatrix_11;
87     QLabel* TextLabelMatrix_21;
88     QLabel* TextLabelMatrix_31;
89     QLineEdit* LineEdit_L1C1;
90     QLineEdit* LineEdit_L1C2;
91     QLineEdit* LineEdit_L1C3;
92     QLineEdit* LineEdit_L2C1;
93     QLineEdit* LineEdit_L2C2;
94     QLineEdit* LineEdit_L2C3;
95     QLineEdit* LineEdit_L3C1;
96     QLineEdit* LineEdit_L3C2;
97     QLineEdit* LineEdit_L3C3;
98     QLineEdit* LineEdit_IX;
99     QLineEdit* LineEdit_IY;
100     QLineEdit* LineEdit_IZ;
101     QLabel* TextLabel_IXIYIZ;
102     QGroupBox* GroupButtons;
103     QPushButton* buttonApply;
104     QPushButton* buttonOk;
105     QPushButton* buttonCancel;
106
107 private slots:
108
109     void ConstructorsClicked(int constructorId);
110     void ClickOnCancel();
111     void SetEditCurrentArgument() ;
112     void LineEditReturnPressed() ;
113     void SelectionIntoArgument() ;
114     void DeactivateActiveDialog() ;
115     void ActivateThisDialog() ;
116
117 protected:
118     QGridLayout* GeometryGUI_InertiaDlgLayout;
119     QGridLayout* GroupConstructorsLayout;
120     QGridLayout* GroupC1Layout;
121     QGridLayout* GroupButtonsLayout;
122 };
123
124 #endif // DIALOGBOX_INERTIA_H