VTK
vtkLODProp3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLODProp3D.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 =========================================================================*/
36 #ifndef vtkLODProp3D_h
37 #define vtkLODProp3D_h
38 
39 #include "vtkRenderingCoreModule.h" // For export macro
40 #include "vtkProp3D.h"
41 
42 class vtkRenderer;
43 class vtkMapper;
46 class vtkImageMapper3D;
47 class vtkProperty;
48 class vtkVolumeProperty;
49 class vtkImageProperty;
50 class vtkTexture;
51 class vtkLODProp3DCallback;
52 
53 typedef struct
54 {
57  int ID;
58  double EstimatedTime;
59  int State;
60  double Level;
62 
63 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
64 {
65 public:
69  static vtkLODProp3D *New();
70 
71  vtkTypeMacro(vtkLODProp3D, vtkProp3D);
72  void PrintSelf(ostream& os, vtkIndent indent);
73 
77  double *GetBounds();
78  void GetBounds(double bounds[6])
79  { this->vtkProp3D::GetBounds( bounds ); }
80 
82 
91  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back,
92  vtkTexture *t, double time );
93  int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
94  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
95  int AddLOD( vtkMapper *m, vtkProperty *p, double time );
96  int AddLOD( vtkMapper *m, vtkTexture *t, double time );
97  int AddLOD( vtkMapper *m, double time );
98  int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
99  int AddLOD( vtkAbstractVolumeMapper *m, double time );
100  int AddLOD( vtkImageMapper3D *m, vtkImageProperty *p, double time );
101  int AddLOD( vtkImageMapper3D *m, double time );
103 
105 
108  vtkGetMacro(NumberOfLODs, int);
110 
112 
117  vtkGetMacro(CurrentIndex, int);
119 
124  void RemoveLOD(int id);
125 
127 
133  void SetLODProperty(int id, vtkProperty *p);
134  void GetLODProperty(int id, vtkProperty **p);
135  void SetLODProperty(int id, vtkVolumeProperty *p);
136  void GetLODProperty(int id, vtkVolumeProperty **p);
137  void SetLODProperty(int id, vtkImageProperty *p);
138  void GetLODProperty(int id, vtkImageProperty **p);
140 
142 
148  void SetLODMapper(int id, vtkMapper *m);
149  void GetLODMapper(int id, vtkMapper **m);
150  void SetLODMapper(int id, vtkAbstractVolumeMapper *m);
151  void GetLODMapper(int id, vtkAbstractVolumeMapper **m);
152  void SetLODMapper(int id, vtkImageMapper3D *m);
153  void GetLODMapper(int id, vtkImageMapper3D **m);
155 
161  vtkAbstractMapper3D *GetLODMapper(int id);
162 
164 
168  void SetLODBackfaceProperty(int id, vtkProperty *t);
169  void GetLODBackfaceProperty(int id, vtkProperty **t);
171 
173 
177  void SetLODTexture(int id, vtkTexture *t);
178  void GetLODTexture(int id, vtkTexture **t);
180 
182 
187  void EnableLOD(int id);
188  void DisableLOD(int id);
189  int IsLODEnabled(int id);
191 
193 
201  void SetLODLevel(int id, double level);
202  double GetLODLevel(int id );
203  double GetLODIndexLevel(int index);
205 
207 
212  double GetLODEstimatedRenderTime(int id);
213  double GetLODIndexEstimatedRenderTime(int index);
215 
217 
222  vtkSetClampMacro(AutomaticLODSelection, int, 0, 1);
223  vtkGetMacro(AutomaticLODSelection, int);
224  vtkBooleanMacro(AutomaticLODSelection, int);
226 
228 
232  vtkSetMacro(SelectedLODID, int);
233  vtkGetMacro(SelectedLODID, int);
235 
239  int GetLastRenderedLODID();
240 
244  int GetPickLODID(void);
245 
247 
252  virtual void GetActors(vtkPropCollection *);
253  virtual void GetVolumes(vtkPropCollection *);
255 
257 
261  void SetSelectedPickLODID(int id);
262  vtkGetMacro(SelectedPickLODID, int);
264 
266 
271  vtkSetClampMacro(AutomaticPickLODSelection, int, 0, 1);
272  vtkGetMacro(AutomaticPickLODSelection, int);
273  vtkBooleanMacro(AutomaticPickLODSelection, int);
275 
279  void ShallowCopy(vtkProp *prop);
280 
282 
285  int RenderOpaqueGeometry(vtkViewport *viewport);
287  virtual int RenderVolumetricGeometry( vtkViewport *ren);
289 
293  virtual int HasTranslucentPolygonalGeometry();
294 
301 
307  void SetAllocatedRenderTime( double t, vtkViewport *vp );
308 
316 
321  virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
322 
323 protected:
324  vtkLODProp3D();
325  ~vtkLODProp3D();
326 
327  int GetAutomaticPickPropIndex(void);
328 
333 
334  int GetNextEntryIndex();
335  int ConvertIDToIndex( int id );
337 
342  vtkLODProp3DCallback *PickCallback;
343 
344 private:
345  vtkLODProp3D(const vtkLODProp3D&) VTK_DELETE_FUNCTION;
346  void operator=(const vtkLODProp3D&) VTK_DELETE_FUNCTION;
347 };
348 
349 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
int AutomaticPickLODSelection
Definition: vtkLODProp3D.h:341
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:55
abstract specification for Viewports
Definition: vtkViewport.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:329
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:222
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:294
void GetBounds(double bounds[6])
Definition: vtkLODProp3D.h:78
virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:371
image display properties
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:63
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
int AutomaticLODSelection
Definition: vtkLODProp3D.h:338
virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:357
int SelectedPickLODID
Definition: vtkLODProp3D.h:340
a list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:303
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:342
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:226
void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp3D.
int SelectedLODIndex
Definition: vtkLODProp3D.h:336
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract class for mapping images to the screen
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:63
handles properties associated with a texture map
Definition: vtkTexture.h:70
abstract class specifies interface to map 3D data
represents the common properties for rendering a volume.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:91
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
level of detail 3D prop
Definition: vtkLODProp3D.h:63
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:340
virtual double * GetBounds()=0
Return a reference to the Prop3D's composite transform.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
Definition: vtkProp.h:61