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
22#ifndef vtkProp_h
23#define vtkProp_h
24
25#include "vtkObject.h"
26#include "vtkRenderingCoreModule.h" // For export macro
27#include <vector> // for method args
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkAssemblyPath;
33class vtkMatrix4x4;
35class vtkViewport;
36class vtkWindow;
37class vtkInformation;
41
42class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
43{
44public:
45 vtkTypeMacro(vtkProp, vtkObject);
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
53 virtual void GetActors(vtkPropCollection*) {}
55 virtual void GetVolumes(vtkPropCollection*) {}
56
58
61 vtkSetMacro(Visibility, vtkTypeBool);
62 vtkGetMacro(Visibility, vtkTypeBool);
63 vtkBooleanMacro(Visibility, vtkTypeBool);
65
67
72 vtkSetMacro(Pickable, vtkTypeBool);
73 vtkGetMacro(Pickable, vtkTypeBool);
74 vtkBooleanMacro(Pickable, vtkTypeBool);
76
80 virtual void Pick();
81
83
92 vtkSetMacro(Dragable, vtkTypeBool);
93 vtkGetMacro(Dragable, vtkTypeBool);
94 vtkBooleanMacro(Dragable, vtkTypeBool);
96
103 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
104
106
112 vtkSetMacro(UseBounds, bool);
113 vtkGetMacro(UseBounds, bool);
114 vtkBooleanMacro(UseBounds, bool);
116
121 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
122
126 virtual void ShallowCopy(vtkProp* prop);
127
129
141 virtual void InitPathTraversal();
143 virtual int GetNumberOfPaths() { return 1; }
145
151 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
152 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
153
155
162 vtkGetObjectMacro(PropertyKeys, vtkInformation);
163 virtual void SetPropertyKeys(vtkInformation* keys);
165
170 virtual bool HasKeys(vtkInformation* requiredKeys);
171
182
193
210 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
212 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
213 virtual int RenderOverlay(vtkViewport*) { return 0; }
214
225
237 vtkViewport* v, vtkInformation* requiredKeys);
238
250
261 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
262
275
287 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
288
296
309 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
310 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
311
319 virtual void SetEstimatedRenderTime(double t)
320 {
321 this->EstimatedRenderTime = t;
322 this->SavedEstimatedRenderTime = t;
323 }
324
334 {
335 this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
336 }
337
351 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
352 {
353 this->EstimatedRenderTime += t;
354 }
355
357
367 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
368 {
369 this->AllocatedRenderTime = t;
370 this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
371 this->EstimatedRenderTime = 0.0;
372 }
374
376
380 vtkGetMacro(AllocatedRenderTime, double);
382
390 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
391 vtkGetMacro(RenderTimeMultiplier, double);
392
398 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
399
406 virtual bool GetSupportsSelection() { return false; }
407
413 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
414 {
415 }
416
418
421 vtkGetMacro(NumberOfConsumers, int);
423
425
433
435
438 virtual void SetShaderProperty(vtkShaderProperty* property);
441
443 // Get if we are in the translucent polygonal geometry pass
444 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
446
447protected:
449 ~vtkProp() override;
450
455
460
461 // how many consumers does this object have
464
465 // support multi-part props and access to paths of prop
466 // stuff that follows is used to build the assembly hierarchy
468
470
471 // User-defined shader replacement and uniform variables
473
474private:
475 vtkProp(const vtkProp&) = delete;
476 void operator=(const vtkProp&) = delete;
477};
478
479VTK_ABI_NAMESPACE_END
480#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:29
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:49
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:43
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:151
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:412
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:287
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:310
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:463
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:467
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:390
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:143
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:319
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:210
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:469
bool UseBounds
Definition vtkProp.h:454
vtkTypeBool Pickable
Definition vtkProp.h:452
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:351
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:406
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:462
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:458
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:274
vtkTypeBool Dragable
Definition vtkProp.h:453
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:457
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:212
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:152
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:121
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:211
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:367
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:53
vtkTypeBool Visibility
Definition vtkProp.h:451
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:213
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:55
double RenderTimeMultiplier
Definition vtkProp.h:459
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:472
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:103
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:309
double AllocatedRenderTime
Definition vtkProp.h:456
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:295
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:333
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:54
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:444
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_SIZEHINT(...)