VTK  9.0.3
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 =========================================================================*/
33 #ifndef vtkLODProp3D_h
34 #define vtkLODProp3D_h
35 
36 #include "vtkProp3D.h"
37 #include "vtkRenderingCoreModule.h" // For export macro
38 
39 class vtkRenderer;
40 class vtkMapper;
43 class vtkImageMapper3D;
44 class vtkProperty;
45 class vtkVolumeProperty;
46 class vtkImageProperty;
47 class vtkTexture;
48 class vtkLODProp3DCallback;
49 
50 typedef struct
51 {
54  int ID;
55  double EstimatedTime;
56  int State;
57  double Level;
59 
60 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
61 {
62 public:
66  static vtkLODProp3D* New();
67 
68  vtkTypeMacro(vtkLODProp3D, vtkProp3D);
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
74  double* GetBounds() VTK_SIZEHINT(6) override;
75  void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds(bounds); }
76 
78 
87  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, vtkTexture* t, double time);
88  int AddLOD(vtkMapper* m, vtkProperty* p, vtkTexture* t, double time);
89  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, double time);
90  int AddLOD(vtkMapper* m, vtkProperty* p, double time);
91  int AddLOD(vtkMapper* m, vtkTexture* t, double time);
92  int AddLOD(vtkMapper* m, double time);
96  int AddLOD(vtkImageMapper3D* m, double time);
98 
100 
103  vtkGetMacro(NumberOfLODs, int);
105 
107 
112  vtkGetMacro(CurrentIndex, int);
114 
119  void RemoveLOD(int id);
120 
122 
128  void SetLODProperty(int id, vtkProperty* p);
129  void GetLODProperty(int id, vtkProperty** p);
133  void GetLODProperty(int id, vtkImageProperty** p);
135 
137 
143  void SetLODMapper(int id, vtkMapper* m);
144  void GetLODMapper(int id, vtkMapper** m);
147  void SetLODMapper(int id, vtkImageMapper3D* m);
148  void GetLODMapper(int id, vtkImageMapper3D** m);
150 
157 
159 
166 
168 
172  void SetLODTexture(int id, vtkTexture* t);
173  void GetLODTexture(int id, vtkTexture** t);
175 
177 
182  void EnableLOD(int id);
183  void DisableLOD(int id);
184  int IsLODEnabled(int id);
186 
188 
196  void SetLODLevel(int id, double level);
197  double GetLODLevel(int id);
198  double GetLODIndexLevel(int index);
200 
202 
210 
212 
217  vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
218  vtkGetMacro(AutomaticLODSelection, vtkTypeBool);
219  vtkBooleanMacro(AutomaticLODSelection, vtkTypeBool);
221 
223 
227  vtkSetMacro(SelectedLODID, int);
228  vtkGetMacro(SelectedLODID, int);
230 
235 
239  int GetPickLODID(void);
240 
242 
247  void GetActors(vtkPropCollection*) override;
248  void GetVolumes(vtkPropCollection*) override;
250 
252 
256  void SetSelectedPickLODID(int id);
257  vtkGetMacro(SelectedPickLODID, int);
259 
261 
266  vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
267  vtkGetMacro(AutomaticPickLODSelection, vtkTypeBool);
268  vtkBooleanMacro(AutomaticPickLODSelection, vtkTypeBool);
270 
274  void ShallowCopy(vtkProp* prop) override;
275 
277 
280  int RenderOpaqueGeometry(vtkViewport* viewport) override;
284 
289 
296 
302  void SetAllocatedRenderTime(double t, vtkViewport* vp) override;
303 
310  void RestoreEstimatedRenderTime() override;
311 
316  void AddEstimatedRenderTime(double t, vtkViewport* vp) override;
317 
318 protected:
320  ~vtkLODProp3D() override;
321 
323 
324  // Assumes that SelectedLODIndex has already been validated:
326 
331 
333  int ConvertIDToIndex(int id);
335 
340  vtkLODProp3DCallback* PickCallback;
341 
342 private:
343  vtkLODProp3D(const vtkLODProp3D&) = delete;
344  void operator=(const vtkLODProp3D&) = delete;
345 };
346 
347 #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:34
level of detail 3D prop
Definition: vtkLODProp3D.h:61
void GetLODMapper(int id, vtkImageMapper3D **m)
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.
double * GetBounds() override
Standard vtkProp method to get 3D bounds of a 3D prop.
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
void SetLODProperty(int id, vtkImageProperty *p)
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:336
static vtkLODProp3D * New()
Create an instance of this class.
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:327
int IsLODEnabled(int id)
double GetLODLevel(int id)
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:338
int GetNextEntryIndex()
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:340
int AddLOD(vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time)
void SetLODProperty(int id, vtkProperty *p)
Methods to set / get the property of an LOD.
int SelectedLODIndex
Definition: vtkLODProp3D.h:334
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkLODProp3D.
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:339
void RemoveLOD(int id)
Delete a level of detail given an ID.
double GetLODIndexEstimatedRenderTime(int index)
int RenderVolumetricGeometry(vtkViewport *ren) override
void GetLODMapper(int id, vtkMapper **m)
double GetLODIndexLevel(int index)
void GetLODProperty(int id, vtkProperty **p)
void GetLODTexture(int id, vtkTexture **t)
vtkAbstractMapper3D * GetLODMapper(int id)
Get the LODMapper as an vtkAbstractMapper3D.
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)
int ConvertIDToIndex(int id)
void SetLODMapper(int id, vtkImageMapper3D *m)
int AddLOD(vtkMapper *m, vtkProperty *p, double time)
void SetLODBackfaceProperty(int id, vtkProperty *t)
Methods to set / get the backface property of an LOD.
int AddLOD(vtkImageMapper3D *m, vtkImageProperty *p, double time)
int AddLOD(vtkAbstractVolumeMapper *m, double time)
int AddLOD(vtkMapper *m, double time)
void SetAllocatedRenderTime(double t, vtkViewport *vp) override
Used by the culler / renderer to set the allocated render time for this prop.
int RenderTranslucentPolygonalGeometry(vtkViewport *ren) override
void GetLODProperty(int id, vtkImageProperty **p)
void DisableLOD(int id)
int AddLOD(vtkImageMapper3D *m, double time)
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)
int AddLOD(vtkMapper *m, vtkProperty *p, vtkProperty *back, double time)
int GetPickLODID(void)
Get the ID of the appropriate pick LOD index.
int AddLOD(vtkMapper *m, vtkProperty *p, vtkTexture *t, double time)
void GetLODProperty(int id, vtkVolumeProperty **p)
void SetLODProperty(int id, vtkVolumeProperty *p)
void SetLODTexture(int id, vtkTexture *t)
Methods to set / get the texture of an LOD.
~vtkLODProp3D() override
void GetLODMapper(int id, vtkAbstractVolumeMapper **m)
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)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:81
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:44
double * GetBounds() override=0
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:54
represent surface properties of a geometric object
Definition: vtkProperty.h:62
abstract specification for renderers
Definition: vtkRenderer.h:68
handles properties associated with a texture map
Definition: vtkTexture.h:66
abstract specification for Viewports
Definition: vtkViewport.h:45
represents the common properties for rendering a volume.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
@ level
Definition: vtkX3D.h:401
@ time
Definition: vtkX3D.h:503
@ index
Definition: vtkX3D.h:252
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:52
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)