1 // Copyright (C) 2007-2012 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
23 // SVTK OBJECT : interactive object for SVTK visualization
24 // File : SVTK_DeviceActor.h
27 #ifndef SVTK_DEVICE_ACTOR_H
28 #define SVTK_DEVICE_ACTOR_H
31 #include "VTKViewer.h"
32 #include "VTKViewer_Actor.h"
33 #include "VTKViewer_MarkerDef.h"
37 #include <vtkLODActor.h>
38 #include <vtkProperty.h>
40 class VTKViewer_Transform;
41 class VTKViewer_TransformFilter;
42 class VTKViewer_GeometryFilter;
46 class vtkShrinkFilter;
47 class vtkFeatureEdges;
48 class VTKViewer_DataSetMapper;
49 class vtkPassThroughFilter;
52 #pragma warning ( disable:4251 )
55 class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
58 vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
64 //! Apply a view transformation
67 SetTransform(VTKViewer_Transform* theTransform);
69 //! To insert some additional filters and then sets the given #vtkMapper
72 SetMapper(vtkMapper* theMapper);
74 //! Allows to get initial #vtkDataSet
79 //! Allows to set initial #vtkDataSet
82 SetInput(vtkDataSet* theDataSet);
84 /** @name For selection mapping purpose */
88 GetNodeObjId(int theVtkID);
92 GetNodeCoord(int theObjID);
96 GetElemObjId(int theVtkID);
100 GetElemCell(int theObjID);
102 //! To provide VTK to Object and backward mapping
105 SetStoreMapping(bool theStoreMapping);
112 /** @name For shrink mamnagement purpose */
119 SetShrinkFactor(vtkFloatingPointType value);
123 SetShrinkable(bool theIsShrinkable);
140 /** @name For feature edges management purpose */
144 IsFeatureEdgesAllowed();
148 SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
152 IsFeatureEdgesEnabled();
156 SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
160 GetFeatureEdgesAngle();
164 SetFeatureEdgesAngle(vtkFloatingPointType theAngle);
168 GetFeatureEdgesFlags(bool& theIsFeatureEdges,
169 bool& theIsBoundaryEdges,
170 bool& theIsManifoldEdges,
171 bool& theIsNonManifoldEdges);
174 SetFeatureEdgesFlags(bool theIsFeatureEdges,
175 bool theIsBoundaryEdges,
176 bool theIsManifoldEdges,
177 bool theIsNonManifoldEdges);
181 GetFeatureEdgesColoring();
185 SetFeatureEdgesColoring(bool theIsColoring);
188 /** @name For representation mamnagement purpose */
191 SetRepresentation(VTKViewer::Representation::Type theMode);
193 VTKViewer::Representation::Type
198 GetDefaultPointSize();
202 GetDefaultLineWidth();
208 SetShaded(bool theShaded);
211 /** @name For marker management purpose */
213 SetMarkerEnabled( bool );
216 SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
219 SetMarkerTexture( int, VTK::MarkerTexture );
233 Render(vtkRenderer *, vtkMapper *);
235 VTKViewer_DataSetMapper* GetDataSetMapper();
237 //----------------------------------------------------------------------------
238 //! Setting for displaying quadratic elements
239 virtual void SetQuadraticArcMode(bool theFlag);
240 virtual bool GetQuadraticArcMode();
242 virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
243 virtual vtkFloatingPointType GetQuadraticArcAngle();
247 SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
251 IsCoincident3DAllowed() const;
255 VTKViewer::Representation::Type myRepresentation;
256 vtkProperty *myProperty;
259 //! To initialize internal pipeline
261 InitPipeLine(vtkMapper* theMapper);
263 VTKViewer_GeometryFilter *myGeomFilter;
264 VTKViewer_TransformFilter *myTransformFilter;
265 std::vector<vtkPassThroughFilter*> myPassFilter;
266 vtkShrinkFilter* myShrinkFilter;
267 vtkFeatureEdges* myFeatureEdges;
268 VTKViewer_DataSetMapper* myMapper;
273 bool myIsFeatureEdgesAllowed;
274 bool myIsFeatureEdgesEnabled;
276 bool myIsResolveCoincidentTopology;
277 vtkFloatingPointType myPolygonOffsetFactor;
278 vtkFloatingPointType myPolygonOffsetUnits;
280 void SetPolygonOffsetParameters(vtkFloatingPointType factor,
281 vtkFloatingPointType units);
282 void GetPolygonOffsetParameters(vtkFloatingPointType& factor,
283 vtkFloatingPointType& units);
289 SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
290 void operator=(const SVTK_DeviceActor&); // Not implemented
295 #pragma warning ( default:4251 )
298 #endif //SVTK_DEVICE_ACTOR_H