VTK  9.7.20260911
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
42
43#ifndef vtkLODProp3D_h
44#define vtkLODProp3D_h
45
46#include "vtkProp3D.h"
47#include "vtkRenderingCoreModule.h" // For export macro
48#include "vtkWrappingHints.h" // For VTK_MARSHALMANUAL
49
50VTK_ABI_NAMESPACE_BEGIN
51class vtkRenderer;
52class vtkMapper;
56class vtkProperty;
59class vtkTexture;
60class vtkLODProp3DCallback;
61
63{
64 vtkProp3D* Prop3D = nullptr;
65 int Prop3DType = 0;
66 int ID = -1; // VTK_INDEX_NOT_IN_USE
67 double EstimatedTime = 0.0;
68 int State = 0;
69 double Level = 0.0;
70};
72
73class VTKRENDERINGCORE_EXPORT VTK_MARSHALMANUAL vtkLODProp3D : public vtkProp3D
74{
75public:
79 static vtkLODProp3D* New();
80
81 vtkTypeMacro(vtkLODProp3D, vtkProp3D);
82 void PrintSelf(ostream& os, vtkIndent indent) override;
83
87 double* GetBounds() VTK_SIZEHINT(6) override;
88 void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds(bounds); }
89
91
100 int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, vtkTexture* t, double time);
101 int AddLOD(vtkMapper* m, vtkProperty* p, vtkTexture* t, double time);
102 int AddLOD(vtkMapper* m, vtkProperty* p, vtkProperty* back, double time);
103 int AddLOD(vtkMapper* m, vtkProperty* p, double time);
104 int AddLOD(vtkMapper* m, vtkTexture* t, double time);
105 int AddLOD(vtkMapper* m, double time);
107 int AddLOD(vtkAbstractVolumeMapper* m, double time);
108 int AddLOD(vtkImageMapper3D* m, vtkImageProperty* p, double time);
109 int AddLOD(vtkImageMapper3D* m, double time);
111
113
116 vtkGetMacro(NumberOfLODs, int);
118
120
125 vtkGetMacro(CurrentIndex, int);
127
132 void RemoveLOD(int id);
133
135
141 void SetLODProperty(int id, vtkProperty* p);
142 void GetLODProperty(int id, vtkProperty** p);
148
150
156 void SetLODMapper(int id, vtkMapper* m);
157 void GetLODMapper(int id, vtkMapper** m);
163
170
172
179
181
185 void SetLODTexture(int id, vtkTexture* t);
186 void GetLODTexture(int id, vtkTexture** t);
188
190
195 void EnableLOD(int id);
196 void DisableLOD(int id);
197 int IsLODEnabled(int id);
199
201
209 void SetLODLevel(int id, double level);
210 double GetLODLevel(int id);
211 double GetLODIndexLevel(int index);
213
215
223
225
230 vtkSetClampMacro(AutomaticLODSelection, vtkTypeBool, 0, 1);
234
236
240 vtkSetMacro(SelectedLODID, int);
241 vtkGetMacro(SelectedLODID, int);
243
248
253
255
263
265
270 vtkGetMacro(SelectedPickLODID, int);
272
274
279 vtkSetClampMacro(AutomaticPickLODSelection, vtkTypeBool, 0, 1);
283
287 void ShallowCopy(vtkProp* prop) override;
288
290
293 int RenderOpaqueGeometry(vtkViewport* viewport) override;
295 int RenderVolumetricGeometry(vtkViewport* viewport) override;
297
302
309
315 void SetAllocatedRenderTime(double t, vtkViewport* vp) override;
316
324
329 void AddEstimatedRenderTime(double t, vtkViewport* vp) override;
330
331protected:
333 ~vtkLODProp3D() override;
334
336
337 // Assumes that SelectedLODIndex has already been validated:
339
344
346 int ConvertIDToIndex(int id);
348
353 vtkLODProp3DCallback* PickCallback;
354
355private:
356 vtkLODProp3D(const vtkLODProp3D&) = delete;
357 void operator=(const vtkLODProp3D&) = delete;
358
363 void ClearLODs();
364
371 void RebuildLODBookkeeping();
372
374};
375
376VTK_ABI_NAMESPACE_END
377#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:108
void GetLODMapper(int id, vtkImageMapper3D **m)
Methods to set / get the mapper of an LOD.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
int GetAutomaticPickPropIndex()
void SetLODMapper(int id, vtkMapper *m)
Methods to set / get the mapper of an LOD.
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
For some exporters and other other operations we must be able to collect all the actors or volumes.
void SetLODProperty(int id, vtkImageProperty *p)
Methods to set / get the property of an LOD.
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
vtkLODProp3DEntry * LODs
int IsLODEnabled(int id)
Enable / disable a particular LOD.
double GetLODLevel(int id)
Set the level of a particular LOD.
vtkAbstractMapper3D * GetLODMapper(int id)
Get the LODMapper as an vtkAbstractMapper3D.
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 GetNextEntryIndex()
vtkLODProp3DCallback * PickCallback
static vtkLODProp3D * New()
Create an instance of this class.
int AddLOD(vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
double * GetBounds() override
Standard vtkProp method to get 3D bounds of a 3D prop.
void SetLODProperty(int id, vtkProperty *p)
Methods to set / get the property of an LOD.
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkLODProp3D.
int RenderVolumetricGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkTypeBool AutomaticPickLODSelection
void RemoveLOD(int id)
Delete a level of detail given an ID.
double GetLODIndexEstimatedRenderTime(int index)
Access method that can be used to find out the estimated render time (the thing used to select an LOD...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
void GetLODMapper(int id, vtkMapper **m)
Methods to set / get the mapper of an LOD.
double GetLODIndexLevel(int index)
Set the level of a particular LOD.
void GetLODProperty(int id, vtkProperty **p)
Methods to set / get the property of an LOD.
void GetLODTexture(int id, vtkTexture **t)
Methods to set / get the texture of an LOD.
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)
Methods to set / get the backface property of an LOD.
int ConvertIDToIndex(int id)
void SetLODMapper(int id, vtkImageMapper3D *m)
Methods to set / get the mapper of an LOD.
int AddLOD(vtkMapper *m, vtkProperty *p, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void SetLODBackfaceProperty(int id, vtkProperty *t)
Methods to set / get the backface property of an LOD.
int GetPickLODID()
Get the ID of the appropriate pick LOD index.
friend class vtkLODProp3DSerDesHelper
int AddLOD(vtkImageMapper3D *m, vtkImageProperty *p, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
int AddLOD(vtkAbstractVolumeMapper *m, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
int AddLOD(vtkMapper *m, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void SetAllocatedRenderTime(double t, vtkViewport *vp) override
Used by the culler / renderer to set the allocated render time for this prop.
void GetLODProperty(int id, vtkImageProperty **p)
Methods to set / get the property of an LOD.
void DisableLOD(int id)
Enable / disable a particular LOD.
int AddLOD(vtkImageMapper3D *m, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
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)
Methods to set / get the mapper of an LOD.
int AddLOD(vtkMapper *m, vtkProperty *p, vtkProperty *back, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
int AddLOD(vtkMapper *m, vtkProperty *p, vtkTexture *t, double time)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
void GetLODProperty(int id, vtkVolumeProperty **p)
Methods to set / get the property of an LOD.
void SetLODProperty(int id, vtkVolumeProperty *p)
Methods to set / get the property of an LOD.
void SetLODTexture(int id, vtkTexture *t)
Methods to set / get the texture of an LOD.
~vtkLODProp3D() override
void GetLODMapper(int id, vtkAbstractVolumeMapper **m)
Methods to set / get the mapper of an LOD.
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)
Add a level of detail with a given mapper, property, backface property, texture, and guess of renderi...
abstract class specifies interface to map data to graphics primitives
Definition vtkMapper.h:97
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:89
double * GetBounds() override=0
Return a reference to the Prop3D's composite transform.
an ordered list of Props
represent surface properties of a geometric object
abstract specification for renderers
handles properties associated with a texture map
Definition vtkTexture.h:168
abstract specification for Viewports
Definition vtkViewport.h:66
represents the common properties for rendering a volume.
window superclass for vtkRenderWindow
Definition vtkWindow.h:62
int vtkTypeBool
Definition vtkABI.h:64
struct vtkLODProp3DEntry_t vtkLODProp3DEntry
#define VTK_SIZEHINT(...)
#define VTK_MARSHALMANUAL