Salome HOME
in GetNodeParamOnEdge(), take into account that nodes on vertices not
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ClippingDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 //  SMESH SMESHGUI : GUI for SMESH component
23 //  File   : SMESHGUI_TransparencyDlg.h
24 //  Author : Nicolas REJNERI
25 //  Module : SMESH
26 //  $Header$
27 //
28 #ifndef DIALOGBOX_CLIPPING_H
29 #define DIALOGBOX_CLIPPING_H
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 #include <SMESHGUI_SpinBox.h>
34
35 #include <vtkSmartPointer.h>
36 #include <vtkPlane.h>
37
38 #include <vector>
39
40 // QT Includes
41 #include <qdialog.h>
42 #include <qtable.h>
43
44 class QLabel;
45 class QPushButton;
46 class QTable;
47 class QCheckBox;
48 class QComboBox;
49
50 class LightApp_SelectionMgr;
51 class SVTK_Selector;
52
53 class SMESHGUI;
54 class SMESH_Actor;
55
56 class OrientedPlane;
57
58
59 namespace SMESH {
60
61   typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
62   typedef std::vector<TVTKPlane> TPlanes;
63   enum Orientation {XY, YZ, ZX};
64
65 };
66
67
68 //=================================================================================
69 // class    : SMESHGUI_ClippingDlg
70 // purpose  :
71 //=================================================================================
72 class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog
73 {
74     Q_OBJECT
75
76 public:
77     SMESHGUI_ClippingDlg (SMESHGUI* theModule,
78                           const char* name = 0,
79                           bool modal = false,
80                           WFlags fl = 0);
81
82     float  getDistance()  { return  (float)SpinBoxDistance->GetValue(); }
83     void   setDistance (const float theDistance) { SpinBoxDistance->SetValue(theDistance); }
84     double getRotation1() { return SpinBoxRot1->GetValue(); }
85     double getRotation2() { return SpinBoxRot2->GetValue(); }
86     void   setRotation (const double theRot1, const double theRot2);
87     void   Sinchronize();
88
89     void   keyPressEvent(QKeyEvent*);
90
91     ~SMESHGUI_ClippingDlg();
92
93 private:
94
95     LightApp_SelectionMgr*  mySelectionMgr;
96     SVTK_Selector*          mySelector;
97     SMESHGUI*               mySMESHGUI;
98     SMESH_Actor*            myActor;
99     SMESH::TPlanes          myPlanes;
100
101     QComboBox*        ComboBoxPlanes;
102     QPushButton*      buttonNew;
103     QPushButton*      buttonDelete;
104     QLabel*           TextLabelOrientation;
105     QComboBox*        ComboBoxOrientation;
106     QLabel*           TextLabelDistance;
107     SMESHGUI_SpinBox* SpinBoxDistance;
108     QLabel*           TextLabelRot1;
109     SMESHGUI_SpinBox* SpinBoxRot1;
110     QLabel*           TextLabelRot2;
111     SMESHGUI_SpinBox* SpinBoxRot2;
112     QCheckBox*        PreviewCheckBox;
113     QCheckBox*        AutoApplyCheckBox;
114     QPushButton*      buttonOk;
115     QPushButton*      buttonCancel;
116     QPushButton*      buttonApply;
117     QPushButton*      buttonHelp;
118
119     bool myIsSelectPlane;
120     QString myHelpFileName;
121
122 public slots:
123
124     void onSelectPlane (int theIndex);
125     void ClickOnNew();
126     void ClickOnDelete();
127     void onSelectOrientation (int theItem);
128     void SetCurrentPlaneParam();
129     void onSelectionChanged();
130     void OnPreviewToggle (bool theIsToggled);
131     void ClickOnOk();
132     void ClickOnCancel();
133     void ClickOnApply();
134     void ClickOnHelp();
135 };
136
137 #endif // DIALOGBOX_TRANSPARENCYDLG_H