1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_ClippingDlg.h
25 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_CLIPPINGDLG_H
28 #define SMESHGUI_CLIPPINGDLG_H
31 #include "SMESH_SMESHGUI.hxx"
34 #include <SVTK_ViewWindow.h>
40 #include <vtkSmartPointer.h>
49 class LightApp_SelectionMgr;
54 class SMESHGUI_SpinBox;
58 typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
59 typedef std::vector<TVTKPlane> TPlanes;
60 enum Orientation { XY, YZ, ZX };
64 //=================================================================================
65 // class : SMESHGUI_ClippingDlg
67 //=================================================================================
68 class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog
73 SMESHGUI_ClippingDlg( SMESHGUI* );
74 ~SMESHGUI_ClippingDlg();
76 double getDistance() const;
77 void setDistance( const double );
78 double getRotation1() const;
79 double getRotation2() const;
80 void setRotation( const double, const double );
83 // used in SMESHGUI::restoreVisualParameters() to avoid
84 // declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
85 static void AddPlane (SMESH_Actor* theActor,
86 SVTK_ViewWindow* theViewWindow,
87 SMESH::Orientation theOrientation,
89 vtkFloatingPointType theAngle[2]);
91 static void GetPlaneParam (SMESH_Actor* theActor,
93 SMESH::Orientation& theOrientation,
95 vtkFloatingPointType* theAngle);
98 void keyPressEvent( QKeyEvent* );
101 LightApp_SelectionMgr* mySelectionMgr;
102 SVTK_Selector* mySelector;
103 SMESHGUI* mySMESHGUI;
104 SMESH_Actor* myActor;
105 SMESH::TPlanes myPlanes;
107 QComboBox* ComboBoxPlanes;
108 QPushButton* buttonNew;
109 QPushButton* buttonDelete;
110 QLabel* TextLabelOrientation;
111 QComboBox* ComboBoxOrientation;
112 QLabel* TextLabelDistance;
113 SMESHGUI_SpinBox* SpinBoxDistance;
114 QLabel* TextLabelRot1;
115 SMESHGUI_SpinBox* SpinBoxRot1;
116 QLabel* TextLabelRot2;
117 SMESHGUI_SpinBox* SpinBoxRot2;
118 QCheckBox* PreviewCheckBox;
119 QCheckBox* AutoApplyCheckBox;
120 QPushButton* buttonOk;
121 QPushButton* buttonCancel;
122 QPushButton* buttonApply;
123 QPushButton* buttonHelp;
125 bool myIsSelectPlane;
126 QString myHelpFileName;
129 void onSelectPlane( int );
131 void ClickOnDelete();
132 void onSelectOrientation( int );
133 void SetCurrentPlaneParam();
134 void onSelectionChanged();
135 void OnPreviewToggle( bool );
137 void ClickOnCancel();
142 #endif // SMESHGUI_CLIPPINGDLG_H