1 // Copyright (C) 2007-2008 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
22 #ifndef DIALOGBOX_CLIPPINGPANEL_H
23 #define DIALOGBOX_CLIPPINGPANEL_H
29 class VisuGUI_ClippingPlaneDlg;
31 class SVTK_ViewWindow;
32 class SUIT_ViewWindow;
33 class vtkPolyDataMapper;
37 #include "VISU_Prs3d_i.hh"
38 #include "VisuGUI_Panel.h"
39 //#include <VisuGUI_SegmentationMgr.h>
40 #include <VISU_ClippingPlaneMgr.hxx>
46 #include <SALOMEDSClient_SObject.hxx>
49 /*class CutPlaneFunction: public vtkPlane
52 static CutPlaneFunction* New();
54 vtkTypeMacro(CutPlaneFunction, vtkPlane);
56 virtual double EvaluateFunction(double x[3]);
57 virtual double EvaluateFunction(double x, double y, double z);
59 void setActive(bool theActive);
60 bool isActive() const { return myIsActive; }
62 void setPlaneObject(_PTR(SObject) aSOPlane) { mySObject = aSOPlane; }
63 _PTR(SObject) getPlaneObject() const { return mySObject; }
71 _PTR(SObject) mySObject;
78 vtkSmartPointer<CutPlaneFunction> plane;
87 //PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds);
88 PreviewPlane(SVTK_ViewWindow* theWindow, VISU_CutPlaneFunction* thePlane, const double* theBounds);
91 void setVisible(bool theVisible)
92 { myActor->SetVisibility(theVisible); }
95 SVTK_ViewWindow* myWindow;
98 vtkPolyDataMapper* myMapper;
99 const double* myBounds;
106 //typedef QList<PlaneDef> QListOfPlanes;
107 typedef QList<vtkPlane*> ListOfvtkPlanes;
108 typedef QList<PreviewPlane*> ListOfPreview;
114 class VisuGUI_ClippingPanel: public VisuGUI_Panel
118 VisuGUI_ClippingPanel(VisuGUI* theModule);
119 ~VisuGUI_ClippingPanel();
124 //virtual void showEvent(QShowEvent* event);
125 //virtual void hideEvent(QHideEvent* event);
128 void onPresentationCreate(VISU::Prs3d_i* thePrs);
131 virtual void onApply();
132 virtual void onHelp();
138 void onPlaneEdited();
139 void onPlaneDelete();
140 void onCancelDialog();
141 void setPlanesNonActive(bool theState);
142 void setPlanesVisible(bool theVisible);
143 void onWindowActivated(SUIT_ViewWindow* theWindow);
144 void onCellChanged(int row, int col);
145 void onObjectDelete(QString theEntry);
146 void onPrsSelected(int thePrs);
147 void onWindowDestroyed(QObject* theWnd);
151 void fillPlanesList();
153 bool isAutoApply() const;
155 VISU_ClippingPlaneMgr& getPlanesMgr() const;
158 //void updatePlane(_PTR(SObject) theObject, PlaneDef& thePlane);
159 //PlaneDef createEmptyPlane();
160 //static bool containsPlane(VISU::Prs3d_i* thePrs, const PlaneDef& thePlane);
162 QString getPrsName(VISU::Prs3d_i* thePrs);
164 bool isVISUDataReady();
166 void applyPlaneToPrs(int thePlaneNum, int thePrsNum, bool isChecked);
168 //QList<VISU::Prs3d_i*> getPrsList(_PTR(Study) theStudy, _PTR(SObject) theObject);
169 QStringList getPrsList(_PTR(Study) theStudy, _PTR(SObject) theObject);
170 VISU::Prs3d_i* getPrs(QString theEntry);
174 QListWidget* myPrsList;
175 QTableWidget* myPlanesList;
177 QCheckBox* myShowPlanes;
178 QCheckBox* myNonActivePlanes;
179 QCheckBox* myAutoApply;
181 //QListOfPlanes myPlanes;
182 // QList<VISU::Prs3d_i*> myPresentations;
183 QStringList myPresentations; // Stores entries of presentation objects
184 ListOfPreview myPreview;
186 VisuGUI_ClippingPlaneDlg* myPlaneDlg;
187 //int myEditingPlanePos;
188 SVTK_ViewWindow* myViewWindow;
190 //QList<int> myCheckedPlanes;