1 // SMESH OBJECT : interactive object for SMESH visualization
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_Actor.h
25 // Author : Nicolas REJNERI
29 #ifndef SMESH_DEVICE_ACTOR_H
30 #define SMESH_DEVICE_ACTOR_H
32 #include "SALOME_GeometryFilter.h"
33 #include "SMESH_Object.h"
35 #include <vtkLODActor.h>
39 class vtkShrinkFilter;
40 class vtkPolyDataMapper;
41 class vtkUnstructuredGrid;
43 class SALOME_Transform;
44 class SALOME_TransformFilter;
45 class SALOME_PassThroughFilter;
46 class SALOME_ExtractUnstructuredGrid;
49 class SMESH_DeviceActor: public vtkLODActor{
50 friend class SMESH_Actor;
53 vtkTypeMacro(SMESH_DeviceActor,vtkLODActor);
54 static SMESH_DeviceActor* New();
56 void SetStoreMapping(int theStoreMapping);
57 int GetStoreMapping(){ return myStoreMapping;}
59 typedef SALOME_GeometryFilter::TVectorId TVectorId;
60 int GetObjId(int theVtkID);
61 TVectorId GetVtkId(int theObjID);
63 int GetNodeObjId(int theVtkID);
64 TVectorId GetNodeVtkId(int theObjID);
66 int GetElemObjId(int theVtkID);
67 TVectorId GetElemVtkId(int theObjID);
69 vtkPolyData* GetPolyDataInput();
71 virtual void SetTransform(SALOME_Transform* theTransform);
72 virtual unsigned long int GetMTime();
74 float GetShrinkFactor();
75 void SetShrinkFactor(float value);
77 bool IsShrunkable() { return myIsShrinkable;}
78 bool IsShrunk() { return myIsShrunk;}
82 enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe};
83 EReperesent GetRepresentation(){ return myRepresentation;}
84 void SetRepresentation(EReperesent theMode);
86 virtual void SetVisibility(int theMode);
87 virtual int GetVisibility();
89 SALOME_ExtractUnstructuredGrid* GetExtractUnstructuredGrid();
90 vtkUnstructuredGrid* GetUnstructuredGrid();
91 vtkMergeFilter* GetMergeFilter();
93 virtual void Render(vtkRenderer *, vtkMapper *);
96 void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
98 vtkPolyDataMapper *myMapper;
99 TVisualObjPtr myVisualObj;
101 vtkProperty *myProperty;
102 EReperesent myRepresentation;
104 vtkMergeFilter* myMergeFilter;
105 SALOME_ExtractUnstructuredGrid* myExtractUnstructuredGrid;
108 SALOME_GeometryFilter *myGeomFilter;
109 SALOME_TransformFilter *myTransformFilter;
110 std::vector<SALOME_PassThroughFilter*> myPassFilter;
112 vtkShrinkFilter* myShrinkFilter;
116 float myPolygonOffsetFactor;
117 float myPolygonOffsetUnits;
119 void SetPolygonOffsetParameters(float factor, float units);
120 void GetPolygonOffsetParameters(float& factor, float& units){
121 factor = myPolygonOffsetFactor;
122 units = myPolygonOffsetUnits;
126 ~SMESH_DeviceActor();
127 SMESH_DeviceActor(const SMESH_DeviceActor&) {};
128 void operator=(const SMESH_DeviceActor&) {};
133 #endif //SMESH_ACTOR_H