Salome HOME
sources v1.2
[modules/geom.git] / src / GEOMGUI / GeometryGUI_ScaleDlg.h
1 //  File      : GeometryGUI_ScaleDlg.h
2 //  Created   :
3 //  Author    : Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GeometryGUI
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9 #ifndef DIALOGBOX_SCALE_H
10 #define DIALOGBOX_SCALE_H
11
12 #include "SALOME_Selection.h"
13 #include "GEOM_ShapeTypeFilter.hxx"
14
15 #include <gp_Pnt.hxx>
16
17 #include <qvariant.h>
18 #include <qdialog.h>
19
20 class QVBoxLayout; 
21 class QHBoxLayout; 
22 class QGridLayout;
23 class QButtonGroup;
24 class QGroupBox;
25 class QLabel;
26 class QLineEdit;
27 class QPushButton;
28 class QRadioButton;
29 class GeometryGUI;
30
31
32 //=================================================================================
33 // class    : GeometryGUI_ScaleDlg
34 // purpose  :
35 //=================================================================================
36 class GeometryGUI_ScaleDlg : public QDialog
37
38     Q_OBJECT
39
40 public:
41     GeometryGUI_ScaleDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
42     ~GeometryGUI_ScaleDlg();
43
44 private :
45  
46     void closeEvent( QCloseEvent* e ) ;
47     void enterEvent( QEvent* e );
48     void Init(SALOME_Selection* Sel) ;
49     void MakeScaleSimulationAndDisplay( const TopoDS_Shape& S ) ;
50
51     GEOM::GEOM_Gen_var myGeom ;                /* Current GeomI object */
52     GeometryGUI*          myGeomGUI ;             /* Current GeomGUI object */
53     TopoDS_Shape          mySimulationTopoDs ;    /* Shape used for simulation display */
54     SALOME_Selection*     mySelection ;           /* User shape selection */    
55     gp_Pnt                myPoint1 ;              /* Points containing the vector */
56     TopoDS_Shape          myBaseTopo ;
57     GEOM::GEOM_Shape_var        myGeomShape ;           /* is myBaseTopo */
58     Standard_Real         myFactor ;
59     bool                  myOkPoint1 ;            /* true when myPoint1 is defined */
60     bool                  myOkBaseTopo ;          /* true when myBaseTopo is defined */
61     int                   myConstructorId ;       /* Current constructor id = radio button id */ 
62     QLineEdit*            myEditCurrentArgument;  /* Current LineEdit */
63     Handle(GEOM_ShapeTypeFilter) myVertexFilter;  /* filter for selection */
64
65     QButtonGroup* GroupConstructors;
66     QRadioButton* Constructor1;
67     QGroupBox* GroupC1;
68     QLabel* TextLabelC1A1;
69     QLabel* TextLabelC1A2;
70     QPushButton* SelectButtonC1A1;
71     QPushButton* SelectButtonC1A2;
72     QLineEdit* LineEditC1A1;
73     QLineEdit* LineEditC1A2;
74     QLineEdit* LineEditC1A3;
75     QLabel* TextLabelC1A3;
76     QGroupBox* GroupButtons;
77     QPushButton* buttonApply;
78     QPushButton* buttonOk;
79     QPushButton* buttonCancel;
80
81 private slots :
82     
83     void ConstructorsClicked(int constructorId);
84     void ClickOnOk();
85     void ClickOnCancel();
86     void ClickOnApply();
87     void SetEditCurrentArgument() ;
88     void SelectionIntoArgument() ;
89     void LineEditReturnPressed() ;
90     void DeactivateActiveDialog() ;
91     void ActivateThisDialog() ; 
92     void TextChangedInLineEdit(const QString& newText) ;
93
94 protected:
95     QGridLayout* GeometryGUI_ScaleDlgLayout;
96     QGridLayout* GroupConstructorsLayout;
97     QGridLayout* GroupC1Layout;
98     QGridLayout* GroupButtonsLayout;
99 };
100
101 #endif // DIALOGBOX_SCALE_H