Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/visu.git] / src / PIPELINE / VISU_PipeLine.hxx
index 4dd6db6ea26d3770e796b46295a50c63775051a8..76d3d2bc33a97fd481911ca654308fe793ebede5 100644 (file)
 #ifndef VISU_PipeLine_HeaderFile
 #define VISU_PipeLine_HeaderFile
 
+#include <vector>
 #include <vtkObject.h>
 #include <vtkSmartPointer.h>
 
-#include <vector>
+#include "VISU_IDMapper.hxx"
+
+class vtkCell;
+class vtkDataSet;
+class vtkImplicitFunction;
 
 template <class T>
 class TVTKSmartPtr: public vtkSmartPointer<T>
 {
 public:
-  TVTKSmartPtr() {}
-  TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer<T>(r) {
+  TVTKSmartPtr()
+  {}
+
+  TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer<T>(r) 
+  {
     if(r && theIsOwner)
       r->Delete();
   }
-  TVTKSmartPtr& operator()(T* r, bool theIsOwner = false){
+
+  TVTKSmartPtr& operator()(T* r, bool theIsOwner = false)
+  {
     vtkSmartPointer<T>::operator=(r);
     if(r && theIsOwner)
       r->Delete();
     return *this;
   }
-  TVTKSmartPtr& operator=(T* r){
+
+  TVTKSmartPtr& operator=(T* r)
+  {
     vtkSmartPointer<T>::operator=(r);
     return *this;
   }
-  operator T* () const {
+
+  operator T* () const 
+  {
     return vtkSmartPointer<T>::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<TInput> myInput;
+  VISU::PIDMapper myIDMapper;
+  TVTKSmartPtr<vtkDataSetMapper> myMapper;
 
   // Clipping planes
   TVTKSmartPtr<SALOME_ExtractGeometry> myExtractGeometry;