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
33 #include "VTKViewer.h"
37 #include <vtkLODActor.h>
38 #include <vtkProperty.h>
40 class VTKViewer_Transform;
41 class VTKViewer_TransformFilter;
42 class VTKViewer_PassThroughFilter;
43 class VTKViewer_GeometryFilter;
47 class vtkShrinkFilter;
48 class vtkDataSetMapper;
52 namespace Representation
55 const Type Points = VTK_POINTS;
56 const Type Wireframe = VTK_WIREFRAME;
57 const Type Surface = VTK_SURFACE;
58 const Type Insideframe = Surface + 1;
63 class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
66 vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
72 //! Apply a view transformation
75 SetTransform(VTKViewer_Transform* theTransform);
77 //! To insert some additional filters and then sets the given #vtkMapper
80 SetMapper(vtkMapper* theMapper);
82 //! Allows to get initial #vtkDataSet
87 //! Allows to set initial #vtkDataSet
90 SetInput(vtkDataSet* theDataSet);
92 /** @name For selection mapping purpose */
96 GetNodeObjId(int theVtkID);
100 GetNodeCoord(int theObjID);
104 GetElemObjId(int theVtkID);
108 GetElemCell(int theObjID);
110 //! To provide VTK to Object and backward mapping
113 SetStoreMapping(bool theStoreMapping);
120 /** @name For shrink mamnagement purpose */
127 SetShrinkFactor(vtkFloatingPointType value);
131 SetShrinkable(bool theIsShrinkable);
148 /** @name For representation mamnagement purpose */
151 SetRepresentation(SVTK::Representation::Type theMode);
153 SVTK::Representation::Type
158 GetDefaultPointSize();
162 GetDefaultLineWidth();
168 SetShaded(bool theShaded);
173 Render(vtkRenderer *, vtkMapper *);
176 SVTK::Representation::Type myRepresentation;
177 vtkProperty *myProperty;
180 //! To initialize internal pipeline
182 InitPipeLine(vtkMapper* theMapper);
184 VTKViewer_GeometryFilter *myGeomFilter;
185 VTKViewer_TransformFilter *myTransformFilter;
186 std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
187 vtkShrinkFilter* myShrinkFilter;
188 vtkDataSetMapper* myMapper;
193 bool myIsResolveCoincidentTopology;
194 vtkFloatingPointType myPolygonOffsetFactor;
195 vtkFloatingPointType myPolygonOffsetUnits;
197 void SetPolygonOffsetParameters(vtkFloatingPointType factor,
198 vtkFloatingPointType units);
199 void GetPolygonOffsetParameters(vtkFloatingPointType& factor,
200 vtkFloatingPointType& units);
206 SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
207 void operator=(const SVTK_DeviceActor&); // Not implemented
212 #endif //SVTK_DEVICE_ACTOR_H