VTK  9.7.20260805
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
24
25#ifndef vtkProp_h
26#define vtkProp_h
27
28#include "vtkObject.h"
29
30#include "vtkRenderingCoreModule.h" // For export macro
31#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
32
33#include <vector> // for method args
34
35VTK_ABI_NAMESPACE_BEGIN
36class vtkAssemblyPath;
39class vtkMatrix4x4;
41class vtkViewport;
42class vtkWindow;
43class vtkInformation;
47
48class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
49{
50public:
51 vtkTypeMacro(vtkProp, vtkObject);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
59 virtual void GetActors(vtkPropCollection*) {}
61 virtual void GetVolumes(vtkPropCollection*) {}
62
64
67 vtkSetMacro(Visibility, vtkTypeBool);
68 vtkGetMacro(Visibility, vtkTypeBool);
69 vtkBooleanMacro(Visibility, vtkTypeBool);
71
73
78 vtkSetMacro(Pickable, vtkTypeBool);
79 vtkGetMacro(Pickable, vtkTypeBool);
80 vtkBooleanMacro(Pickable, vtkTypeBool);
82
86 virtual void Pick();
87
89
98 vtkSetMacro(Dragable, vtkTypeBool);
99 vtkGetMacro(Dragable, vtkTypeBool);
100 vtkBooleanMacro(Dragable, vtkTypeBool);
102
109 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
110
112
118 vtkSetMacro(UseBounds, bool);
119 vtkGetMacro(UseBounds, bool);
120 vtkBooleanMacro(UseBounds, bool);
122
127 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
128
132 virtual void ShallowCopy(vtkProp* prop);
133
135
147 virtual void InitPathTraversal();
150 virtual int GetNumberOfPaths() { return 1; }
152
158 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
159 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
160
162
174 vtkGetObjectMacro(PropertyKeys, vtkInformation);
175 virtual void SetPropertyKeys(vtkInformation* keys);
177
182 virtual bool HasKeys(vtkInformation* requiredKeys);
183
185
197
199
211
228 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
230 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
231 virtual int RenderOverlay(vtkViewport*) { return 0; }
232
243
255 vtkViewport* v, vtkInformation* requiredKeys);
256
268
279 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
280
293
305 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
306
314
327 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
328 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
329
337 virtual void SetEstimatedRenderTime(double t)
338 {
339 this->EstimatedRenderTime = t;
340 this->SavedEstimatedRenderTime = t;
341 }
342
352 {
354 }
355
369 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
370 {
371 this->EstimatedRenderTime += t;
372 }
373
375
385 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
386 {
387 this->AllocatedRenderTime = t;
389 this->EstimatedRenderTime = 0.0;
390 }
391
392
394
398 vtkGetMacro(AllocatedRenderTime, double);
400
408 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
409 vtkGetMacro(RenderTimeMultiplier, double);
410
416 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
417
424 virtual bool GetSupportsSelection() { return false; }
425
431 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
432 {
433 }
434
436
439 vtkGetMacro(NumberOfConsumers, int);
441
443
451
453
456 virtual void SetShaderProperty(vtkShaderProperty* property);
459
461 // Get if we are in the translucent polygonal geometry pass
462 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
464
465protected:
467 ~vtkProp() override;
468
473
478
479 // how many consumers does this object have
482
483 // support multi-part props and access to paths of prop
484 // stuff that follows is used to build the assembly hierarchy
486
488
489 // User-defined shader replacement and uniform variables
491
492private:
493 vtkProp(const vtkProp&) = delete;
494 void operator=(const vtkProp&) = delete;
495};
496
497VTK_ABI_NAMESPACE_END
498#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
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:430
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:305
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:369
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:328
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:481
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:485
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:408
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:150
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:337
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:228
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:487
bool UseBounds
Definition vtkProp.h:472
vtkTypeBool Pickable
Definition vtkProp.h:470
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:424
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:480
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:476
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:292
vtkTypeBool Dragable
Definition vtkProp.h:471
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:158
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:385
double EstimatedRenderTime
Definition vtkProp.h:475
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:230
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:159
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:127
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:229
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:59
vtkTypeBool Visibility
Definition vtkProp.h:469
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:231
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:61
double RenderTimeMultiplier
Definition vtkProp.h:477
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:490
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:109
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:327
double AllocatedRenderTime
Definition vtkProp.h:474
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:313
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:351
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:60
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:462
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:43
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
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)