Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SVTK_DeviceActor.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // SVTK OBJECT : interactive object for SVTK visualization
24 // File : SVTK_DeviceActor.h
25 // Author :
26 
27 #ifndef SVTK_DEVICE_ACTOR_H
28 #define SVTK_DEVICE_ACTOR_H
29 
30 #include "SVTK.h"
31 #include "VTKViewer.h"
32 #include "VTKViewer_Actor.h"
33 #include "VTKViewer_MarkerDef.h"
34 
35 #include <vector>
36 
37 #include <vtkLODActor.h>
38 #include <vtkProperty.h>
39 
43 
44 class vtkCell;
45 class vtkDataSet;
46 class vtkShrinkFilter;
47 class vtkFeatureEdges;
49 class vtkPassThroughFilter;
50 class vtkAlgorithmOutput;
51 
52 #ifdef WIN32
53 #pragma warning ( disable:4251 )
54 #endif
55 
57 {
58  public:
59  vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
60 
61  static
63  New();
64 
66  virtual
67  void
68  SetTransform(VTKViewer_Transform* theTransform);
69 
71  virtual
72  void
73  SetMapper(vtkMapper* theMapper);
74 
76  virtual
77  vtkDataSet*
78  GetInput();
79 
81  virtual
82  void
83  SetInputData(vtkDataSet* theDataSet);
84 
86  virtual
87  void
88  SetInputConnection(vtkAlgorithmOutput* theAlgorithmOutput);
89 
92  virtual
93  int
94  GetNodeObjId(int theVtkID);
95 
96  virtual
97  double*
98  GetNodeCoord(int theObjID);
99 
100  virtual
101  int
102  GetElemObjId(int theVtkID);
103 
104  virtual
105  vtkCell*
106  GetElemCell(int theObjID);
107 
109  virtual
110  void
111  SetStoreMapping(bool theStoreMapping);
113 
114  virtual
116  GetMTime();
117 
120  double
121  GetShrinkFactor();
122 
123  virtual
124  void
125  SetShrinkFactor(double value);
126 
127  virtual
128  void
129  SetShrinkable(bool theIsShrinkable);
130 
131  bool
132  IsShrunkable();
133 
134  bool
135  IsShrunk();
136 
137  virtual
138  void
139  SetShrink();
140 
141  virtual
142  void
143  UnShrink();
145 
148  virtual
149  bool
150  IsFeatureEdgesAllowed();
151 
152  virtual
153  void
154  SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
155 
156  virtual
157  bool
158  IsFeatureEdgesEnabled();
159 
160  virtual
161  void
162  SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
163 
164  virtual
165  double
166  GetFeatureEdgesAngle();
167 
168  virtual
169  void
170  SetFeatureEdgesAngle(double theAngle);
171 
172  virtual
173  void
174  GetFeatureEdgesFlags(bool& theIsFeatureEdges,
175  bool& theIsBoundaryEdges,
176  bool& theIsManifoldEdges,
177  bool& theIsNonManifoldEdges);
178  virtual
179  void
180  SetFeatureEdgesFlags(bool theIsFeatureEdges,
181  bool theIsBoundaryEdges,
182  bool theIsManifoldEdges,
183  bool theIsNonManifoldEdges);
184 
185  virtual
186  bool
187  GetFeatureEdgesColoring();
188 
189  virtual
190  void
191  SetFeatureEdgesColoring(bool theIsColoring);
193 
195  virtual
196  void
197  SetRepresentation(VTKViewer::Representation::Type theMode);
198 
200  GetRepresentation();
201 
202  virtual
203  double
204  GetDefaultPointSize();
205 
206  virtual
207  double
208  GetDefaultLineWidth();
209 
210  bool
211  IsShaded();
212 
213  void
214  SetShaded(bool theShaded);
216 
218  void
219  SetBallEnabled( bool );
220 
222  void
223  SetMarkerEnabled( bool );
224 
225  void
226  SetBallScale( double );
227 
228  void
229  SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
230 
231  void
232  SetMarkerTexture( int, VTK::MarkerTexture );
233 
235  GetMarkerType();
236 
238  GetMarkerScale();
239 
240  int
241  GetMarkerTexture();
243 
244  virtual
245  void
246  Render(vtkRenderer *, vtkMapper *);
247 
248  VTKViewer_DataSetMapper* GetDataSetMapper();
249 
250  //----------------------------------------------------------------------------
252  virtual void SetQuadraticArcMode(bool theFlag);
253  virtual bool GetQuadraticArcMode();
254 
255  virtual void SetQuadraticArcAngle(double theMaxAngle);
256  virtual double GetQuadraticArcAngle();
257 
258  virtual
259  void
260  SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
261 
262  virtual
263  bool
264  IsCoincident3DAllowed() const;
265 
266  void
267  SetResolveCoincidentTopology(bool theIsResolve);
268 
269 
270 
271  protected:
273  vtkProperty *myProperty;
275 
277  void
278  InitPipeLine(vtkMapper* theMapper);
279 
282  std::vector<vtkPassThroughFilter*> myPassFilter;
284  vtkFeatureEdges* myFeatureEdges;
286 
289 
292 
296 
297  void SetPolygonOffsetParameters(double factor,
298  double units);
299  void GetPolygonOffsetParameters(double& factor,
300  double& units);
301 
303  ~SVTK_DeviceActor();
304 
305  private:
306  SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
307  void operator=(const SVTK_DeviceActor&); // Not implemented
308 
309 };
310 
311 #ifdef WIN32
312 #pragma warning ( default:4251 )
313 #endif
314 
315 #endif //SVTK_DEVICE_ACTOR_H