VTK  9.5.2
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
40
41#ifndef vtkProp_h
42#define vtkProp_h
43
44#include "vtkObject.h"
45#include "vtkRenderingCoreModule.h" // For export macro
46#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
47#include <vector> // for method args
48
49VTK_ABI_NAMESPACE_BEGIN
50class vtkAssemblyPath;
53class vtkMatrix4x4;
55class vtkViewport;
56class vtkWindow;
57class vtkInformation;
61
62class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
63{
64public:
65 vtkTypeMacro(vtkProp, vtkObject);
66 void PrintSelf(ostream& os, vtkIndent indent) override;
67
73 virtual void GetActors(vtkPropCollection*) {}
75 virtual void GetVolumes(vtkPropCollection*) {}
76
78
81 vtkSetMacro(Visibility, vtkTypeBool);
82 vtkGetMacro(Visibility, vtkTypeBool);
83 vtkBooleanMacro(Visibility, vtkTypeBool);
85
87
92 vtkSetMacro(Pickable, vtkTypeBool);
93 vtkGetMacro(Pickable, vtkTypeBool);
94 vtkBooleanMacro(Pickable, vtkTypeBool);
96
100 virtual void Pick();
101
103
112 vtkSetMacro(Dragable, vtkTypeBool);
113 vtkGetMacro(Dragable, vtkTypeBool);
114 vtkBooleanMacro(Dragable, vtkTypeBool);
116
123 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
124
126
132 vtkSetMacro(UseBounds, bool);
133 vtkGetMacro(UseBounds, bool);
134 vtkBooleanMacro(UseBounds, bool);
136
141 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
142
146 virtual void ShallowCopy(vtkProp* prop);
147
149
161 virtual void InitPathTraversal();
163 virtual int GetNumberOfPaths() { return 1; }
165
171 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
172 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
173
175
182 vtkGetObjectMacro(PropertyKeys, vtkInformation);
183 virtual void SetPropertyKeys(vtkInformation* keys);
185
190 virtual bool HasKeys(vtkInformation* requiredKeys);
191
202
213
230 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
232 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
233 virtual int RenderOverlay(vtkViewport*) { return 0; }
234
245
257 vtkViewport* v, vtkInformation* requiredKeys);
258
270
281 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
282
295
307 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
308
316
329 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
330 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
331
339 virtual void SetEstimatedRenderTime(double t)
340 {
341 this->EstimatedRenderTime = t;
342 this->SavedEstimatedRenderTime = t;
343 }
344
354 {
356 }
357
371 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
372 {
373 this->EstimatedRenderTime += t;
374 }
375
377
387 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
388 {
389 this->AllocatedRenderTime = t;
391 this->EstimatedRenderTime = 0.0;
392 }
393
394
396
400 vtkGetMacro(AllocatedRenderTime, double);
402
410 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
411 vtkGetMacro(RenderTimeMultiplier, double);
412
418 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
419
426 virtual bool GetSupportsSelection() { return false; }
427
433 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
434 {
435 }
436
438
441 vtkGetMacro(NumberOfConsumers, int);
443
445
453
455
458 virtual void SetShaderProperty(vtkShaderProperty* property);
461
463 // Get if we are in the translucent polygonal geometry pass
464 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
466
467protected:
469 ~vtkProp() override;
470
475
480
481 // how many consumers does this object have
484
485 // support multi-part props and access to paths of prop
486 // stuff that follows is used to build the assembly hierarchy
488
490
491 // User-defined shader replacement and uniform variables
493
494private:
495 vtkProp(const vtkProp&) = delete;
496 void operator=(const vtkProp&) = delete;
497};
498
499VTK_ABI_NAMESPACE_END
500#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 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:171
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:432
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:307
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:330
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:483
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:487
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:410
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:163
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:339
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:230
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:489
bool UseBounds
Definition vtkProp.h:474
vtkTypeBool Pickable
Definition vtkProp.h:472
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:371
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:426
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:482
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:478
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:294
vtkTypeBool Dragable
Definition vtkProp.h:473
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:477
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:232
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:172
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:141
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:231
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:387
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:73
vtkTypeBool Visibility
Definition vtkProp.h:471
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:233
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:75
double RenderTimeMultiplier
Definition vtkProp.h:479
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:492
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:123
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:329
double AllocatedRenderTime
Definition vtkProp.h:476
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:315
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:353
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:74
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:464
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:45
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO