1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SVTK OBJECT : interactive object for SVTK visualization
23 // File : SVTK_DeviceActor.h
28 #ifndef SVTK_DEVICE_ACTOR_H
29 #define SVTK_DEVICE_ACTOR_H
32 #include "VTKViewer.h"
36 #include <vtkLODActor.h>
37 #include <vtkProperty.h>
39 class VTKViewer_Transform;
40 class VTKViewer_TransformFilter;
41 class VTKViewer_GeometryFilter;
45 class vtkShrinkFilter;
46 class vtkFeatureEdges;
47 class vtkDataSetMapper;
48 class vtkPassThroughFilter;
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 #pragma warning ( disable:4251 )
66 class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
69 vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
75 //! Apply a view transformation
78 SetTransform(VTKViewer_Transform* theTransform);
80 //! To insert some additional filters and then sets the given #vtkMapper
83 SetMapper(vtkMapper* theMapper);
85 //! Allows to get initial #vtkDataSet
90 //! Allows to set initial #vtkDataSet
93 SetInput(vtkDataSet* theDataSet);
95 /** @name For selection mapping purpose */
99 GetNodeObjId(int theVtkID);
102 vtkFloatingPointType*
103 GetNodeCoord(int theObjID);
107 GetElemObjId(int theVtkID);
111 GetElemCell(int theObjID);
113 //! To provide VTK to Object and backward mapping
116 SetStoreMapping(bool theStoreMapping);
123 /** @name For shrink mamnagement purpose */
130 SetShrinkFactor(vtkFloatingPointType value);
134 SetShrinkable(bool theIsShrinkable);
151 /** @name For feature edges management purpose */
155 IsFeatureEdgesAllowed();
159 SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
163 IsFeatureEdgesEnabled();
167 SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
171 GetFeatureEdgesAngle();
175 SetFeatureEdgesAngle(vtkFloatingPointType theAngle);
179 GetFeatureEdgesFlags(bool& theIsFeatureEdges,
180 bool& theIsBoundaryEdges,
181 bool& theIsManifoldEdges,
182 bool& theIsNonManifoldEdges);
185 SetFeatureEdgesFlags(bool theIsFeatureEdges,
186 bool theIsBoundaryEdges,
187 bool theIsManifoldEdges,
188 bool theIsNonManifoldEdges);
192 GetFeatureEdgesColoring();
196 SetFeatureEdgesColoring(bool theIsColoring);
199 /** @name For representation mamnagement purpose */
202 SetRepresentation(SVTK::Representation::Type theMode);
204 SVTK::Representation::Type
209 GetDefaultPointSize();
213 GetDefaultLineWidth();
219 SetShaded(bool theShaded);
224 Render(vtkRenderer *, vtkMapper *);
226 vtkDataSetMapper* GetDataSetMapper();
229 SVTK::Representation::Type myRepresentation;
230 vtkProperty *myProperty;
233 //! To initialize internal pipeline
235 InitPipeLine(vtkMapper* theMapper);
237 VTKViewer_GeometryFilter *myGeomFilter;
238 VTKViewer_TransformFilter *myTransformFilter;
239 std::vector<vtkPassThroughFilter*> myPassFilter;
240 vtkShrinkFilter* myShrinkFilter;
241 vtkFeatureEdges* myFeatureEdges;
242 vtkDataSetMapper* myMapper;
247 bool myIsFeatureEdgesAllowed;
248 bool myIsFeatureEdgesEnabled;
250 bool myIsResolveCoincidentTopology;
251 vtkFloatingPointType myPolygonOffsetFactor;
252 vtkFloatingPointType myPolygonOffsetUnits;
254 void SetPolygonOffsetParameters(vtkFloatingPointType factor,
255 vtkFloatingPointType units);
256 void GetPolygonOffsetParameters(vtkFloatingPointType& factor,
257 vtkFloatingPointType& units);
263 SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
264 void operator=(const SVTK_DeviceActor&); // Not implemented
269 #pragma warning ( default:4251 )
272 #endif //SVTK_DEVICE_ACTOR_H