Salome HOME
a8692b37127aa1e31181a13dbfdb254b38978e6a
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ClippingDlg.h
1 // SMESH SMESHGUI : GUI for SMESH 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : SMESHGUI_ClippingDlg.h
23 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
24 //
25
26 #ifndef SMESHGUI_CLIPPINGDLG_H
27 #define SMESHGUI_CLIPPINGDLG_H
28
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31
32 // Qt includes
33 #include <QDialog>
34
35 // VTK includes
36 #include <vtkSmartPointer.h>
37
38 // STL includes
39 #include <vector>
40
41 class QLabel;
42 class QPushButton;
43 class QCheckBox;
44 class QComboBox;
45 class LightApp_SelectionMgr;
46 class SVTK_Selector;
47 class SMESHGUI;
48 class SMESH_Actor;
49 class OrientedPlane;
50 class SMESHGUI_SpinBox;
51
52 namespace SMESH
53 {
54   typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
55   typedef std::vector<TVTKPlane> TPlanes;
56   enum Orientation { XY, YZ, ZX };
57 };
58
59
60 //=================================================================================
61 // class    : SMESHGUI_ClippingDlg
62 // purpose  :
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog
65 {
66   Q_OBJECT
67
68 public:
69   SMESHGUI_ClippingDlg( SMESHGUI* );
70   ~SMESHGUI_ClippingDlg();
71   
72   double                  getDistance() const;
73   void                    setDistance( const double );
74   double                  getRotation1() const;
75   double                  getRotation2() const;
76   void                    setRotation( const double, const double );
77   void                    Sinchronize();
78
79 protected:  
80   void                    keyPressEvent( QKeyEvent* );
81
82 private:
83   LightApp_SelectionMgr*  mySelectionMgr;
84   SVTK_Selector*          mySelector;
85   SMESHGUI*               mySMESHGUI;
86   SMESH_Actor*            myActor;
87   SMESH::TPlanes          myPlanes;
88   
89   QComboBox*              ComboBoxPlanes;
90   QPushButton*            buttonNew;
91   QPushButton*            buttonDelete;
92   QLabel*                 TextLabelOrientation;
93   QComboBox*              ComboBoxOrientation;
94   QLabel*                 TextLabelDistance;
95   SMESHGUI_SpinBox*       SpinBoxDistance;
96   QLabel*                 TextLabelRot1;
97   SMESHGUI_SpinBox*       SpinBoxRot1;
98   QLabel*                 TextLabelRot2;
99   SMESHGUI_SpinBox*       SpinBoxRot2;
100   QCheckBox*              PreviewCheckBox;
101   QCheckBox*              AutoApplyCheckBox;
102   QPushButton*            buttonOk;
103   QPushButton*            buttonCancel;
104   QPushButton*            buttonApply;
105   QPushButton*            buttonHelp;
106   
107   bool                    myIsSelectPlane;
108   QString                 myHelpFileName;
109
110 public slots:
111   void                    onSelectPlane( int );
112   void                    ClickOnNew();
113   void                    ClickOnDelete();
114   void                    onSelectOrientation( int );
115   void                    SetCurrentPlaneParam();
116   void                    onSelectionChanged();
117   void                    OnPreviewToggle( bool );
118   void                    ClickOnOk();
119   void                    ClickOnCancel();
120   void                    ClickOnApply();
121   void                    ClickOnHelp();
122 };
123
124 #endif // SMESHGUI_CLIPPINGDLG_H