1 // Copyright (C) 2007-2013 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;
50 class vtkAlgorithmOutput;
53 #pragma warning ( disable:4251 )
56 class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
59 vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
65 //! Apply a view transformation
68 SetTransform(VTKViewer_Transform* theTransform);
70 //! To insert some additional filters and then sets the given #vtkMapper
73 SetMapper(vtkMapper* theMapper);
75 //! Allows to get initial #vtkDataSet
80 //! Allows to set initial #vtkDataSet
83 SetInputData(vtkDataSet* theDataSet);
85 //! Allows to set initial #vtkAlgorithmOutput
88 SetInputConnection(vtkAlgorithmOutput* theAlgorithmOutput);
90 /** @name For selection mapping purpose */
94 GetNodeObjId(int theVtkID);
98 GetNodeCoord(int theObjID);
102 GetElemObjId(int theVtkID);
106 GetElemCell(int theObjID);
108 //! To provide VTK to Object and backward mapping
111 SetStoreMapping(bool theStoreMapping);
118 /** @name For shrink mamnagement purpose */
125 SetShrinkFactor(double value);
129 SetShrinkable(bool theIsShrinkable);
146 /** @name For feature edges management purpose */
150 IsFeatureEdgesAllowed();
154 SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
158 IsFeatureEdgesEnabled();
162 SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
166 GetFeatureEdgesAngle();
170 SetFeatureEdgesAngle(double theAngle);
174 GetFeatureEdgesFlags(bool& theIsFeatureEdges,
175 bool& theIsBoundaryEdges,
176 bool& theIsManifoldEdges,
177 bool& theIsNonManifoldEdges);
180 SetFeatureEdgesFlags(bool theIsFeatureEdges,
181 bool theIsBoundaryEdges,
182 bool theIsManifoldEdges,
183 bool theIsNonManifoldEdges);
187 GetFeatureEdgesColoring();
191 SetFeatureEdgesColoring(bool theIsColoring);
194 /** @name For representation mamnagement purpose */
197 SetRepresentation(VTKViewer::Representation::Type theMode);
199 VTKViewer::Representation::Type
204 GetDefaultPointSize();
208 GetDefaultLineWidth();
214 SetShaded(bool theShaded);
217 /** @name For ball marker management purpose */
219 SetBallEnabled( bool );
221 /** @name For marker management purpose */
223 SetMarkerEnabled( bool );
226 SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
229 SetMarkerTexture( int, VTK::MarkerTexture );
243 Render(vtkRenderer *, vtkMapper *);
245 VTKViewer_DataSetMapper* GetDataSetMapper();
247 //----------------------------------------------------------------------------
248 //! Setting for displaying quadratic elements
249 virtual void SetQuadraticArcMode(bool theFlag);
250 virtual bool GetQuadraticArcMode();
252 virtual void SetQuadraticArcAngle(double theMaxAngle);
253 virtual double GetQuadraticArcAngle();
257 SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
261 IsCoincident3DAllowed() const;
264 SetResolveCoincidentTopology(bool theIsResolve);
269 VTKViewer::Representation::Type myRepresentation;
270 vtkProperty *myProperty;
273 //! To initialize internal pipeline
275 InitPipeLine(vtkMapper* theMapper);
277 VTKViewer_GeometryFilter *myGeomFilter;
278 VTKViewer_TransformFilter *myTransformFilter;
279 std::vector<vtkPassThroughFilter*> myPassFilter;
280 vtkShrinkFilter* myShrinkFilter;
281 vtkFeatureEdges* myFeatureEdges;
282 VTKViewer_DataSetMapper* myMapper;
287 bool myIsFeatureEdgesAllowed;
288 bool myIsFeatureEdgesEnabled;
290 bool myIsResolveCoincidentTopology;
291 double myPolygonOffsetFactor;
292 double myPolygonOffsetUnits;
294 void SetPolygonOffsetParameters(double factor,
296 void GetPolygonOffsetParameters(double& factor,
303 SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
304 void operator=(const SVTK_DeviceActor&); // Not implemented
309 #pragma warning ( default:4251 )
312 #endif //SVTK_DEVICE_ACTOR_H