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/ or email : webmaster.salome@opencascade.com
21 #ifndef DIALOGBOX_CLIPPING_H
22 #define DIALOGBOX_CLIPPING_H
24 #include "SALOME_InteractiveObject.hxx"
26 #include "QtxDblSpinBox.h"
30 #include <qguardedptr.h>
34 #include <vtkSmartPointer.h>
53 class SVTK_ViewWindow;
55 class LightApp_SelectionMgr;
60 class vtkDataSetMapper;
67 typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
68 typedef std::vector<TVTKPlane> TPlanes;
69 enum Orientation {XY, YZ, ZX};
72 //=================================================================================
73 //class : OrientedPlane
75 //=================================================================================
76 class OrientedPlane: public vtkPlane
78 QGuardedPtr<SVTK_ViewWindow> myViewWindow;
79 vtkDataSetMapper* myMapper;
82 static OrientedPlane* New();
83 static OrientedPlane* New (SVTK_ViewWindow* vw);
85 vtkTypeMacro(OrientedPlane, vtkPlane);
87 VISU::Orientation myOrientation;
91 vtkPlaneSource* myPlaneSource;
92 SALOME_Actor* myActor;
94 void SetOrientation(VISU::Orientation theOrientation);
95 VISU::Orientation GetOrientation();
97 void SetDistance(float theDistance);
100 void ShallowCopy(OrientedPlane* theOrientedPlane);
104 OrientedPlane(SVTK_ViewWindow* vw);
110 OrientedPlane(const OrientedPlane&);
111 void operator=(const OrientedPlane&);
114 //=================================================================================
115 // class : VisuGUI_ClippingDlg
117 //=================================================================================
118 class VisuGUI_ClippingDlg : public QDialog
123 VisuGUI_ClippingDlg( VisuGUI* theModule,
124 const char* name = 0,
128 float getDistance() { return (float)SpinBoxDistance->value(); }
129 void setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); }
130 double getRotation1() { return SpinBoxRot1->value(); }
131 double getRotation2() { return SpinBoxRot2->value(); }
132 void setRotation(const double theRot1, const double theRot2);
135 ~VisuGUI_ClippingDlg();
138 void keyPressEvent( QKeyEvent* e );
140 void SetPrs3d(VISU::Prs3d_i* thePrs);
145 LightApp_SelectionMgr* mySelectionMgr;
146 Handle(SALOME_InteractiveObject) myIO;
149 VISU::Prs3d_i * myPrs3d;
150 VISU::TPlanes myPlanes;
152 QComboBox* ComboBoxPlanes;
153 QPushButton* buttonNew;
154 QPushButton* buttonDelete;
156 QLabel* TextLabelOrientation;
157 QLabel* TextLabelDistance;
158 QLabel* TextLabelRot1;
159 QLabel* TextLabelRot2;
163 QComboBox* ComboBoxOrientation;
164 QtxDblSpinBox* SpinBoxDistance;
165 QtxDblSpinBox* SpinBoxRot1;
166 QtxDblSpinBox* SpinBoxRot2;
168 QWidget* WidgetIJKTab;
169 QHButtonGroup* ButtonGroupIJKAxis;
170 QLabel* TextLabelIJKIndex;
171 QSpinBox* SpinBoxIJKIndex;
172 QCheckBox* CheckBoxIJKPlaneReverse;
174 QCheckBox* PreviewCheckBox;
175 QCheckBox* AutoApplyCheckBox;
177 QPushButton* buttonOk;
178 QPushButton* buttonCancel;
179 QPushButton* buttonApply;
180 QPushButton* buttonHelp;
182 bool myIsSelectPlane;
185 QWidget* createParamsTab();
186 QWidget* createIJKParamsTab();
187 void setIJKByNonStructured();
188 bool isStructured() const;
192 void onSelectPlane(int theIndex);
194 void ClickOnDelete();
195 void onSelectOrientation(int theItem);
196 void SetCurrentPlaneParam();
197 void SetCurrentPlaneIJKParam();
198 void onIJKAxisChanged(int axis);
199 void onTabChanged(QWidget* newTab);
200 void onSelectionChanged();
201 void OnPreviewToggle(bool theIsToggled);
203 void ClickOnCancel();
208 #endif // DIALOGBOX_TRANSPARENCYDLG_H