1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
21 #ifndef DIALOGBOX_CLIPPING_H
22 #define DIALOGBOX_CLIPPING_H
24 #include "SALOME_InteractiveObject.hxx"
26 #include "QtxDblSpinBox.h"
33 #include <vtkSmartPointer.h>
52 class SVTK_ViewWindow;
54 class LightApp_SelectionMgr;
59 class vtkDataSetMapper;
66 typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
67 typedef std::vector<TVTKPlane> TPlanes;
68 enum Orientation {XY, YZ, ZX};
71 //=================================================================================
72 //class : OrientedPlane
74 //=================================================================================
75 class OrientedPlane: public vtkPlane
77 SVTK_ViewWindow* myViewWindow;
78 vtkDataSetMapper* myMapper;
81 static OrientedPlane* New();
82 static OrientedPlane* New (SVTK_ViewWindow* vw);
84 vtkTypeMacro(OrientedPlane, vtkPlane);
86 VISU::Orientation myOrientation;
90 vtkPlaneSource* myPlaneSource;
91 SALOME_Actor* myActor;
93 void SetOrientation(VISU::Orientation theOrientation);
94 VISU::Orientation GetOrientation();
96 void SetDistance(float theDistance);
99 void ShallowCopy(OrientedPlane* theOrientedPlane);
103 OrientedPlane(SVTK_ViewWindow* vw);
109 OrientedPlane(const OrientedPlane&);
110 void operator=(const OrientedPlane&);
113 //=================================================================================
114 // class : VisuGUI_ClippingDlg
116 //=================================================================================
117 class VisuGUI_ClippingDlg : public QDialog
122 VisuGUI_ClippingDlg( VisuGUI* theModule,
123 const char* name = 0,
127 float getDistance() { return (float)SpinBoxDistance->value(); }
128 void setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); }
129 double getRotation1() { return SpinBoxRot1->value(); }
130 double getRotation2() { return SpinBoxRot2->value(); }
131 void setRotation(const double theRot1, const double theRot2);
134 ~VisuGUI_ClippingDlg();
138 LightApp_SelectionMgr* mySelectionMgr;
139 Handle(SALOME_InteractiveObject) myIO;
142 VISU::Prs3d_i * myPrs3d;
143 VISU::TPlanes myPlanes;
145 QComboBox* ComboBoxPlanes;
146 QPushButton* buttonNew;
147 QPushButton* buttonDelete;
149 QLabel* TextLabelOrientation;
150 QLabel* TextLabelDistance;
151 QLabel* TextLabelRot1;
152 QLabel* TextLabelRot2;
156 QComboBox* ComboBoxOrientation;
157 QtxDblSpinBox* SpinBoxDistance;
158 QtxDblSpinBox* SpinBoxRot1;
159 QtxDblSpinBox* SpinBoxRot2;
161 QWidget* WidgetIJKTab;
162 QHButtonGroup* ButtonGroupIJKAxis;
163 QLabel* TextLabelIJKIndex;
164 QSpinBox* SpinBoxIJKIndex;
165 QCheckBox* CheckBoxIJKPlaneReverse;
167 QCheckBox* PreviewCheckBox;
168 QCheckBox* AutoApplyCheckBox;
170 QPushButton* buttonOk;
171 QPushButton* buttonCancel;
172 QPushButton* buttonApply;
173 QPushButton* buttonHelp;
175 bool myIsSelectPlane;
178 QWidget* createParamsTab();
179 QWidget* createIJKParamsTab();
180 void setIJKByNonStructured();
181 bool isStructured() const;
185 void onSelectPlane(int theIndex);
187 void ClickOnDelete();
188 void onSelectOrientation(int theItem);
189 void SetCurrentPlaneParam();
190 void SetCurrentPlaneIJKParam();
191 void onIJKAxisChanged(int axis);
192 void onTabChanged(QWidget* newTab);
193 void onSelectionChanged();
194 void OnPreviewToggle(bool theIsToggled);
196 void ClickOnCancel();
201 #endif // DIALOGBOX_TRANSPARENCYDLG_H