VTK  9.2.6
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 
51 {
54  int ID;
55  double EstimatedTime;
56  int State;
57  double Level;
58 };
60 
61 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
62 {
63 public:
67  static vtkLODProp3D* New();
68 
69  vtkTypeMacro(vtkLODProp3D, vtkProp3D);
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
75  double* GetBounds() VTK_SIZEHINT(6) override;
76  void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds(bounds); }
77 
79 
88  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, vtkTexture* t, double time);
89  int AddLOD(vtkMapper* m, vtkProperty* p, vtkTexture* t, double time);
90  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, double time);
91  int AddLOD(vtkMapper* m, vtkProperty* p, double time);
92  int AddLOD(vtkMapper* m, vtkTexture* t, double time);
93  int AddLOD(vtkMapper* m, double time);
94  int AddLOD(vtkAbstractVolumeMapper* m, vtkVolumeProperty* p, double time);
95  int AddLOD(vtkAbstractVolumeMapper* m, double time);
96  int AddLOD(vtkImageMapper3D* m, vtkImageProperty* p, double time);
97  int AddLOD(vtkImageMapper3D* m, double time);
99 
101 
104  vtkGetMacro(NumberOfLODs, int);
106 
108 
113  vtkGetMacro(CurrentIndex, int);
115 
120  void RemoveLOD(int id);
121 
123 
129  void SetLODProperty(int id, vtkProperty* p);
130  void GetLODProperty(int id, vtkProperty** p);
131  void SetLODProperty(int id, vtkVolumeProperty* p);
132  void GetLODProperty(int id, vtkVolumeProperty** p);
133  void SetLODProperty(int id, vtkImageProperty* p);
134  void GetLODProperty(int id, vtkImageProperty** p);
136 
138 
144  void SetLODMapper(int id, vtkMapper* m);
145  void GetLODMapper(int id, vtkMapper** m);
146  void SetLODMapper(int id, vtkAbstractVolumeMapper* m);
147  void GetLODMapper(int id, vtkAbstractVolumeMapper** m);
148  void SetLODMapper(int id, vtkImageMapper3D* m);
149  void GetLODMapper(int id, vtkImageMapper3D** m);
151 
157  vtkAbstractMapper3D* GetLODMapper(int id);
158 
160 
164  void SetLODBackfaceProperty(int id, vtkProperty* t);
165  void GetLODBackfaceProperty(int id, vtkProperty** t);
167 
169 
173  void SetLODTexture(int id, vtkTexture* t);
174  void GetLODTexture(int id, vtkTexture** t);
176 
178 
183  void EnableLOD(int id);
184  void DisableLOD(int id);
185  int IsLODEnabled(int id);
187 
189 
197  void SetLODLevel(int id, double level);
198  double GetLODLevel(int id);
199  double GetLODIndexLevel(int index);
201 
203 
208  double GetLODEstimatedRenderTime(int id);
209  double GetLODIndexEstimatedRenderTime(int index);
211 
213 
218  vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
219  vtkGetMacro(AutomaticLODSelection, vtkTypeBool);
220  vtkBooleanMacro(AutomaticLODSelection, vtkTypeBool);
222 
224 
228  vtkSetMacro(SelectedLODID, int);
229  vtkGetMacro(SelectedLODID, int);
231 
235  int GetLastRenderedLODID();
236 
240  int GetPickLODID(void);
241 
243 
248  void GetActors(vtkPropCollection*) override;
249  void GetVolumes(vtkPropCollection*) override;
251 
253 
257  void SetSelectedPickLODID(int id);
258  vtkGetMacro(SelectedPickLODID, int);
260 
262 
267  vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
268  vtkGetMacro(AutomaticPickLODSelection, vtkTypeBool);
269  vtkBooleanMacro(AutomaticPickLODSelection, vtkTypeBool);
271 
275  void ShallowCopy(vtkProp* prop) override;
276 
278 
281  int RenderOpaqueGeometry(vtkViewport* viewport) override;
282  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
283  int RenderVolumetricGeometry(vtkViewport* viewport) override;
285 
290 
296  void ReleaseGraphicsResources(vtkWindow*) override;
297 
303  void SetAllocatedRenderTime(double t, vtkViewport* vp) override;
304 
311  void RestoreEstimatedRenderTime() override;
312 
317  void AddEstimatedRenderTime(double t, vtkViewport* vp) override;
318 
319 protected:
320  vtkLODProp3D();
321  ~vtkLODProp3D() override;
322 
323  int GetAutomaticPickPropIndex(void);
324 
325  // Assumes that SelectedLODIndex has already been validated:
326  void UpdateKeysForSelectedProp();
327 
332 
333  int GetNextEntryIndex();
334  int ConvertIDToIndex(int id);
336 
341  vtkLODProp3DCallback* PickCallback;
342 
343 private:
344  vtkLODProp3D(const vtkLODProp3D&) = delete;
345  void operator=(const vtkLODProp3D&) = delete;
346 };
347 
348 #endif
vtkTypeBool AutomaticLODSelection
Definition: vtkLODProp3D.h:337
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
void GetBounds(T a, double bds[6])
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
abstract specification for Viewports
Definition: vtkViewport.h:55
represent surface properties of a geometric object
Definition: vtkProperty.h:67
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:328
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:224
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:288
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:381
image display properties
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:72
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:49
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:365
int SelectedPickLODID
Definition: vtkLODProp3D.h:339
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:309
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:340
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:341
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:226
int SelectedLODIndex
Definition: vtkLODProp3D.h:335
a simple class to control print indentation
Definition: vtkIndent.h:39
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:69
handles properties associated with a texture map
Definition: vtkTexture.h:68
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:87
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:52
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:61
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:225
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:347
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:67