VTK
vtkQuadricLODActor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadricLODActor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
50 #ifndef vtkQuadricLODActor_h
51 #define vtkQuadricLODActor_h
52 
53 #include "vtkRenderingLODModule.h" // For export macro
54 #include "vtkActor.h"
55 
57 class vtkPolyDataMapper;
58 class vtkCamera;
59 class vtkPolyData;
60 
61 class VTKRENDERINGLOD_EXPORT vtkQuadricLODActor : public vtkActor
62 {
63 public:
67  static vtkQuadricLODActor *New();
68 
70 
73  vtkTypeMacro(vtkQuadricLODActor, vtkActor);
74  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
76 
78 
83  vtkSetMacro(DeferLODConstruction, int);
84  vtkGetMacro(DeferLODConstruction, int);
85  vtkBooleanMacro(DeferLODConstruction, int);
87 
89 
96  vtkSetMacro(Static, int);
97  vtkGetMacro(Static, int);
98  vtkBooleanMacro(Static, int);
100 
102  {
103  UNKNOWN = 0,
104  XLINE, YLINE, ZLINE,
105  XYPLANE, XZPLANE, YZPLANE,
106  XYZVOLUME
107  };
108 
110 
123  vtkSetClampMacro(DataConfiguration, int, UNKNOWN,XYZVOLUME);
124  vtkGetMacro(DataConfiguration, int);
126  { this->SetDataConfiguration(UNKNOWN); }
128  { this->SetDataConfiguration(XLINE); }
130  { this->SetDataConfiguration(YLINE); }
132  { this->SetDataConfiguration(ZLINE); }
134  { this->SetDataConfiguration(XYPLANE); }
136  { this->SetDataConfiguration(YZPLANE); }
138  { this->SetDataConfiguration(XZPLANE); }
140  { this->SetDataConfiguration(XYZVOLUME); }
142 
144 
151  vtkSetClampMacro(CollapseDimensionRatio, double, 0.0, 1.0);
152  vtkGetMacro(CollapseDimensionRatio, double);
154 
156 
161  void SetLODFilter(vtkQuadricClustering *lodFilter);
162  vtkGetObjectMacro(LODFilter, vtkQuadricClustering);
164 
166 
174  vtkSetClampMacro(MaximumDisplayListSize, int, 1000, VTK_INT_MAX);
175  vtkGetMacro(MaximumDisplayListSize, int);
177 
179  {
180  FOLLOWER = 0,
181  ACTOR
182  };
183 
185 
189  vtkSetClampMacro(PropType, int, FOLLOWER, ACTOR);
190  vtkGetMacro(PropType, int);
192  { this->SetPropType(FOLLOWER); }
194  { this->SetPropType(ACTOR); }
196 
198 
202  void SetCamera(vtkCamera*);
203  vtkGetObjectMacro(Camera, vtkCamera);
205 
211  void Render(vtkRenderer *, vtkMapper *) VTK_OVERRIDE;
212 
217  int RenderOpaqueGeometry(vtkViewport *viewport) VTK_OVERRIDE;
218 
224  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
225 
229  void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
230 
231 protected:
233  ~vtkQuadricLODActor() VTK_OVERRIDE;
234 
235  // Renders the LOD
236  vtkActor *LODActor;
237  vtkPolyDataMapper *LODMapper;
238 
239  // Keep track of the requested interactive frame rate
240  double CachedInteractiveFrameRate;
241 
242  // Support various strategies
244 
245  // Specify whether the mapper's should be set in to Static mode.
246  int Static;
247 
248  // The dimension of the data
249  double CollapseDimensionRatio;
250  int DataConfiguration;
251 
252  // Control whether this is a follower or regular actor
253  int PropType;
254  vtkCamera *Camera;
255 
256  // Control what size (in terms of number of graphics primitives)
257  // where display lists should be used.
258  int MaximumDisplayListSize;
259 
260  // Specify to defer construction of the LOD.
261  int DeferLODConstruction;
262 
263  // Keep track of building
265 
266  // Helper function determines display list size
267  vtkIdType GetDisplayListSize(vtkPolyData *pd);
268 
269 private:
270  vtkQuadricLODActor(const vtkQuadricLODActor&) VTK_DELETE_FUNCTION;
271  void operator=(const vtkQuadricLODActor&) VTK_DELETE_FUNCTION;
272 };
273 
274 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
vtkTimeStamp BuildTime
virtual void Render(vtkRenderer *, vtkMapper *)
This causes the actor to be rendered.
Definition: vtkActor.h:84
void SetDataConfigurationToYZPlane()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
abstract specification for Viewports
Definition: vtkViewport.h:44
#define VTK_INT_MAX
Definition: vtkType.h:157
record modification and/or execution time
Definition: vtkTimeStamp.h:32
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for renderers
Definition: vtkRenderer.h:57
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
static vtkActor * New()
Creates an actor with the following defaults: origin(0,0,0) position=(0,0,0) scale=(1,1,1) visibility=1 pickable=1 dragable=1 orientation=(0,0,0).
void SetPropTypeToFollower()
Indicate that this actor is actually a follower.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
void SetDataConfigurationToXYZVolume()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
void SetDataConfigurationToXYPlane()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
a simple class to control print indentation
Definition: vtkIndent.h:33
a virtual camera for 3D rendering
Definition: vtkCamera.h:44
void SetPropTypeToActor()
Indicate that this actor is actually a follower.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:85
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
map vtkPolyData to graphics primitives
void SetDataConfigurationToXLine()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
void SetDataConfigurationToYLine()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
void SetDataConfigurationToZLine()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
void SetDataConfigurationToXZPlane()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetDataConfigurationToUnknown()
Force the binning of the quadric clustering according to application knowledge relative to the dimens...
a specific level-of-detail strategy using the quadric clustering decimation algorithm ...
reduce the number of triangles in a mesh