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 =========================================================================*/
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);
93  int AddLOD(vtkAbstractVolumeMapper* m, vtkVolumeProperty* p, double time);
94  int AddLOD(vtkAbstractVolumeMapper* m, double time);
95  int AddLOD(vtkImageMapper3D* m, vtkImageProperty* p, 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);
130  void SetLODProperty(int id, vtkVolumeProperty* p);
131  void GetLODProperty(int id, vtkVolumeProperty** p);
132  void SetLODProperty(int id, vtkImageProperty* p);
133  void GetLODProperty(int id, vtkImageProperty** p);
135 
137 
143  void SetLODMapper(int id, vtkMapper* m);
144  void GetLODMapper(int id, vtkMapper** m);
145  void SetLODMapper(int id, vtkAbstractVolumeMapper* m);
146  void GetLODMapper(int id, vtkAbstractVolumeMapper** m);
147  void SetLODMapper(int id, vtkImageMapper3D* m);
148  void GetLODMapper(int id, vtkImageMapper3D** m);
150 
156  vtkAbstractMapper3D* GetLODMapper(int id);
157 
159 
163  void SetLODBackfaceProperty(int id, vtkProperty* t);
164  void GetLODBackfaceProperty(int id, vtkProperty** t);
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 
207  double GetLODEstimatedRenderTime(int id);
208  double GetLODIndexEstimatedRenderTime(int index);
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 
234  int GetLastRenderedLODID();
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;
282  int RenderVolumetricGeometry(vtkViewport* ren) override;
284 
289 
295  void ReleaseGraphicsResources(vtkWindow*) override;
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:
319  vtkLODProp3D();
320  ~vtkLODProp3D() override;
321 
322  int GetAutomaticPickPropIndex(void);
323 
324  // Assumes that SelectedLODIndex has already been validated:
325  void UpdateKeysForSelectedProp();
326 
331 
332  int GetNextEntryIndex();
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
vtkTypeBool AutomaticLODSelection
Definition: vtkLODProp3D.h:336
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:52
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:61
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:327
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:221
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:285
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:378
image display properties
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:67
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
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:362
int SelectedPickLODID
Definition: vtkLODProp3D.h:338
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:306
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:339
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:340
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:223
int SelectedLODIndex
Definition: vtkLODProp3D.h:334
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class for mapping images to the screen
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp3D.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:66
handles properties associated with a texture map
Definition: vtkTexture.h:65
abstract class specifies interface to map 3D data
#define VTK_SIZEHINT(...)
represents the common properties for rendering a volume.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:80
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
level of detail 3D prop
Definition: vtkLODProp3D.h:60
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:222
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:344
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:64