1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_ClippingDlg.h
23 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
26 #ifndef SMESHGUI_CLIPPINGDLG_H
27 #define SMESHGUI_CLIPPINGDLG_H
30 #include "SMESH_SMESHGUI.hxx"
33 #include <SVTK_ViewWindow.h>
39 #include <vtkSmartPointer.h>
48 class LightApp_SelectionMgr;
53 class SMESHGUI_SpinBox;
57 typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
58 typedef std::vector<TVTKPlane> TPlanes;
59 enum Orientation { XY, YZ, ZX };
63 //=================================================================================
64 // class : SMESHGUI_ClippingDlg
66 //=================================================================================
67 class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog
72 SMESHGUI_ClippingDlg( SMESHGUI* );
73 ~SMESHGUI_ClippingDlg();
75 double getDistance() const;
76 void setDistance( const double );
77 double getRotation1() const;
78 double getRotation2() const;
79 void setRotation( const double, const double );
82 // used in SMESHGUI::restoreVisualParameters() to avoid
83 // declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
84 static void AddPlane (SMESH_Actor* theActor,
85 SVTK_ViewWindow* theViewWindow,
86 SMESH::Orientation theOrientation,
88 vtkFloatingPointType theAngle[2]);
90 static void GetPlaneParam (SMESH_Actor* theActor,
92 SMESH::Orientation& theOrientation,
94 vtkFloatingPointType* theAngle);
97 void keyPressEvent( QKeyEvent* );
100 LightApp_SelectionMgr* mySelectionMgr;
101 SVTK_Selector* mySelector;
102 SMESHGUI* mySMESHGUI;
103 SMESH_Actor* myActor;
104 SMESH::TPlanes myPlanes;
106 QComboBox* ComboBoxPlanes;
107 QPushButton* buttonNew;
108 QPushButton* buttonDelete;
109 QLabel* TextLabelOrientation;
110 QComboBox* ComboBoxOrientation;
111 QLabel* TextLabelDistance;
112 SMESHGUI_SpinBox* SpinBoxDistance;
113 QLabel* TextLabelRot1;
114 SMESHGUI_SpinBox* SpinBoxRot1;
115 QLabel* TextLabelRot2;
116 SMESHGUI_SpinBox* SpinBoxRot2;
117 QCheckBox* PreviewCheckBox;
118 QCheckBox* AutoApplyCheckBox;
119 QPushButton* buttonOk;
120 QPushButton* buttonCancel;
121 QPushButton* buttonApply;
122 QPushButton* buttonHelp;
124 bool myIsSelectPlane;
125 QString myHelpFileName;
128 void onSelectPlane( int );
130 void ClickOnDelete();
131 void onSelectOrientation( int );
132 void SetCurrentPlaneParam();
133 void onSelectionChanged();
134 void OnPreviewToggle( bool );
136 void ClickOnCancel();
141 #endif // SMESHGUI_CLIPPINGDLG_H