VTK  9.3.0
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
31#ifndef vtkProp_h
32#define vtkProp_h
33
34#include "vtkObject.h"
35#include "vtkRenderingCoreModule.h" // For export macro
36#include <vector> // for method args
37
38VTK_ABI_NAMESPACE_BEGIN
39class vtkAssemblyPath;
42class vtkMatrix4x4;
44class vtkViewport;
45class vtkWindow;
46class vtkInformation;
50
51class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
52{
53public:
54 vtkTypeMacro(vtkProp, vtkObject);
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
62 virtual void GetActors(vtkPropCollection*) {}
64 virtual void GetVolumes(vtkPropCollection*) {}
65
67
70 vtkSetMacro(Visibility, vtkTypeBool);
71 vtkGetMacro(Visibility, vtkTypeBool);
72 vtkBooleanMacro(Visibility, vtkTypeBool);
74
76
81 vtkSetMacro(Pickable, vtkTypeBool);
82 vtkGetMacro(Pickable, vtkTypeBool);
83 vtkBooleanMacro(Pickable, vtkTypeBool);
85
89 virtual void Pick();
90
92
101 vtkSetMacro(Dragable, vtkTypeBool);
102 vtkGetMacro(Dragable, vtkTypeBool);
103 vtkBooleanMacro(Dragable, vtkTypeBool);
105
112 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
113
115
121 vtkSetMacro(UseBounds, bool);
122 vtkGetMacro(UseBounds, bool);
123 vtkBooleanMacro(UseBounds, bool);
125
130 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
131
135 virtual void ShallowCopy(vtkProp* prop);
136
138
150 virtual void InitPathTraversal();
152 virtual int GetNumberOfPaths() { return 1; }
154
160 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
161 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
162
164
171 vtkGetObjectMacro(PropertyKeys, vtkInformation);
172 virtual void SetPropertyKeys(vtkInformation* keys);
174
179 virtual bool HasKeys(vtkInformation* requiredKeys);
180
191
202
219 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
221 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
222 virtual int RenderOverlay(vtkViewport*) { return 0; }
223
234
246 vtkViewport* v, vtkInformation* requiredKeys);
247
259
270 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
271
284
296 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
297
305
318 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
319 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
320
328 virtual void SetEstimatedRenderTime(double t)
329 {
330 this->EstimatedRenderTime = t;
331 this->SavedEstimatedRenderTime = t;
332 }
333
343 {
344 this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
345 }
346
360 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
361 {
362 this->EstimatedRenderTime += t;
363 }
364
366
376 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
377 {
378 this->AllocatedRenderTime = t;
379 this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
380 this->EstimatedRenderTime = 0.0;
381 }
383
385
389 vtkGetMacro(AllocatedRenderTime, double);
391
399 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
400 vtkGetMacro(RenderTimeMultiplier, double);
401
407 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
408
415 virtual bool GetSupportsSelection() { return false; }
416
422 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
423 {
424 }
425
427
430 vtkGetMacro(NumberOfConsumers, int);
432
434
442
444
447 virtual void SetShaderProperty(vtkShaderProperty* property);
450
452 // Get if we are in the translucent polygonal geometry pass
453 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
455
456protected:
458 ~vtkProp() override;
459
464
469
470 // how many consumers does this object have
473
474 // support multi-part props and access to paths of prop
475 // stuff that follows is used to build the assembly hierarchy
477
479
480 // User-defined shader replacement and uniform variables
482
483private:
484 vtkProp(const vtkProp&) = delete;
485 void operator=(const vtkProp&) = delete;
486};
487
488VTK_ABI_NAMESPACE_END
489#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:38
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:58
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:52
virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix))
These methods are used by subclasses to place a matrix (if any) in the prop prior to rendering.
Definition vtkProp.h:160
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:421
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:296
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 double GetEstimatedRenderTime()
Definition vtkProp.h:319
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:472
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:476
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:399
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:152
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: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:219
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:478
bool UseBounds
Definition vtkProp.h:463
vtkTypeBool Pickable
Definition vtkProp.h:461
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:360
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:415
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:471
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:467
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:283
vtkTypeBool Dragable
Definition vtkProp.h:462
virtual void InitPathTraversal()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
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,.
static vtkInformationIntegerKey * GeneralTextureUnit()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
double EstimatedRenderTime
Definition vtkProp.h:466
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:221
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:161
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:130
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:220
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:376
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:62
vtkTypeBool Visibility
Definition vtkProp.h:460
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:222
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:64
double RenderTimeMultiplier
Definition vtkProp.h:468
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:481
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:112
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:318
double AllocatedRenderTime
Definition vtkProp.h:465
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:304
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:342
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:63
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:453
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:54
window superclass for vtkRenderWindow
Definition vtkWindow.h:34
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_SIZEHINT(...)