VTK  9.5.20250817
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
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();
169 virtual int GetNumberOfPaths() { return 1; }
171
177 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
178 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
179
181
193 vtkGetObjectMacro(PropertyKeys, vtkInformation);
194 virtual void SetPropertyKeys(vtkInformation* keys);
196
201 virtual bool HasKeys(vtkInformation* requiredKeys);
202
204
214 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_UNIT() instead.")
215 static vtkInformationIntegerKey* GeneralTextureUnit() { return vtkProp::GENERAL_TEXTURE_UNIT(); }
218
220
230 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_TRANSFORM() instead.")
231 static vtkInformationDoubleVectorKey* GeneralTextureTransform()
232 {
234 }
237
254 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
256 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
257 virtual int RenderOverlay(vtkViewport*) { return 0; }
258
269
281 vtkViewport* v, vtkInformation* requiredKeys);
282
294
305 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
306
319
331 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
332
340
353 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
354 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
355
363 virtual void SetEstimatedRenderTime(double t)
364 {
365 this->EstimatedRenderTime = t;
366 this->SavedEstimatedRenderTime = t;
367 }
368
378 {
379 this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
380 }
381
395 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
396 {
397 this->EstimatedRenderTime += t;
398 }
399
401
411 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
412 {
413 this->AllocatedRenderTime = t;
414 this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
415 this->EstimatedRenderTime = 0.0;
416 }
418
420
424 vtkGetMacro(AllocatedRenderTime, double);
426
434 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
435 vtkGetMacro(RenderTimeMultiplier, double);
436
442 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
443
450 virtual bool GetSupportsSelection() { return false; }
451
457 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
458 {
459 }
460
462
465 vtkGetMacro(NumberOfConsumers, int);
467
469
477
479
482 virtual void SetShaderProperty(vtkShaderProperty* property);
485
487 // Get if we are in the translucent polygonal geometry pass
488 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
490
491protected:
493 ~vtkProp() override;
494
499
504
505 // how many consumers does this object have
508
509 // support multi-part props and access to paths of prop
510 // stuff that follows is used to build the assembly hierarchy
512
514
515 // User-defined shader replacement and uniform variables
517
518private:
519 vtkProp(const vtkProp&) = delete;
520 void operator=(const vtkProp&) = delete;
521};
522
523VTK_ABI_NAMESPACE_END
524#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
abstract base class for most VTK objects
Definition vtkObject.h:162
virtual vtkMTimeType GetMTime()
Return this object's modified time.
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:69
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:456
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:331
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:395
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:354
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:507
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:511
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:434
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:169
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:363
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:254
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:513
bool UseBounds
Definition vtkProp.h:498
vtkTypeBool Pickable
Definition vtkProp.h:496
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:450
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:506
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:502
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:318
vtkTypeBool Dragable
Definition vtkProp.h:497
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:177
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:411
double EstimatedRenderTime
Definition vtkProp.h:501
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:256
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:178
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:255
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:495
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:257
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:503
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:516
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:353
double AllocatedRenderTime
Definition vtkProp.h:500
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:339
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:377
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:488
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
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...
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO