X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPIPELINE%2FVISU_PipeLine.hxx;h=76d3d2bc33a97fd481911ca654308fe793ebede5;hb=3f4152dedc1ae968267cfb8a079f261ec0088ed0;hp=4dd6db6ea26d3770e796b46295a50c63775051a8;hpb=89c0929d7f592396b319872c9f6187275bd3e8fb;p=modules%2Fvisu.git diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 4dd6db6e..76d3d2bc 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -27,35 +27,50 @@ #ifndef VISU_PipeLine_HeaderFile #define VISU_PipeLine_HeaderFile +#include #include #include -#include +#include "VISU_IDMapper.hxx" + +class vtkCell; +class vtkDataSet; +class vtkImplicitFunction; template class TVTKSmartPtr: public vtkSmartPointer { public: - TVTKSmartPtr() {} - TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer(r) { + TVTKSmartPtr() + {} + + TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer(r) + { if(r && theIsOwner) r->Delete(); } - TVTKSmartPtr& operator()(T* r, bool theIsOwner = false){ + + TVTKSmartPtr& operator()(T* r, bool theIsOwner = false) + { vtkSmartPointer::operator=(r); if(r && theIsOwner) r->Delete(); return *this; } - TVTKSmartPtr& operator=(T* r){ + + TVTKSmartPtr& operator=(T* r) + { vtkSmartPointer::operator=(r); return *this; } - operator T* () const { + + operator T* () const + { return vtkSmartPointer::GetPointer(); } }; +class vtkMapper; class vtkDataSetMapper; class vtkUnstructuredGrid; class vtkExtractGeometry; @@ -64,54 +79,151 @@ class vtkPlane; class SALOME_ExtractGeometry; -typedef vtkUnstructuredGrid TInput; +typedef VISU::TVTKOutput TInput; class VISU_PipeLine : public vtkObject{ public: vtkTypeMacro(VISU_PipeLine,vtkObject); - virtual ~VISU_PipeLine(); + virtual + ~VISU_PipeLine(); + + virtual + void + DebugOn(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SameAs(VISU_PipeLine *thePipeLine); + virtual + void + DebugOff(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SameAs(VISU_PipeLine *thePipeLine); public: - virtual void SetInput(TInput* theInput); - virtual TInput* GetInput() const; + virtual + void + SetInput(TInput* theInput); + + virtual + TInput* + GetInput() const; + + virtual + vtkDataSet* + GetOutput(); - bool IsPlanarInput() const; + bool + IsPlanarInput() const; - typedef vtkDataSetMapper TMapper; - virtual TMapper* GetMapper(); + typedef vtkMapper TMapper; - virtual void Init() = 0; - virtual void Update(); + virtual + TMapper* + GetMapper(); - static int CheckAvailableMemory(const float& theSize); - static float GetAvailableMemory(float theSize = 16*1024*1024.0, - float theMinSize = 1024*1024.0); + virtual + void + Init() = 0; + + virtual + void + Update(); + + static + int + CheckAvailableMemory(const vtkFloatingPointType& theSize); + + static + vtkFloatingPointType + GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0, + vtkFloatingPointType theMinSize = 1024*1024.0); // Clipping planes - void RemoveAllClippingPlanes(); - vtkIdType GetNumberOfClippingPlanes() const; - bool AddClippingPlane(vtkPlane* thePlane); - vtkPlane* GetClippingPlane(vtkIdType theID) const; + void + RemoveAllClippingPlanes(); + + vtkIdType + GetNumberOfClippingPlanes() const; - void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane); - void GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane); + bool + AddClippingPlane(vtkPlane* thePlane); - bool IsShrinkable() { return myIsShrinkable; } + vtkPlane* + GetClippingPlane(vtkIdType theID) const; + + void + SetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType theDist, + vtkPlane* thePlane); + + void + GetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType& theDist, + vtkPlane* thePlane); + + bool + IsShrinkable() { return myIsShrinkable; } + + virtual + vtkIdType + GetNodeObjID(vtkIdType theID); + + virtual + vtkIdType + GetNodeVTKID(vtkIdType theID); + + virtual + vtkFloatingPointType* + GetNodeCoord(vtkIdType theObjID); + + virtual + vtkIdType + GetElemObjID(vtkIdType theID); + + virtual + vtkIdType + GetElemVTKID(vtkIdType theID); + + virtual + vtkCell* + GetElemCell(vtkIdType theObjID); + + void + SetIDMapper(const VISU::PIDMapper& theIDMapper); + + const VISU::PIDMapper& + GetIDMapper()const; + + void + SetImplicitFunction(vtkImplicitFunction *theFunction); + + vtkImplicitFunction* + GetImplicitFunction(); + + SALOME_ExtractGeometry* + GetExtractGeometryFilter(); protected: VISU_PipeLine(); VISU_PipeLine(const VISU_PipeLine&); - virtual TInput* GetInput2() const; - virtual void Build() = 0; + virtual + TInput* + GetInput2() const; + + virtual + void + Build() = 0; bool myIsShrinkable; - TInput *myInput; - TMapper *myMapper; + TVTKSmartPtr myInput; + VISU::PIDMapper myIDMapper; + TVTKSmartPtr myMapper; // Clipping planes TVTKSmartPtr myExtractGeometry;