Salome HOME
Merge with branch V2_2_0_VISU_improvement
[modules/visu.git] / src / VISUGUI / VisuGUI_ClippingDlg.h
1
2 #ifndef DIALOGBOX_CLIPPING_H
3 #define DIALOGBOX_CLIPPING_H
4
5 #include "QtxDblSpinBox.h"
6
7 // QT Includes
8 #include <qdialog.h>
9 #include <qtable.h>
10
11 // VTK Includes
12 #include <vtkSmartPointer.h>
13 #include <vtkPlane.h>
14
15 // STL Includes
16 #include <vector>
17
18 class QLabel;
19 class QPushButton;
20 class QTable;
21 class QCheckBox;
22 class QComboBox;
23 class QHButtonGroup;
24 class QSpinBox;
25 class QTabWidget;
26
27 class QtxDblSpinBox;
28
29 class SalomeApp_SelectionMgr;
30
31 class VisuGUI;
32
33 class OrientedPlane;
34
35 namespace VISU {
36   class Prs3d_i;
37
38   typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
39   typedef std::vector<TVTKPlane> TPlanes;
40   enum Orientation {XY, YZ, ZX};
41 };
42
43
44 //=================================================================================
45 // class    : VisuGUI_ClippingDlg
46 // purpose  :
47 //=================================================================================
48 class VisuGUI_ClippingDlg : public QDialog
49 {
50     Q_OBJECT
51
52 public:
53     VisuGUI_ClippingDlg( VisuGUI* theModule,
54                          const char* name = 0,
55                          bool modal = false,
56                          WFlags fl = 0 );
57
58     float  getDistance()  { return (float)SpinBoxDistance->value(); }
59     void   setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); }
60     double getRotation1() { return SpinBoxRot1->value(); }
61     double getRotation2() { return SpinBoxRot2->value(); }
62     void   setRotation(const double theRot1, const double theRot2);
63     void Sinchronize();
64
65     ~VisuGUI_ClippingDlg();
66
67 private:
68
69     SalomeApp_SelectionMgr* mySelectionMgr;
70
71     VisuGUI       * myVisuGUI;
72     VISU::Prs3d_i * myPrs3d;
73     VISU::TPlanes   myPlanes;
74
75     QComboBox*        ComboBoxPlanes;
76     QPushButton*      buttonNew;
77     QPushButton*      buttonDelete;
78
79     QLabel*           TextLabelOrientation;
80     QLabel*           TextLabelDistance;
81     QLabel*           TextLabelRot1;
82     QLabel*           TextLabelRot2;
83
84     QTabWidget*       TabPane;
85
86     QComboBox*        ComboBoxOrientation;
87     QtxDblSpinBox*    SpinBoxDistance;
88     QtxDblSpinBox*    SpinBoxRot1;
89     QtxDblSpinBox*    SpinBoxRot2;
90
91     QWidget*          WidgetIJKTab;
92     QHButtonGroup*    ButtonGroupIJKAxis;
93     QLabel*           TextLabelIJKIndex;
94     QSpinBox*         SpinBoxIJKIndex;
95     QCheckBox*        CheckBoxIJKPlaneReverse;
96
97     QCheckBox*        PreviewCheckBox;
98     QCheckBox*        AutoApplyCheckBox;
99
100     QPushButton*      buttonOk;
101     QPushButton*      buttonCancel;
102     QPushButton*      buttonApply;
103
104     bool myIsSelectPlane;
105
106 protected:
107     QWidget* createParamsTab();
108     QWidget* createIJKParamsTab();
109     void setIJKByNonStructured();
110     bool isStructured() const;
111
112 public slots:
113
114     void onSelectPlane(int theIndex);
115     void ClickOnNew();
116     void ClickOnDelete();
117     void onSelectOrientation(int theItem);
118     void SetCurrentPlaneParam();
119     void SetCurrentPlaneIJKParam();
120     void onIJKAxisChanged(int axis);
121     void onTabChanged(QWidget* newTab);
122     void onSelectionChanged();
123     void OnPreviewToggle(bool theIsToggled);
124     void ClickOnOk();
125     void ClickOnCancel();
126     void ClickOnApply();
127 };
128
129 #endif // DIALOGBOX_TRANSPARENCYDLG_H