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 // VISU OBJECT : interactive object for VISU entities implementation
23 // File: VISU_CutPlanesPL.hxx
24 // Author: Alexey PETROV
27 #ifndef VISU_CutPlanesPL_HeaderFile
28 #define VISU_CutPlanesPL_HeaderFile
30 #include "VISUPipeline.hxx"
31 #include "VISU_ScalarMapPL.hxx"
32 #include "VISU_OptionalDeformationPL.hxx"
33 #include "VISU_MapperHolder.hxx"
37 class vtkAppendPolyData;
40 //----------------------------------------------------------------------------
41 class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL,
42 public VISU_OptionalDeformationPL
45 vtkTypeMacro(VISU_CutPlanesPL, VISU_ScalarMapPL);
55 //----------------------------------------------------------------------------
56 enum PlaneOrientation {XY, YZ, ZX};
60 SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
61 vtkFloatingPointType theXAng,
62 vtkFloatingPointType theYAng,
66 const PlaneOrientation&
67 GetPlaneOrientation(int theNum = 0);
71 GetRotateX(int theNum = 0);
75 GetRotateY(int theNum = 0);
79 GetDisplacement(int theNum = 0);
83 SetDisplacement(vtkFloatingPointType theDisp,
88 SetPartPosition(int thePartNumber,
89 vtkFloatingPointType thePartPosition);
93 GetPartPosition(int thePartNumber,
98 SetPartDefault(int thePartNumber);
102 IsPartDefault(int thePartNumber);
106 SetNbParts(int theNb);
121 //! Gets memory size used by the instance (bytes).
130 return myAppendPolyData;
135 vtkFloatingPointType*
136 GetRx(vtkFloatingPointType theRx[3][3],
137 vtkFloatingPointType thaAng);
140 vtkFloatingPointType*
141 GetRy(vtkFloatingPointType theRy[3][3],
142 vtkFloatingPointType thaAng);
145 vtkFloatingPointType*
146 GetRz(vtkFloatingPointType theRz[3][3],
147 vtkFloatingPointType thaAng);
151 CorrectPnt(vtkFloatingPointType thePnt[3],
152 const vtkFloatingPointType BoundPrj[6]);
156 GetBoundProject(vtkFloatingPointType BoundPrj[3],
157 const vtkFloatingPointType BoundBox[6],
158 const vtkFloatingPointType Dir[3]);
162 GetDir(vtkFloatingPointType theDir[3],
163 const vtkFloatingPointType theAng[3],
164 const PlaneOrientation& theBasePlane);
168 ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
172 CutWithPlane(vtkAppendPolyData* theAppendPolyData,
173 vtkDataSet* theDataSet,
174 vtkFloatingPointType theDir[3],
175 vtkFloatingPointType theOrig[3]);
179 CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
180 vtkDataSet* theDataSet,
182 vtkFloatingPointType theDir[3],
183 vtkFloatingPointType theBounds[6],
184 const std::vector<vtkFloatingPointType>& thePlanePosition,
185 const std::vector<int>& thePlaneCondition,
186 vtkFloatingPointType theDisplacement);
188 virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper);
189 VISU::PUnstructuredGridIDMapper getVectorialField();
193 SetMapScale(vtkFloatingPointType theMapScale = 1.0);
208 DoShallowCopy(VISU_PipeLine *thePipeLine,
209 bool theIsCopyInput);
212 SetPartPosition(int theNum = 0);
215 PlaneOrientation myBasePlane[2];
216 vtkFloatingPointType myAng[2][3], myDisplacement[2];
217 vtkAppendPolyData *myAppendPolyData;
218 std::vector<vtkFloatingPointType> myPartPosition;
219 std::vector<int> myPartCondition;
222 VISU_CutPlanesPL(const VISU_CutPlanesPL&); // Not implemented.
223 void operator=(const VISU_CutPlanesPL&); // Not implemented.