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 =========================================================================*/
30 #ifndef vtkLODProp3D_h
31 #define vtkLODProp3D_h
32 
33 #include "vtkRenderingCoreModule.h" // For export macro
34 #include "vtkProp3D.h"
35 
36 class vtkRenderer;
37 class vtkMapper;
40 class vtkImageMapper3D;
41 class vtkProperty;
42 class vtkVolumeProperty;
43 class vtkImageProperty;
44 class vtkTexture;
45 class vtkLODProp3DCallback;
46 
47 typedef struct
48 {
51  int ID;
52  double EstimatedTime;
53  int State;
54  double Level;
56 
57 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
58 {
59 public:
63  static vtkLODProp3D *New();
64 
65  vtkTypeMacro(vtkLODProp3D, vtkProp3D);
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
71  double *GetBounds() VTK_SIZEHINT(6) override;
72  void GetBounds(double bounds[6])
73  { this->vtkProp3D::GetBounds( bounds ); }
74 
76 
86  vtkTexture *t, double time );
87  int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
88  int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
89  int AddLOD( vtkMapper *m, vtkProperty *p, double time );
90  int AddLOD( vtkMapper *m, vtkTexture *t, double time );
91  int AddLOD( vtkMapper *m, double time );
93  int AddLOD( vtkAbstractVolumeMapper *m, double time );
95  int AddLOD( vtkImageMapper3D *m, double time );
97 
99 
102  vtkGetMacro(NumberOfLODs, int);
104 
106 
111  vtkGetMacro(CurrentIndex, int);
113 
118  void RemoveLOD(int id);
119 
121 
127  void SetLODProperty(int id, vtkProperty *p);
128  void GetLODProperty(int id, vtkProperty **p);
132  void GetLODProperty(int id, vtkImageProperty **p);
134 
136 
142  void SetLODMapper(int id, vtkMapper *m);
143  void GetLODMapper(int id, vtkMapper **m);
146  void SetLODMapper(int id, vtkImageMapper3D *m);
147  void GetLODMapper(int id, vtkImageMapper3D **m);
149 
156 
158 
165 
167 
171  void SetLODTexture(int id, vtkTexture *t);
172  void GetLODTexture(int id, vtkTexture **t);
174 
176 
181  void EnableLOD(int id);
182  void DisableLOD(int id);
183  int IsLODEnabled(int id);
185 
187 
195  void SetLODLevel(int id, double level);
196  double GetLODLevel(int id );
197  double GetLODIndexLevel(int index);
199 
201 
209 
211 
216  vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
217  vtkGetMacro(AutomaticLODSelection, vtkTypeBool);
218  vtkBooleanMacro(AutomaticLODSelection, vtkTypeBool);
220 
222 
226  vtkSetMacro(SelectedLODID, int);
227  vtkGetMacro(SelectedLODID, int);
229 
234 
238  int GetPickLODID(void);
239 
241 
246  void GetActors(vtkPropCollection *) override;
247  void GetVolumes(vtkPropCollection *) override;
249 
251 
255  void SetSelectedPickLODID(int id);
256  vtkGetMacro(SelectedPickLODID, int);
258 
260 
265  vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
266  vtkGetMacro(AutomaticPickLODSelection, vtkTypeBool);
267  vtkBooleanMacro(AutomaticPickLODSelection, vtkTypeBool);
269 
273  void ShallowCopy(vtkProp *prop) override;
274 
276 
279  int RenderOpaqueGeometry(vtkViewport *viewport) override;
283 
288 
295 
301  void SetAllocatedRenderTime( double t, vtkViewport *vp ) override;
302 
309  void RestoreEstimatedRenderTime( ) override;
310 
315  void AddEstimatedRenderTime( double t, vtkViewport *vp ) override;
316 
317 protected:
319  ~vtkLODProp3D() override;
320 
322 
323  // Assumes that SelectedLODIndex has already been validated:
325 
330 
332  int ConvertIDToIndex( int id );
334 
339  vtkLODProp3DCallback *PickCallback;
340 
341 private:
342  vtkLODProp3D(const vtkLODProp3D&) = delete;
343  void operator=(const vtkLODProp3D&) = delete;
344 };
345 
346 #endif
vtkLODProp3DEntry
Definition: vtkLODProp3D.h:48
vtkLODProp3D::SetLODMapper
void SetLODMapper(int id, vtkMapper *m)
Methods to set / get the mapper of an LOD.
vtkLODProp3D::SetLODProperty
void SetLODProperty(int id, vtkVolumeProperty *p)
vtkLODProp3D::AddLOD
int AddLOD(vtkMapper *m, double time)
vtkLODProp3D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkLODProp3D::AddLOD
int AddLOD(vtkMapper *m, vtkTexture *t, double time)
vtkLODProp3D::AddLOD
int AddLOD(vtkMapper *m, vtkProperty *p, vtkProperty *back, vtkTexture *t, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
vtkLODProp3D::GetLODIndexEstimatedRenderTime
double GetLODIndexEstimatedRenderTime(int index)
vtkLODProp3D::GetLODProperty
void GetLODProperty(int id, vtkVolumeProperty **p)
vtkLODProp3D::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkLODProp3D.
vtkLODProp3D::GetLODTexture
void GetLODTexture(int id, vtkTexture **t)
vtkLODProp3DEntry::Prop3DType
int Prop3DType
Definition: vtkLODProp3D.h:50
vtkLODProp3D::NumberOfLODs
int NumberOfLODs
Definition: vtkLODProp3D.h:328
vtkLODProp3D::GetLODMapper
vtkAbstractMapper3D * GetLODMapper(int id)
Get the LODMapper as an vtkAbstractMapper3D.
vtkLODProp3D::GetPickLODID
int GetPickLODID(void)
Get the ID of the appropriate pick LOD index.
vtkLODProp3D::SetLODLevel
void SetLODLevel(int id, double level)
Set the level of a particular LOD.
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:47
vtkLODProp3D::SetSelectedPickLODID
void SetSelectedPickLODID(int id)
Set the id of the LOD that is to be used for picking when automatic LOD pick selection is turned off.
vtkLODProp3D::GetLODEstimatedRenderTime
double GetLODEstimatedRenderTime(int id)
Access method that can be used to find out the estimated render time (the thing used to select an LOD...
vtkLODProp3DEntry::Prop3D
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:49
vtkLODProp3D::CurrentIndex
int CurrentIndex
Definition: vtkLODProp3D.h:329
vtkLODProp3D::AddLOD
int AddLOD(vtkAbstractVolumeMapper *m, double time)
vtkLODProp3D::PickCallback
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:339
vtkLODProp3D::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
vtkLODProp3D::AddLOD
int AddLOD(vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time)
vtkLODProp3D::~vtkLODProp3D
~vtkLODProp3D() override
vtkLODProp3D::GetLODMapper
void GetLODMapper(int id, vtkImageMapper3D **m)
vtkLODProp3D::GetVolumes
void GetVolumes(vtkPropCollection *) override
vtkX3D::time
@ time
Definition: vtkX3D.h:497
vtkLODProp3D::GetLODIndexLevel
double GetLODIndexLevel(int index)
vtkLODProp3D::GetLODLevel
double GetLODLevel(int id)
vtkLODProp3D::SetLODBackfaceProperty
void SetLODBackfaceProperty(int id, vtkProperty *t)
Methods to set / get the backface property of an LOD.
vtkLODProp3D::LODs
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:326
vtkLODProp3D::ConvertIDToIndex
int ConvertIDToIndex(int id)
vtkLODProp3DEntry::EstimatedTime
double EstimatedTime
Definition: vtkLODProp3D.h:52
vtkProp3D::GetBounds
double * GetBounds() override=0
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkLODProp3D::New
static vtkLODProp3D * New()
Create an instance of this class.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkLODProp3DEntry::Level
double Level
Definition: vtkLODProp3D.h:54
vtkLODProp3D::AddEstimatedRenderTime
void AddEstimatedRenderTime(double t, vtkViewport *vp) override
Override method from vtkProp in order to push this call down to the selected LOD as well.
vtkLODProp3D::GetLastRenderedLODID
int GetLastRenderedLODID()
Get the ID of the previously (during the last render) selected LOD index.
vtkLODProp3D::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkLODProp3D::RemoveLOD
void RemoveLOD(int id)
Delete a level of detail given an ID.
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:72
vtkLODProp3D::NumberOfEntries
int NumberOfEntries
Definition: vtkLODProp3D.h:327
vtkLODProp3D::AddLOD
int AddLOD(vtkImageMapper3D *m, vtkImageProperty *p, double time)
vtkLODProp3DEntry::State
int State
Definition: vtkLODProp3D.h:53
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:43
vtkLODProp3D::SetLODProperty
void SetLODProperty(int id, vtkImageProperty *p)
vtkLODProp3D::AddLOD
int AddLOD(vtkMapper *m, vtkProperty *p, double time)
vtkLODProp3D::AutomaticLODSelection
vtkTypeBool AutomaticLODSelection
Definition: vtkLODProp3D.h:335
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:87
vtkLODProp3D::SetLODMapper
void SetLODMapper(int id, vtkAbstractVolumeMapper *m)
vtkLODProp3D::GetLODMapper
void GetLODMapper(int id, vtkMapper **m)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkLODProp3D::GetBounds
double * GetBounds() override
Standard vtkProp method to get 3D bounds of a 3D prop.
vtkLODProp3D::AutomaticPickLODSelection
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:338
vtkLODProp3D::vtkLODProp3D
vtkLODProp3D()
vtkLODProp3D::EnableLOD
void EnableLOD(int id)
Enable / disable a particular LOD.
vtkLODProp3D::RestoreEstimatedRenderTime
void RestoreEstimatedRenderTime() override
Used when the render process is aborted to restore the previous estimated render time.
vtkLODProp3D::GetLODProperty
void GetLODProperty(int id, vtkImageProperty **p)
vtkLODProp3D::GetLODMapper
void GetLODMapper(int id, vtkAbstractVolumeMapper **m)
vtkLODProp3D::SelectedLODIndex
int SelectedLODIndex
Definition: vtkLODProp3D.h:333
vtkLODProp3D::UpdateKeysForSelectedProp
void UpdateKeysForSelectedProp()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkLODProp3D::RenderVolumetricGeometry
int RenderVolumetricGeometry(vtkViewport *ren) override
vtkLODProp3D::SetLODTexture
void SetLODTexture(int id, vtkTexture *t)
Methods to set / get the texture of an LOD.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkImageMapper3D
abstract class for mapping images to the screen
Definition: vtkImageMapper3D.h:51
vtkAbstractMapper3D
abstract class specifies interface to map 3D data
Definition: vtkAbstractMapper3D.h:46
vtkLODProp3D::GetLODProperty
void GetLODProperty(int id, vtkProperty **p)
vtkLODProp3D::GetLODBackfaceProperty
void GetLODBackfaceProperty(int id, vtkProperty **t)
vtkLODProp3DEntry::ID
int ID
Definition: vtkLODProp3D.h:51
vtkLODProp3D::SetLODProperty
void SetLODProperty(int id, vtkProperty *p)
Methods to set / get the property of an LOD.
vtkAbstractVolumeMapper
Abstract class for a volume mapper.
Definition: vtkAbstractVolumeMapper.h:39
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkLODProp3D::AddLOD
int AddLOD(vtkMapper *m, vtkProperty *p, vtkProperty *back, double time)
vtkLODProp3D::SetAllocatedRenderTime
void SetAllocatedRenderTime(double t, vtkViewport *vp) override
Used by the culler / renderer to set the allocated render time for this prop.
vtkLODProp3D::AddLOD
int AddLOD(vtkImageMapper3D *m, double time)
vtkLODProp3D::SelectedLODID
int SelectedLODID
Definition: vtkLODProp3D.h:336
vtkLODProp3D
level of detail 3D prop
Definition: vtkLODProp3D.h:58
vtkLODProp3D::GetAutomaticPickPropIndex
int GetAutomaticPickPropIndex(void)
vtkLODProp3D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:67
vtkLODProp3D::AddLOD
int AddLOD(vtkMapper *m, vtkProperty *p, vtkTexture *t, double time)
vtkLODProp3D::SetLODMapper
void SetLODMapper(int id, vtkImageMapper3D *m)
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:42
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkLODProp3D::GetNextEntryIndex
int GetNextEntryIndex()
vtkLODProp3D::SelectedPickLODID
int SelectedPickLODID
Definition: vtkLODProp3D.h:337
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkLODProp3D::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *ren) override
vtkVolumeProperty
represents the common properties for rendering a volume.
Definition: vtkVolumeProperty.h:69
vtkLODProp3D::DisableLOD
void DisableLOD(int id)
vtkLODProp3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkProp3D.h
vtkLODProp3D::IsLODEnabled
int IsLODEnabled(int id)