VTK  9.5.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#include "vtkRenderingCoreModule.h" // For export macro
27#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28#include <vector> // for method args
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkAssemblyPath;
34class vtkMatrix4x4;
36class vtkViewport;
37class vtkWindow;
38class vtkInformation;
42
43class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
44{
45public:
46 vtkTypeMacro(vtkProp, vtkObject);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
54 virtual void GetActors(vtkPropCollection*) {}
56 virtual void GetVolumes(vtkPropCollection*) {}
57
59
62 vtkSetMacro(Visibility, vtkTypeBool);
63 vtkGetMacro(Visibility, vtkTypeBool);
64 vtkBooleanMacro(Visibility, vtkTypeBool);
66
68
73 vtkSetMacro(Pickable, vtkTypeBool);
74 vtkGetMacro(Pickable, vtkTypeBool);
75 vtkBooleanMacro(Pickable, vtkTypeBool);
77
81 virtual void Pick();
82
84
93 vtkSetMacro(Dragable, vtkTypeBool);
94 vtkGetMacro(Dragable, vtkTypeBool);
95 vtkBooleanMacro(Dragable, vtkTypeBool);
97
104 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
105
107
113 vtkSetMacro(UseBounds, bool);
114 vtkGetMacro(UseBounds, bool);
115 vtkBooleanMacro(UseBounds, bool);
117
122 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
123
127 virtual void ShallowCopy(vtkProp* prop);
128
130
142 virtual void InitPathTraversal();
144 virtual int GetNumberOfPaths() { return 1; }
146
152 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
153 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
154
156
163 vtkGetObjectMacro(PropertyKeys, vtkInformation);
164 virtual void SetPropertyKeys(vtkInformation* keys);
166
171 virtual bool HasKeys(vtkInformation* requiredKeys);
172
183
194
211 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
213 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
214 virtual int RenderOverlay(vtkViewport*) { return 0; }
215
226
238 vtkViewport* v, vtkInformation* requiredKeys);
239
251
262 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
263
276
288 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
289
297
310 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
311 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
312
320 virtual void SetEstimatedRenderTime(double t)
321 {
322 this->EstimatedRenderTime = t;
323 this->SavedEstimatedRenderTime = t;
324 }
325
335 {
337 }
338
352 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
353 {
354 this->EstimatedRenderTime += t;
355 }
356
358
368 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
369 {
370 this->AllocatedRenderTime = t;
372 this->EstimatedRenderTime = 0.0;
373 }
374
375
377
381 vtkGetMacro(AllocatedRenderTime, double);
383
391 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
392 vtkGetMacro(RenderTimeMultiplier, double);
393
399 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
400
407 virtual bool GetSupportsSelection() { return false; }
408
414 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
415 {
416 }
417
419
422 vtkGetMacro(NumberOfConsumers, int);
424
426
434
436
439 virtual void SetShaderProperty(vtkShaderProperty* property);
442
444 // Get if we are in the translucent polygonal geometry pass
445 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
447
448protected:
450 ~vtkProp() override;
451
456
461
462 // how many consumers does this object have
465
466 // support multi-part props and access to paths of prop
467 // stuff that follows is used to build the assembly hierarchy
469
471
472 // User-defined shader replacement and uniform variables
474
475private:
476 vtkProp(const vtkProp&) = delete;
477 void operator=(const vtkProp&) = delete;
478};
479
480VTK_ABI_NAMESPACE_END
481#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 PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix))
These methods are used by subclasses to place a matrix (if any) in the prop prior to rendering.
Definition vtkProp.h:152
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition vtkProp.h:413
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:288
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 double GetEstimatedRenderTime()
Definition vtkProp.h:311
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:464
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:468
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:391
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition vtkProp.h:144
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:320
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:211
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition vtkProp.h:470
bool UseBounds
Definition vtkProp.h:455
vtkTypeBool Pickable
Definition vtkProp.h:453
virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:352
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:407
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition vtkProp.h:463
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition vtkProp.h:459
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:275
vtkTypeBool Dragable
Definition vtkProp.h:454
virtual void InitPathTraversal()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
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,.
static vtkInformationIntegerKey * GeneralTextureUnit()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
double EstimatedRenderTime
Definition vtkProp.h:458
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition vtkProp.h:213
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:153
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition vtkProp.h:122
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition vtkProp.h:212
virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition vtkProp.h:368
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:54
vtkTypeBool Visibility
Definition vtkProp.h:452
virtual int RenderOverlay(vtkViewport *)
Definition vtkProp.h:214
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition vtkProp.h:56
double RenderTimeMultiplier
Definition vtkProp.h:460
vtkShaderProperty * ShaderProperty
Definition vtkProp.h:473
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition vtkProp.h:104
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:310
double AllocatedRenderTime
Definition vtkProp.h:457
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:296
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition vtkProp.h:334
virtual void GetActors2D(vtkPropCollection *)
Definition vtkProp.h:55
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:445
represent GPU shader properties
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:26
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO