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(double 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(double 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(double theMaxAngle);
243 virtual double GetQuadraticArcAngle();
247 SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
251 IsCoincident3DAllowed() const;
254 SetResolveCoincidentTopology(bool theIsResolve);
259 VTKViewer::Representation::Type myRepresentation;
260 vtkProperty *myProperty;
263 //! To initialize internal pipeline
265 InitPipeLine(vtkMapper* theMapper);
267 VTKViewer_GeometryFilter *myGeomFilter;
268 VTKViewer_TransformFilter *myTransformFilter;
269 std::vector<vtkPassThroughFilter*> myPassFilter;
270 vtkShrinkFilter* myShrinkFilter;
271 vtkFeatureEdges* myFeatureEdges;
272 VTKViewer_DataSetMapper* myMapper;
277 bool myIsFeatureEdgesAllowed;
278 bool myIsFeatureEdgesEnabled;
280 bool myIsResolveCoincidentTopology;
281 double myPolygonOffsetFactor;
282 double myPolygonOffsetUnits;
284 void SetPolygonOffsetParameters(double factor,
286 void GetPolygonOffsetParameters(double& factor,
293 SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
294 void operator=(const SVTK_DeviceActor&); // Not implemented
299 #pragma warning ( default:4251 )
302 #endif //SVTK_DEVICE_ACTOR_H