VTK  9.6.20260221
vtkProp.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
43
44#ifndef vtkProp_h
45#define vtkProp_h
46
47#include "vtkObject.h"
48
49#include "vtkDeprecation.h" // for deprecation macro
50#include "vtkRenderingCoreModule.h" // For export macro
51#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
52
53#include <vector> // for method args
54
55VTK_ABI_NAMESPACE_BEGIN
56class vtkAssemblyPath;
59class vtkMatrix4x4;
61class vtkViewport;
62class vtkWindow;
63class vtkInformation;
67
68class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
69{
70public:
71 vtkTypeMacro(vtkProp, vtkObject);
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
79 virtual void GetActors(vtkPropCollection*) {}
81 virtual void GetVolumes(vtkPropCollection*) {}
82
84
87 vtkSetMacro(Visibility, vtkTypeBool);
88 vtkGetMacro(Visibility, vtkTypeBool);
89 vtkBooleanMacro(Visibility, vtkTypeBool);
91
93
98 vtkSetMacro(Pickable, vtkTypeBool);
99 vtkGetMacro(Pickable, vtkTypeBool);
100 vtkBooleanMacro(Pickable, vtkTypeBool);
102
106 virtual void Pick();
107
109
118 vtkSetMacro(Dragable, vtkTypeBool);
119 vtkGetMacro(Dragable, vtkTypeBool);
120 vtkBooleanMacro(Dragable, vtkTypeBool);
122
129 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
130
132
138 vtkSetMacro(UseBounds, bool);
139 vtkGetMacro(UseBounds, bool);
140 vtkBooleanMacro(UseBounds, bool);
142
147 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
148
152 virtual void ShallowCopy(vtkProp* prop);
153
155
167 virtual void InitPathTraversal();
170 virtual int GetNumberOfPaths() { return 1; }
172
178 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
179 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
180
182
194 vtkGetObjectMacro(PropertyKeys, vtkInformation);
195 virtual void SetPropertyKeys(vtkInformation* keys);
197
202 virtual bool HasKeys(vtkInformation* requiredKeys);
203
205
215 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_UNIT() instead.")
219
221
231 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_TRANSFORM() instead.")
238
255 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
257 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
258 virtual int RenderOverlay(vtkViewport*) { return 0; }
259
270
282 vtkViewport* v, vtkInformation* requiredKeys);
283
295
306 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
307
320
332 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
333
341
354 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
355 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
356
364 virtual void SetEstimatedRenderTime(double t)
365 {
366 this->EstimatedRenderTime = t;
367 this->SavedEstimatedRenderTime = t;
368 }
369
379 {
381 }
382
396 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
397 {
398 this->EstimatedRenderTime += t;
399 }
400
402
412 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
413 {
414 this->AllocatedRenderTime = t;
416 this->EstimatedRenderTime = 0.0;
417 }
418
419
421
425 vtkGetMacro(AllocatedRenderTime, double);
427
435 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
436 vtkGetMacro(RenderTimeMultiplier, double);
437
443 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
444
451 virtual bool GetSupportsSelection() { return false; }
452
458 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
459 {
460 }
461
463
466 vtkGetMacro(NumberOfConsumers, int);
468
470
478
480
483 virtual void SetShaderProperty(vtkShaderProperty* property);
486
488 // Get if we are in the translucent polygonal geometry pass
489 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
491
492protected:
494 ~vtkProp() override;
495
500
505
506 // how many consumers does this object have
509
510 // support multi-part props and access to paths of prop
511 // stuff that follows is used to build the assembly hierarchy
513
515
516 // User-defined shader replacement and uniform variables
518
519private:
520 vtkProp(const vtkProp&) = delete;
521 void operator=(const vtkProp&) = delete;
522};
523
524VTK_ABI_NAMESPACE_END
525#endif
a list of nodes that form an assembly path
a list of lists of props representing an assembly hierarchy
a simple class to control print indentation
Definition vtkIndent.h:108
Key for integer values in vtkInformation.
Store vtkAlgorithm input/output information.
represent and manipulate 4x4 transformation matrices
virtual vtkMTimeType GetMTime()
Return this object's modified time.
an ordered list of Props
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:457
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:332
virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual vtkShaderProperty * GetShaderProperty()
Set/Get the shader property.
virtual bool RenderFilteredTranslucentPolygonalGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the translucent polygonal geometry only if the prop has all the requiredKeys.
virtual void AddEstimatedRenderTime(double t, vtkViewport *vp)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:396
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:355
virtual bool RenderFilteredOverlay(vtkViewport *v, vtkInformation *requiredKeys)
Render in the overlay of the viewport only if the prop has all the requiredKeys.
vtkObject ** Consumers
Definition vtkProp.h:508
virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the volumetric geometry only if the prop has all the requiredKeys.
~vtkProp() override
vtkAssemblyPaths * Paths
Definition vtkProp.h:512
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:435
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:170
virtual void SetEstimatedRenderTime(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:364
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:255
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:514
bool UseBounds
Definition vtkProp.h:499
vtkTypeBool Pickable
Definition vtkProp.h:497
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:451
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:507
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:503
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:319
vtkTypeBool Dragable
Definition vtkProp.h:498
virtual void InitPathTraversal()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
virtual void PokeMatrix(vtkMatrix4x4 *matrix)
These methods are used by subclasses to place a matrix (if any) in the prop prior to rendering.
Definition vtkProp.h:178
vtkObject * GetConsumer(int i)
Add or remove or get or check a consumer,.
int IsConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual void SetAllocatedRenderTime(double t, vtkViewport *v)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:412
double EstimatedRenderTime
Definition vtkProp.h:502
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:257
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:179
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:147
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:256
virtual void SetPropertyKeys(vtkInformation *keys)
Set/Get property keys.
virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the opaque geometry only if the prop has all the requiredKeys.
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:79
vtkTypeBool Visibility
Definition vtkProp.h:496
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:258
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:81
double RenderTimeMultiplier
Definition vtkProp.h:504
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:517
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:129
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:354
double AllocatedRenderTime
Definition vtkProp.h:501
virtual void SetShaderProperty(vtkShaderProperty *property)
Set/Get the shader property.
virtual void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp.
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition vtkProp.h:340
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:378
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:80
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition vtkProp.h:489
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:61
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
Definition vtkProp.h:232
static vtkInformationIntegerKey * GENERAL_TEXTURE_UNIT()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
static vtkInformationDoubleVectorKey * GENERAL_TEXTURE_TRANSFORM()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
static vtkInformationIntegerKey * GeneralTextureUnit()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
Definition vtkProp.h:216
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)