1 // SVTK OBJECT : interactive object for SVTK 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 : SVTK_DeviceActor.h
29 #ifndef SVTK_DEVICE_ACTOR_H
30 #define SVTK_DEVICE_ACTOR_H
34 #include <vtkLODActor.h>
35 #include <vtkProperty.h>
37 class VTKViewer_Transform;
38 class VTKViewer_TransformFilter;
39 class VTKViewer_PassThroughFilter;
40 class VTKViewer_GeometryFilter;
44 class vtkShrinkFilter;
45 class vtkDataSetMapper;
47 //----------------------------------------------------------------------------
50 namespace Representation
53 const Type Points = VTK_POINTS;
54 const Type Wireframe = VTK_WIREFRAME;
55 const Type Surface = VTK_SURFACE;
56 const Type Insideframe = Surface + 1;
61 //----------------------------------------------------------------------------
62 class SVTK_DeviceActor: public vtkLODActor
65 vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
71 //! Apply a view transformation
74 SetTransform(VTKViewer_Transform* theTransform);
76 //! To insert some additional filters and then sets the given #vtkMapper
79 SetMapper(vtkMapper* theMapper);
81 //! Allows to get initial #vtkDataSet
86 //! Allows to set initial #vtkDataSet
89 SetInput(vtkDataSet* theDataSet);
91 /** @name For selection mapping purpose */
95 GetNodeObjId(int theVtkID);
99 GetNodeCoord(int theObjID);
103 GetElemObjId(int theVtkID);
107 GetElemCell(int theObjID);
109 //! To provide VTK to Object and backward mapping
112 SetStoreMapping(bool theStoreMapping);
119 /** @name For shrink mamnagement purpose */
126 SetShrinkFactor(float value);
130 SetShrinkable(bool theIsShrinkable);
147 /** @name For representation mamnagement purpose */
150 SetRepresentation(SVTK::Representation::Type theMode);
152 SVTK::Representation::Type
157 GetDefaultPointSize();
161 GetDefaultLineWidth();
167 SetShaded(bool theShaded);
172 Render(vtkRenderer *, vtkMapper *);
175 SVTK::Representation::Type myRepresentation;
176 vtkProperty *myProperty;
179 //! To initialize internal pipeline
181 InitPipeLine(vtkMapper* theMapper);
183 VTKViewer_GeometryFilter *myGeomFilter;
184 VTKViewer_TransformFilter *myTransformFilter;
185 std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
186 vtkShrinkFilter* myShrinkFilter;
187 vtkDataSetMapper* myMapper;
192 bool myIsResolveCoincidentTopology;
193 float myPolygonOffsetFactor;
194 float myPolygonOffsetUnits;
196 void SetPolygonOffsetParameters(float factor, float units);
197 void GetPolygonOffsetParameters(float& factor, float& units);
203 SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
204 void operator=(const SVTK_DeviceActor&); // Not implemented
209 #endif //SVTK_DEVICE_ACTOR_H