VTK  9.6.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
46#include "vtkDeprecation.h" // for deprecation macro
47#include "vtkRenderingCoreModule.h" // For export macro
48#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
49
50#include <vector> // for method args
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkAssemblyPath;
56class vtkMatrix4x4;
58class vtkViewport;
59class vtkWindow;
60class vtkInformation;
64
65class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
66{
67public:
68 vtkTypeMacro(vtkProp, vtkObject);
69 void PrintSelf(ostream& os, vtkIndent indent) override;
70
76 virtual void GetActors(vtkPropCollection*) {}
78 virtual void GetVolumes(vtkPropCollection*) {}
79
81
84 vtkSetMacro(Visibility, vtkTypeBool);
85 vtkGetMacro(Visibility, vtkTypeBool);
86 vtkBooleanMacro(Visibility, vtkTypeBool);
88
90
95 vtkSetMacro(Pickable, vtkTypeBool);
96 vtkGetMacro(Pickable, vtkTypeBool);
97 vtkBooleanMacro(Pickable, vtkTypeBool);
99
103 virtual void Pick();
104
106
115 vtkSetMacro(Dragable, vtkTypeBool);
116 vtkGetMacro(Dragable, vtkTypeBool);
117 vtkBooleanMacro(Dragable, vtkTypeBool);
119
126 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
127
129
135 vtkSetMacro(UseBounds, bool);
136 vtkGetMacro(UseBounds, bool);
137 vtkBooleanMacro(UseBounds, bool);
139
144 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
145
149 virtual void ShallowCopy(vtkProp* prop);
150
152
164 virtual void InitPathTraversal();
166 virtual int GetNumberOfPaths() { return 1; }
168
174 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
175 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
176
178
190 vtkGetObjectMacro(PropertyKeys, vtkInformation);
191 virtual void SetPropertyKeys(vtkInformation* keys);
193
198 virtual bool HasKeys(vtkInformation* requiredKeys);
199
201
211 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_UNIT() instead.")
215
217
227 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_TRANSFORM() instead.")
234
251 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
253 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
254 virtual int RenderOverlay(vtkViewport*) { return 0; }
255
266
278 vtkViewport* v, vtkInformation* requiredKeys);
279
291
302 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
303
316
328 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
329
337
350 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
351 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
352
360 virtual void SetEstimatedRenderTime(double t)
361 {
362 this->EstimatedRenderTime = t;
363 this->SavedEstimatedRenderTime = t;
364 }
365
375 {
377 }
378
392 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
393 {
394 this->EstimatedRenderTime += t;
395 }
396
398
408 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
409 {
410 this->AllocatedRenderTime = t;
412 this->EstimatedRenderTime = 0.0;
413 }
414
415
417
421 vtkGetMacro(AllocatedRenderTime, double);
423
431 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
432 vtkGetMacro(RenderTimeMultiplier, double);
433
439 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
440
447 virtual bool GetSupportsSelection() { return false; }
448
454 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
455 {
456 }
457
459
462 vtkGetMacro(NumberOfConsumers, int);
464
466
474
476
479 virtual void SetShaderProperty(vtkShaderProperty* property);
482
484 // Get if we are in the translucent polygonal geometry pass
485 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
487
488protected:
490 ~vtkProp() override;
491
496
501
502 // how many consumers does this object have
505
506 // support multi-part props and access to paths of prop
507 // stuff that follows is used to build the assembly hierarchy
509
511
512 // User-defined shader replacement and uniform variables
514
515private:
516 vtkProp(const vtkProp&) = delete;
517 void operator=(const vtkProp&) = delete;
518};
519
520VTK_ABI_NAMESPACE_END
521#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:453
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:328
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:392
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:351
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:504
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:508
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:431
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:166
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:360
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:251
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:510
bool UseBounds
Definition vtkProp.h:495
vtkTypeBool Pickable
Definition vtkProp.h:493
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:447
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:503
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:499
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:315
vtkTypeBool Dragable
Definition vtkProp.h:494
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:174
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:408
double EstimatedRenderTime
Definition vtkProp.h:498
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:253
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:175
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:144
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:252
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:76
vtkTypeBool Visibility
Definition vtkProp.h:492
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:254
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:78
double RenderTimeMultiplier
Definition vtkProp.h:500
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:513
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:126
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:350
double AllocatedRenderTime
Definition vtkProp.h:497
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:336
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:374
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:77
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:485
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:45
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
Definition vtkProp.h:228
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...
static vtkInformationIntegerKey * GeneralTextureUnit()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
Definition vtkProp.h:212
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO