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