VTK  9.1.0
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=========================================================================*/
49#ifndef vtkLODProp3D_h
50#define vtkLODProp3D_h
51
52#include "vtkProp3D.h"
53#include "vtkRenderingCoreModule.h" // For export macro
54
55class vtkRenderer;
56class vtkMapper;
60class vtkProperty;
63class vtkTexture;
64class vtkLODProp3DCallback;
65
67{
70 int ID;
72 int State;
73 double Level;
74};
76
77class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
78{
79public:
83 static vtkLODProp3D* New();
84
85 vtkTypeMacro(vtkLODProp3D, vtkProp3D);
86 void PrintSelf(ostream& os, vtkIndent indent) override;
87
91 double* GetBounds() VTK_SIZEHINT(6) override;
92 void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds(bounds); }
93
95
104 int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, vtkTexture* t, double time);
105 int AddLOD(vtkMapper* m, vtkProperty* p, vtkTexture* t, double time);
106 int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, double time);
107 int AddLOD(vtkMapper* m, vtkProperty* p, double time);
108 int AddLOD(vtkMapper* m, vtkTexture* t, double time);
109 int AddLOD(vtkMapper* m, double time);
113 int AddLOD(vtkImageMapper3D* m, double time);
115
117
120 vtkGetMacro(NumberOfLODs, int);
122
124
129 vtkGetMacro(CurrentIndex, int);
131
136 void RemoveLOD(int id);
137
139
145 void SetLODProperty(int id, vtkProperty* p);
146 void GetLODProperty(int id, vtkProperty** p);
152
154
160 void SetLODMapper(int id, vtkMapper* m);
161 void GetLODMapper(int id, vtkMapper** m);
167
174
176
183
185
189 void SetLODTexture(int id, vtkTexture* t);
190 void GetLODTexture(int id, vtkTexture** t);
192
194
199 void EnableLOD(int id);
200 void DisableLOD(int id);
201 int IsLODEnabled(int id);
203
205
213 void SetLODLevel(int id, double level);
214 double GetLODLevel(int id);
217
219
227
229
234 vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
235 vtkGetMacro(AutomaticLODSelection, vtkTypeBool);
236 vtkBooleanMacro(AutomaticLODSelection, vtkTypeBool);
238
240
244 vtkSetMacro(SelectedLODID, int);
245 vtkGetMacro(SelectedLODID, int);
247
252
256 int GetPickLODID(void);
257
259
267
269
274 vtkGetMacro(SelectedPickLODID, int);
276
278
283 vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
284 vtkGetMacro(AutomaticPickLODSelection, vtkTypeBool);
285 vtkBooleanMacro(AutomaticPickLODSelection, vtkTypeBool);
287
291 void ShallowCopy(vtkProp* prop) override;
292
294
297 int RenderOpaqueGeometry(vtkViewport* viewport) override;
299 int RenderVolumetricGeometry(vtkViewport* viewport) override;
301
306
313
319 void SetAllocatedRenderTime(double t, vtkViewport* vp) override;
320
328
333 void AddEstimatedRenderTime(double t, vtkViewport* vp) override;
334
335protected:
337 ~vtkLODProp3D() override;
338
340
341 // Assumes that SelectedLODIndex has already been validated:
343
348
350 int ConvertIDToIndex(int id);
352
357 vtkLODProp3DCallback* PickCallback;
358
359private:
360 vtkLODProp3D(const vtkLODProp3D&) = delete;
361 void operator=(const vtkLODProp3D&) = delete;
362};
363
364#endif
abstract class specifies interface to map 3D data
Abstract class for a volume mapper.
abstract class for mapping images to the screen
image display properties
a simple class to control print indentation
Definition: vtkIndent.h:113
level of detail 3D prop
Definition: vtkLODProp3D.h:78
void GetLODMapper(int id, vtkImageMapper3D **m)
Methods to set / get the mapper of an LOD.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
void SetLODMapper(int id, vtkMapper *m)
Methods to set / get the mapper of an LOD.
int GetAutomaticPickPropIndex(void)
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
void RestoreEstimatedRenderTime() override
Used when the render process is aborted to restore the previous estimated render time.
void GetVolumes(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
void SetLODProperty(int id, vtkImageProperty *p)
Methods to set / get the property of an LOD.
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.
vtkTypeBool AutomaticLODSelection
Definition: vtkLODProp3D.h:353
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:344
int IsLODEnabled(int id)
Enable / disable a particular LOD.
double GetLODLevel(int id)
Set the level of a particular LOD.
vtkAbstractMapper3D * GetLODMapper(int id)
Get the LODMapper as an vtkAbstractMapper3D.
int GetLastRenderedLODID()
Get the ID of the previously (during the last render) selected LOD index.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int SelectedPickLODID
Definition: vtkLODProp3D.h:355
int GetNextEntryIndex()
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:357
static vtkLODProp3D * New()
Create an instance of this class.
int AddLOD(vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
double * GetBounds() override
Standard vtkProp method to get 3D bounds of a 3D prop.
void SetLODProperty(int id, vtkProperty *p)
Methods to set / get the property of an LOD.
int SelectedLODIndex
Definition: vtkLODProp3D.h:351
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkLODProp3D.
int RenderVolumetricGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:356
void RemoveLOD(int id)
Delete a level of detail given an ID.
double GetLODIndexEstimatedRenderTime(int index)
Access method that can be used to find out the estimated render time (the thing used to select an LOD...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void GetLODMapper(int id, vtkMapper **m)
Methods to set / get the mapper of an LOD.
double GetLODIndexLevel(int index)
Set the level of a particular LOD.
void GetLODProperty(int id, vtkProperty **p)
Methods to set / get the property of an LOD.
void GetLODTexture(int id, vtkTexture **t)
Methods to set / get the texture of an LOD.
void SetLODLevel(int id, double level)
Set the level of a particular LOD.
double GetLODEstimatedRenderTime(int id)
Access method that can be used to find out the estimated render time (the thing used to select an LOD...
void EnableLOD(int id)
Enable / disable a particular LOD.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
void GetLODBackfaceProperty(int id, vtkProperty **t)
Methods to set / get the backface property of an LOD.
int ConvertIDToIndex(int id)
void SetLODMapper(int id, vtkImageMapper3D *m)
Methods to set / get the mapper of an LOD.
int AddLOD(vtkMapper *m, vtkProperty *p, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void SetLODBackfaceProperty(int id, vtkProperty *t)
Methods to set / get the backface property of an LOD.
int AddLOD(vtkImageMapper3D *m, vtkImageProperty *p, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
int AddLOD(vtkAbstractVolumeMapper *m, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
int AddLOD(vtkMapper *m, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void SetAllocatedRenderTime(double t, vtkViewport *vp) override
Used by the culler / renderer to set the allocated render time for this prop.
void GetLODProperty(int id, vtkImageProperty **p)
Methods to set / get the property of an LOD.
void DisableLOD(int id)
Enable / disable a particular LOD.
int AddLOD(vtkImageMapper3D *m, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void UpdateKeysForSelectedProp()
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...
void SetLODMapper(int id, vtkAbstractVolumeMapper *m)
Methods to set / get the mapper of an LOD.
int AddLOD(vtkMapper *m, vtkProperty *p, vtkProperty *back, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
int GetPickLODID(void)
Get the ID of the appropriate pick LOD index.
int AddLOD(vtkMapper *m, vtkProperty *p, vtkTexture *t, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void GetLODProperty(int id, vtkVolumeProperty **p)
Methods to set / get the property of an LOD.
void SetLODProperty(int id, vtkVolumeProperty *p)
Methods to set / get the property of an LOD.
void SetLODTexture(int id, vtkTexture *t)
Methods to set / get the texture of an LOD.
~vtkLODProp3D() override
void GetLODMapper(int id, vtkAbstractVolumeMapper **m)
Methods to set / get the mapper of an LOD.
void AddEstimatedRenderTime(double t, vtkViewport *vp) override
Override method from vtkProp in order to push this call down to the selected LOD as well.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
int AddLOD(vtkMapper *m, vtkTexture *t, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:171
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:93
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:67
represent surface properties of a geometric object
Definition: vtkProperty.h:171
abstract specification for renderers
Definition: vtkRenderer.h:173
handles properties associated with a texture map
Definition: vtkTexture.h:175
abstract specification for Viewports
Definition: vtkViewport.h:47
represents the common properties for rendering a volume.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
void GetBounds(T a, double bds[6])
@ level
Definition: vtkX3D.h:401
@ time
Definition: vtkX3D.h:503
@ index
Definition: vtkX3D.h:252
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:68
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)