VTK  9.3.1
vtkLODProp3D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkLODProp3D_h
22 #define vtkLODProp3D_h
23 
24 #include "vtkProp3D.h"
25 #include "vtkRenderingCoreModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkRenderer;
29 class vtkMapper;
32 class vtkImageMapper3D;
33 class vtkProperty;
34 class vtkVolumeProperty;
35 class vtkImageProperty;
36 class vtkTexture;
37 class vtkLODProp3DCallback;
38 
40 {
43  int ID;
44  double EstimatedTime;
45  int State;
46  double Level;
47 };
49 
50 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
51 {
52 public:
56  static vtkLODProp3D* New();
57 
58  vtkTypeMacro(vtkLODProp3D, vtkProp3D);
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
64  double* GetBounds() VTK_SIZEHINT(6) override;
65  void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds(bounds); }
66 
68 
77  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, vtkTexture* t, double time);
78  int AddLOD(vtkMapper* m, vtkProperty* p, vtkTexture* t, double time);
79  int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, double time);
80  int AddLOD(vtkMapper* m, vtkProperty* p, double time);
81  int AddLOD(vtkMapper* m, vtkTexture* t, double time);
82  int AddLOD(vtkMapper* m, double time);
83  int AddLOD(vtkAbstractVolumeMapper* m, vtkVolumeProperty* p, double time);
84  int AddLOD(vtkAbstractVolumeMapper* m, double time);
85  int AddLOD(vtkImageMapper3D* m, vtkImageProperty* p, double time);
86  int AddLOD(vtkImageMapper3D* m, double time);
88 
90 
93  vtkGetMacro(NumberOfLODs, int);
95 
97 
102  vtkGetMacro(CurrentIndex, int);
104 
109  void RemoveLOD(int id);
110 
112 
118  void SetLODProperty(int id, vtkProperty* p);
119  void GetLODProperty(int id, vtkProperty** p);
120  void SetLODProperty(int id, vtkVolumeProperty* p);
121  void GetLODProperty(int id, vtkVolumeProperty** p);
122  void SetLODProperty(int id, vtkImageProperty* p);
123  void GetLODProperty(int id, vtkImageProperty** p);
125 
127 
133  void SetLODMapper(int id, vtkMapper* m);
134  void GetLODMapper(int id, vtkMapper** m);
135  void SetLODMapper(int id, vtkAbstractVolumeMapper* m);
136  void GetLODMapper(int id, vtkAbstractVolumeMapper** m);
137  void SetLODMapper(int id, vtkImageMapper3D* m);
138  void GetLODMapper(int id, vtkImageMapper3D** m);
140 
146  vtkAbstractMapper3D* GetLODMapper(int id);
147 
149 
153  void SetLODBackfaceProperty(int id, vtkProperty* t);
154  void GetLODBackfaceProperty(int id, vtkProperty** t);
156 
158 
162  void SetLODTexture(int id, vtkTexture* t);
163  void GetLODTexture(int id, vtkTexture** t);
165 
167 
172  void EnableLOD(int id);
173  void DisableLOD(int id);
174  int IsLODEnabled(int id);
176 
178 
186  void SetLODLevel(int id, double level);
187  double GetLODLevel(int id);
188  double GetLODIndexLevel(int index);
190 
192 
197  double GetLODEstimatedRenderTime(int id);
198  double GetLODIndexEstimatedRenderTime(int index);
200 
202 
207  vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
208  vtkGetMacro(AutomaticLODSelection, vtkTypeBool);
209  vtkBooleanMacro(AutomaticLODSelection, vtkTypeBool);
211 
213 
217  vtkSetMacro(SelectedLODID, int);
218  vtkGetMacro(SelectedLODID, int);
220 
224  int GetLastRenderedLODID();
225 
229  int GetPickLODID();
230 
232 
237  void GetActors(vtkPropCollection*) override;
238  void GetVolumes(vtkPropCollection*) override;
240 
242 
246  void SetSelectedPickLODID(int id);
247  vtkGetMacro(SelectedPickLODID, int);
249 
251 
256  vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
257  vtkGetMacro(AutomaticPickLODSelection, vtkTypeBool);
258  vtkBooleanMacro(AutomaticPickLODSelection, vtkTypeBool);
260 
264  void ShallowCopy(vtkProp* prop) override;
265 
267 
270  int RenderOpaqueGeometry(vtkViewport* viewport) override;
271  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
272  int RenderVolumetricGeometry(vtkViewport* viewport) override;
274 
279 
285  void ReleaseGraphicsResources(vtkWindow*) override;
286 
292  void SetAllocatedRenderTime(double t, vtkViewport* vp) override;
293 
300  void RestoreEstimatedRenderTime() override;
301 
306  void AddEstimatedRenderTime(double t, vtkViewport* vp) override;
307 
308 protected:
309  vtkLODProp3D();
310  ~vtkLODProp3D() override;
311 
312  int GetAutomaticPickPropIndex();
313 
314  // Assumes that SelectedLODIndex has already been validated:
315  void UpdateKeysForSelectedProp();
316 
321 
322  int GetNextEntryIndex();
323  int ConvertIDToIndex(int id);
325 
330  vtkLODProp3DCallback* PickCallback;
331 
332 private:
333  vtkLODProp3D(const vtkLODProp3D&) = delete;
334  void operator=(const vtkLODProp3D&) = delete;
335 };
336 
337 VTK_ABI_NAMESPACE_END
338 #endif
vtkTypeBool AutomaticLODSelection
Definition: vtkLODProp3D.h:326
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
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:44
represent surface properties of a geometric object
Definition: vtkProperty.h:56
vtkLODProp3DEntry * LODs
Definition: vtkLODProp3D.h:317
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:213
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:277
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:370
image display properties
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:61
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:38
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:354
int SelectedPickLODID
Definition: vtkLODProp3D.h:328
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:298
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
vtkTypeBool AutomaticPickLODSelection
Definition: vtkLODProp3D.h:329
vtkLODProp3DCallback * PickCallback
Definition: vtkLODProp3D.h:330
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:215
int SelectedLODIndex
Definition: vtkLODProp3D.h:324
a simple class to control print indentation
Definition: vtkIndent.h:28
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:58
handles properties associated with a texture map
Definition: vtkTexture.h:57
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:76
vtkProp3D * Prop3D
Definition: vtkLODProp3D.h:41
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:50
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:214
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:336
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:56