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
21
22#ifndef vtkProp_h
23#define vtkProp_h
24
25#include "vtkObject.h"
26
27#include "vtkDeprecation.h" // for deprecation macro
28#include "vtkRenderingCoreModule.h" // For export macro
29#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30
31#include <vector> // for method args
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkAssemblyPath;
37class vtkMatrix4x4;
39class vtkViewport;
40class vtkWindow;
41class vtkInformation;
45
46class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
47{
48public:
49 vtkTypeMacro(vtkProp, vtkObject);
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
57 virtual void GetActors(vtkPropCollection*) {}
59 virtual void GetVolumes(vtkPropCollection*) {}
60
62
65 vtkSetMacro(Visibility, vtkTypeBool);
66 vtkGetMacro(Visibility, vtkTypeBool);
67 vtkBooleanMacro(Visibility, vtkTypeBool);
69
71
76 vtkSetMacro(Pickable, vtkTypeBool);
77 vtkGetMacro(Pickable, vtkTypeBool);
78 vtkBooleanMacro(Pickable, vtkTypeBool);
80
84 virtual void Pick();
85
87
96 vtkSetMacro(Dragable, vtkTypeBool);
97 vtkGetMacro(Dragable, vtkTypeBool);
98 vtkBooleanMacro(Dragable, vtkTypeBool);
100
107 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
108
110
116 vtkSetMacro(UseBounds, bool);
117 vtkGetMacro(UseBounds, bool);
118 vtkBooleanMacro(UseBounds, bool);
120
125 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
126
130 virtual void ShallowCopy(vtkProp* prop);
131
133
145 virtual void InitPathTraversal();
147 virtual int GetNumberOfPaths() { return 1; }
149
155 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
156 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
157
159
171 vtkGetObjectMacro(PropertyKeys, vtkInformation);
172 virtual void SetPropertyKeys(vtkInformation* keys);
174
179 virtual bool HasKeys(vtkInformation* requiredKeys);
180
182
192 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_UNIT() instead.")
196
198
208 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_TRANSFORM() instead.")
215
232 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
234 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
235 virtual int RenderOverlay(vtkViewport*) { return 0; }
236
247
259 vtkViewport* v, vtkInformation* requiredKeys);
260
272
283 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
284
297
309 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
310
318
331 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
332 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
333
341 virtual void SetEstimatedRenderTime(double t)
342 {
343 this->EstimatedRenderTime = t;
344 this->SavedEstimatedRenderTime = t;
345 }
346
356 {
358 }
359
373 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
374 {
375 this->EstimatedRenderTime += t;
376 }
377
379
389 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
390 {
391 this->AllocatedRenderTime = t;
393 this->EstimatedRenderTime = 0.0;
394 }
395
396
398
402 vtkGetMacro(AllocatedRenderTime, double);
404
412 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
413 vtkGetMacro(RenderTimeMultiplier, double);
414
420 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
421
428 virtual bool GetSupportsSelection() { return false; }
429
435 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
436 {
437 }
438
440
443 vtkGetMacro(NumberOfConsumers, int);
445
447
455
457
460 virtual void SetShaderProperty(vtkShaderProperty* property);
463
465 // Get if we are in the translucent polygonal geometry pass
466 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
468
469protected:
471 ~vtkProp() override;
472
477
482
483 // how many consumers does this object have
486
487 // support multi-part props and access to paths of prop
488 // stuff that follows is used to build the assembly hierarchy
490
492
493 // User-defined shader replacement and uniform variables
495
496private:
497 vtkProp(const vtkProp&) = delete;
498 void operator=(const vtkProp&) = delete;
499};
500
501VTK_ABI_NAMESPACE_END
502#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:434
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:309
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:373
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:332
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:485
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:489
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:412
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:147
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:341
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:232
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:491
bool UseBounds
Definition vtkProp.h:476
vtkTypeBool Pickable
Definition vtkProp.h:474
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:428
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:484
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:480
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:296
vtkTypeBool Dragable
Definition vtkProp.h:475
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:155
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:389
double EstimatedRenderTime
Definition vtkProp.h:479
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:234
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:156
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:125
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:233
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:57
vtkTypeBool Visibility
Definition vtkProp.h:473
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:235
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:59
double RenderTimeMultiplier
Definition vtkProp.h:481
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:494
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:107
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:331
double AllocatedRenderTime
Definition vtkProp.h:478
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:317
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:355
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:58
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:466
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:26
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
Definition vtkProp.h:209
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:193
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