VTK  9.0.1
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 "vtkProp3D.h"
34 #include "vtkRenderingCoreModule.h" // For export macro
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]) { this->vtkProp3D::GetBounds(bounds); }
73 
75 
84  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, vtkTexture* t, double time);
85  int AddLOD(vtkMapper* m, vtkProperty* p, vtkTexture* t, double time);
86  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, double time);
87  int AddLOD(vtkMapper* m, vtkProperty* p, double time);
88  int AddLOD(vtkMapper* m, vtkTexture* t, double time);
89  int AddLOD(vtkMapper* m, double time);
93  int AddLOD(vtkImageMapper3D* m, double time);
95 
97 
100  vtkGetMacro(NumberOfLODs, int);
102 
104 
109  vtkGetMacro(CurrentIndex, int);
111 
116  void RemoveLOD(int id);
117 
119 
125  void SetLODProperty(int id, vtkProperty* p);
126  void GetLODProperty(int id, vtkProperty** p);
130  void GetLODProperty(int id, vtkImageProperty** p);
132 
134 
140  void SetLODMapper(int id, vtkMapper* m);
141  void GetLODMapper(int id, vtkMapper** m);
144  void SetLODMapper(int id, vtkImageMapper3D* m);
145  void GetLODMapper(int id, vtkImageMapper3D** m);
147 
154 
156 
163 
165 
169  void SetLODTexture(int id, vtkTexture* t);
170  void GetLODTexture(int id, vtkTexture** t);
172 
174 
179  void EnableLOD(int id);
180  void DisableLOD(int id);
181  int IsLODEnabled(int id);
183 
185 
193  void SetLODLevel(int id, double level);
194  double GetLODLevel(int id);
195  double GetLODIndexLevel(int index);
197 
199 
207 
209 
214  vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
215  vtkGetMacro(AutomaticLODSelection, vtkTypeBool);
216  vtkBooleanMacro(AutomaticLODSelection, vtkTypeBool);
218 
220 
224  vtkSetMacro(SelectedLODID, int);
225  vtkGetMacro(SelectedLODID, int);
227 
232 
236  int GetPickLODID(void);
237 
239 
244  void GetActors(vtkPropCollection*) override;
245  void GetVolumes(vtkPropCollection*) override;
247 
249 
253  void SetSelectedPickLODID(int id);
254  vtkGetMacro(SelectedPickLODID, int);
256 
258 
263  vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
264  vtkGetMacro(AutomaticPickLODSelection, vtkTypeBool);
265  vtkBooleanMacro(AutomaticPickLODSelection, vtkTypeBool);
267 
271  void ShallowCopy(vtkProp* prop) override;
272 
274 
277  int RenderOpaqueGeometry(vtkViewport* viewport) override;
281 
286 
293 
299  void SetAllocatedRenderTime(double t, vtkViewport* vp) override;
300 
307  void RestoreEstimatedRenderTime() override;
308 
313  void AddEstimatedRenderTime(double t, vtkViewport* vp) override;
314 
315 protected:
317  ~vtkLODProp3D() override;
318 
320 
321  // Assumes that SelectedLODIndex has already been validated:
323 
328 
330  int ConvertIDToIndex(int id);
332 
337  vtkLODProp3DCallback* PickCallback;
338 
339 private:
340  vtkLODProp3D(const vtkLODProp3D&) = delete;
341  void operator=(const vtkLODProp3D&) = delete;
342 };
343 
344 #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:58
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:333
static vtkLODProp3D * New()
Create an instance of this class.
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:324
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:335
int GetNextEntryIndex()
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:337
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:331
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkLODProp3D.
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:336
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:48
represent surface properties of a geometric object
Definition: vtkProperty.h:62
abstract specification for renderers
Definition: vtkRenderer.h:59
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:35
@ level
Definition: vtkX3D.h:401
@ time
Definition: vtkX3D.h:503
@ index
Definition: vtkX3D.h:252
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:49
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)