VTK  9.7.20260813
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
43
44#ifndef vtkProp_h
45#define vtkProp_h
46
47#include "vtkObject.h"
48
49#include "vtkRenderingCoreModule.h" // For export macro
50#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
51
52#include <vector> // for method args
53
54VTK_ABI_NAMESPACE_BEGIN
55class vtkAssemblyPath;
58class vtkMatrix4x4;
60class vtkViewport;
61class vtkWindow;
62class vtkInformation;
66
67class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
68{
69public:
70 vtkTypeMacro(vtkProp, vtkObject);
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
78 virtual void GetActors(vtkPropCollection*) {}
80 virtual void GetVolumes(vtkPropCollection*) {}
81
83
86 vtkSetMacro(Visibility, vtkTypeBool);
87 vtkGetMacro(Visibility, vtkTypeBool);
88 vtkBooleanMacro(Visibility, vtkTypeBool);
90
92
97 vtkSetMacro(Pickable, vtkTypeBool);
98 vtkGetMacro(Pickable, vtkTypeBool);
99 vtkBooleanMacro(Pickable, vtkTypeBool);
101
105 virtual void Pick();
106
108
117 vtkSetMacro(Dragable, vtkTypeBool);
118 vtkGetMacro(Dragable, vtkTypeBool);
119 vtkBooleanMacro(Dragable, vtkTypeBool);
121
128 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
129
131
137 vtkSetMacro(UseBounds, bool);
138 vtkGetMacro(UseBounds, bool);
139 vtkBooleanMacro(UseBounds, bool);
141
146 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
147
151 virtual void ShallowCopy(vtkProp* prop);
152
154
166 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
216
218
230
247 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
249 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
250 virtual int RenderOverlay(vtkViewport*) { return 0; }
251
262
274 vtkViewport* v, vtkInformation* requiredKeys);
275
287
298 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
299
312
324 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
325
333
346 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
347 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
348
356 virtual void SetEstimatedRenderTime(double t)
357 {
358 this->EstimatedRenderTime = t;
359 this->SavedEstimatedRenderTime = t;
360 }
361
371 {
373 }
374
388 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
389 {
390 this->EstimatedRenderTime += t;
391 }
392
394
404 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
405 {
406 this->AllocatedRenderTime = t;
408 this->EstimatedRenderTime = 0.0;
409 }
410
411
413
417 vtkGetMacro(AllocatedRenderTime, double);
419
427 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
428 vtkGetMacro(RenderTimeMultiplier, double);
429
435 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
436
443 virtual bool GetSupportsSelection() { return false; }
444
450 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
451 {
452 }
453
455
458 vtkGetMacro(NumberOfConsumers, int);
460
462
470
472
475 virtual void SetShaderProperty(vtkShaderProperty* property);
478
480 // Get if we are in the translucent polygonal geometry pass
481 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
483
484protected:
486 ~vtkProp() override;
487
492
497
498 // how many consumers does this object have
501
502 // support multi-part props and access to paths of prop
503 // stuff that follows is used to build the assembly hierarchy
505
507
508 // User-defined shader replacement and uniform variables
510
511private:
512 vtkProp(const vtkProp&) = delete;
513 void operator=(const vtkProp&) = delete;
514};
515
516VTK_ABI_NAMESPACE_END
517#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 ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:449
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:324
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:388
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:347
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:500
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:504
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:427
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:356
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:247
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:506
bool UseBounds
Definition vtkProp.h:491
vtkTypeBool Pickable
Definition vtkProp.h:489
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:443
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:499
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:495
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:311
vtkTypeBool Dragable
Definition vtkProp.h:490
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:404
double EstimatedRenderTime
Definition vtkProp.h:494
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:249
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:146
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:248
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:78
vtkTypeBool Visibility
Definition vtkProp.h:488
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:250
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:80
double RenderTimeMultiplier
Definition vtkProp.h:496
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:509
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:128
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:346
double AllocatedRenderTime
Definition vtkProp.h:493
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:332
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:370
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:79
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:481
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:62
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)