VTK  9.7.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
24
25#ifndef vtkProp_h
26#define vtkProp_h
27
28#include "vtkObject.h"
29
30#include "vtkDeprecation.h" // for deprecation macro
31#include "vtkRenderingCoreModule.h" // For export macro
32#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33
34#include <vector> // for method args
35
36VTK_ABI_NAMESPACE_BEGIN
37class vtkAssemblyPath;
40class vtkMatrix4x4;
42class vtkViewport;
43class vtkWindow;
44class vtkInformation;
48
49class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
50{
51public:
52 vtkTypeMacro(vtkProp, vtkObject);
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
60 virtual void GetActors(vtkPropCollection*) {}
62 virtual void GetVolumes(vtkPropCollection*) {}
63
65
68 vtkSetMacro(Visibility, vtkTypeBool);
69 vtkGetMacro(Visibility, vtkTypeBool);
70 vtkBooleanMacro(Visibility, vtkTypeBool);
72
74
79 vtkSetMacro(Pickable, vtkTypeBool);
80 vtkGetMacro(Pickable, vtkTypeBool);
81 vtkBooleanMacro(Pickable, vtkTypeBool);
83
87 virtual void Pick();
88
90
99 vtkSetMacro(Dragable, vtkTypeBool);
100 vtkGetMacro(Dragable, vtkTypeBool);
101 vtkBooleanMacro(Dragable, vtkTypeBool);
103
110 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
111
113
119 vtkSetMacro(UseBounds, bool);
120 vtkGetMacro(UseBounds, bool);
121 vtkBooleanMacro(UseBounds, bool);
123
128 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
129
133 virtual void ShallowCopy(vtkProp* prop);
134
136
148 virtual void InitPathTraversal();
151 virtual int GetNumberOfPaths() { return 1; }
153
159 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
160 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
161
163
175 vtkGetObjectMacro(PropertyKeys, vtkInformation);
176 virtual void SetPropertyKeys(vtkInformation* keys);
178
183 virtual bool HasKeys(vtkInformation* requiredKeys);
184
186
196 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_UNIT() instead.")
200
202
212 VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_TRANSFORM() instead.")
214 {
216 }
219
236 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
238 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
239 virtual int RenderOverlay(vtkViewport*) { return 0; }
240
251
263 vtkViewport* v, vtkInformation* requiredKeys);
264
276
287 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
288
301
313 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
314
322
335 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
336 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
337
345 virtual void SetEstimatedRenderTime(double t)
346 {
347 this->EstimatedRenderTime = t;
348 this->SavedEstimatedRenderTime = t;
349 }
350
360 {
362 }
363
377 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
378 {
379 this->EstimatedRenderTime += t;
380 }
381
383
393 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
394 {
395 this->AllocatedRenderTime = t;
397 this->EstimatedRenderTime = 0.0;
398 }
400
402
406 vtkGetMacro(AllocatedRenderTime, double);
408
416 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
417 vtkGetMacro(RenderTimeMultiplier, double);
418
424 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
425
432 virtual bool GetSupportsSelection() { return false; }
433
439 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
440 {
441 }
442
444
447 vtkGetMacro(NumberOfConsumers, int);
449
451
459
461
464 virtual void SetShaderProperty(vtkShaderProperty* property);
467
469 // Get if we are in the translucent polygonal geometry pass
470 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
472
473protected:
475 ~vtkProp() override;
476
481
486
487 // how many consumers does this object have
490
491 // support multi-part props and access to paths of prop
492 // stuff that follows is used to build the assembly hierarchy
494
496
497 // User-defined shader replacement and uniform variables
499
500private:
501 vtkProp(const vtkProp&) = delete;
502 void operator=(const vtkProp&) = delete;
503};
504
505VTK_ABI_NAMESPACE_END
506#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:438
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:313
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:377
virtual double GetEstimatedRenderTime()
Definition vtkProp.h:336
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:489
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:493
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:416
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:151
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:345
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:236
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:495
bool UseBounds
Definition vtkProp.h:480
vtkTypeBool Pickable
Definition vtkProp.h:478
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:432
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:488
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:484
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:300
vtkTypeBool Dragable
Definition vtkProp.h:479
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:159
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:393
double EstimatedRenderTime
Definition vtkProp.h:483
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:238
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:160
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:128
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:237
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:60
vtkTypeBool Visibility
Definition vtkProp.h:477
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:239
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:62
double RenderTimeMultiplier
Definition vtkProp.h:485
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:498
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:110
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:335
double AllocatedRenderTime
Definition vtkProp.h:482
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:321
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:359
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:61
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:470
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:42
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
Definition vtkProp.h:213
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:197
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)