-// VISU OBJECT : interactive object for VISU entities implementation
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
+// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_CutPlanesPL.hxx
// Author: Alexey PETROV
// Module : VISU
-
+//
#ifndef VISU_CutPlanesPL_HeaderFile
#define VISU_CutPlanesPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
+#include "VISU_OptionalDeformationPL.hxx"
+#include "VISU_MapperHolder.hxx"
#include <vector>
class vtkAppendPolyData;
-class VISU_CutPlanesPL : public VISU_ScalarMapPL{
-protected:
- VISU_CutPlanesPL();
- VISU_CutPlanesPL(const VISU_CutPlanesPL&);
+
+//----------------------------------------------------------------------------
+class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL,
+ public VISU_OptionalDeformationPL
+{
public:
- vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL);
- static VISU_CutPlanesPL* New();
- virtual ~VISU_CutPlanesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
+ vtkTypeMacro(VISU_CutPlanesPL, VISU_ScalarMapPL);
+
+ static
+ VISU_CutPlanesPL*
+ New();
+ virtual
+ unsigned long int
+ GetMTime();
+
+ //----------------------------------------------------------------------------
enum PlaneOrientation {XY, YZ, ZX};
- virtual const PlaneOrientation& GetPlaneOrientation(int theNum = 0) { return myBasePlane[theNum];}
- virtual void SetPlaneOrientation(const PlaneOrientation& theOrient, int theNum = 0) {
- myBasePlane[theNum] = theOrient;
- }
- virtual float GetDisplacement(int theNum = 0) { return myDisplacement[theNum];}
- virtual void SetDisplacement(float theDisp, int theNum = 0) { myDisplacement[theNum] = theDisp;}
+ virtual
+ void
+ SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum = 0);
+
+ virtual
+ const PlaneOrientation&
+ GetPlaneOrientation(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetRotateX(int theNum = 0);
- virtual void SetPartPosition(int thePartNumber, float thePartPosition);
- virtual float GetPartPosition(int thePartNumber, int theNum = 0);
+ virtual
+ vtkFloatingPointType
+ GetRotateY(int theNum = 0);
- virtual void SetPartDefault(int thePartNumber);
- virtual int IsPartDefault(int thePartNumber);
+ virtual
+ vtkFloatingPointType
+ GetDisplacement(int theNum = 0);
+
+ virtual
+ void
+ SetDisplacement(vtkFloatingPointType theDisp,
+ int theNum = 0);
+
+ virtual
+ void
+ SetPartPosition(int thePartNumber,
+ vtkFloatingPointType thePartPosition);
+
+ virtual
+ vtkFloatingPointType
+ GetPartPosition(int thePartNumber,
+ int theNum = 0);
+
+ virtual
+ void
+ SetPartDefault(int thePartNumber);
+
+ virtual
+ int
+ IsPartDefault(int thePartNumber);
+
+ virtual
+ void
+ SetNbParts(int theNb);
+
+ virtual
+ int
+ GetNbParts();
- virtual void SetRotateX(float theAngle, int theNum = 0);
- virtual float GetRotateX(int theNum = 0);
- virtual void SetRotateY(float theAngle, int theNum = 0);
- virtual float GetRotateY(int theNum = 0);
-
- virtual void SetNbParts(int theNb);
- virtual int GetNbParts(){ return myNbParts;}
-
public:
- virtual void Init();
- virtual void Update();
- virtual vtkAppendPolyData* GetAppendPolyData() { return myAppendPolyData; }
-
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
+ virtual
+ vtkAppendPolyData*
+ GetAppendPolyData()
+ {
+ return myAppendPolyData;
+ }
+
public:
- static float* GetRx(float theRx[3][3], float thaAng);
- static float* GetRy(float theRy[3][3], float thaAng);
- static float* GetRz(float theRz[3][3], float thaAng);
+ static
+ vtkFloatingPointType*
+ GetRx(vtkFloatingPointType theRx[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ vtkFloatingPointType*
+ GetRy(vtkFloatingPointType theRy[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ vtkFloatingPointType*
+ GetRz(vtkFloatingPointType theRz[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ void
+ CorrectPnt(vtkFloatingPointType thePnt[3],
+ const vtkFloatingPointType BoundPrj[6]);
+
+ static
+ void
+ GetBoundProject(vtkFloatingPointType BoundPrj[3],
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3]);
+
+ static
+ void
+ GetDir(vtkFloatingPointType theDir[3],
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane);
+
+ static
+ void
+ ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
+
+ static
+ void
+ CutWithPlane(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3]);
+
+ static
+ void
+ CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
+
+ virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper);
+ VISU::PUnstructuredGridIDMapper getVectorialField();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
+
+
+protected:
+ VISU_CutPlanesPL();
- static void CorrectPnt(float thePnt[3], const float BoundPrj[6]);
- static void GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]);
+ virtual
+ ~VISU_CutPlanesPL();
- static void GetDir(float theDir[3], float theAng[3], const PlaneOrientation& theBasePlane);
+ virtual
+ vtkDataSet*
+ InsertCustomPL();
- static void ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput);
- static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- float theDir[3], float theOrig[3]);
- static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- const std::vector<float>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- float theDisplacement);
-protected:
- virtual THook* DoHook();
- void SetPartPosition(int theNum = 0);
+ void
+ SetPartPosition(int theNum = 0);
int myNbParts;
PlaneOrientation myBasePlane[2];
- float myAng[2][3], myDisplacement[2];
+ vtkFloatingPointType myAng[2][3], myDisplacement[2];
vtkAppendPolyData *myAppendPolyData;
- std::vector<float> myPartPosition;
+ std::vector<vtkFloatingPointType> myPartPosition;
std::vector<int> myPartCondition;
+
+private:
+ VISU_CutPlanesPL(const VISU_CutPlanesPL&); // Not implemented.
+ void operator=(const VISU_CutPlanesPL&); // Not implemented.
};
#endif