VTK  9.2.6
vtkProp.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkProp.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
53#ifndef vtkProp_h
54#define vtkProp_h
55
56#include "vtkObject.h"
57#include "vtkRenderingCoreModule.h" // For export macro
58#include <vector> // for method args
59
60class vtkAssemblyPath;
63class vtkMatrix4x4;
65class vtkViewport;
66class vtkWindow;
67class vtkInformation;
71
72class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
73{
74public:
75 vtkTypeMacro(vtkProp, vtkObject);
76 void PrintSelf(ostream& os, vtkIndent indent) override;
77
83 virtual void GetActors(vtkPropCollection*) {}
85 virtual void GetVolumes(vtkPropCollection*) {}
86
88
91 vtkSetMacro(Visibility, vtkTypeBool);
92 vtkGetMacro(Visibility, vtkTypeBool);
93 vtkBooleanMacro(Visibility, vtkTypeBool);
95
97
102 vtkSetMacro(Pickable, vtkTypeBool);
103 vtkGetMacro(Pickable, vtkTypeBool);
104 vtkBooleanMacro(Pickable, vtkTypeBool);
106
110 virtual void Pick();
111
113
122 vtkSetMacro(Dragable, vtkTypeBool);
123 vtkGetMacro(Dragable, vtkTypeBool);
124 vtkBooleanMacro(Dragable, vtkTypeBool);
126
133 virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
134
136
142 vtkSetMacro(UseBounds, bool);
143 vtkGetMacro(UseBounds, bool);
144 vtkBooleanMacro(UseBounds, bool);
146
151 virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
152
156 virtual void ShallowCopy(vtkProp* prop);
157
159
171 virtual void InitPathTraversal();
173 virtual int GetNumberOfPaths() { return 1; }
175
181 virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
182 virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
183
185
192 vtkGetObjectMacro(PropertyKeys, vtkInformation);
193 virtual void SetPropertyKeys(vtkInformation* keys);
195
200 virtual bool HasKeys(vtkInformation* requiredKeys);
201
212
223
240 virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
242 virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
243 virtual int RenderOverlay(vtkViewport*) { return 0; }
244
255
267 vtkViewport* v, vtkInformation* requiredKeys);
268
280
291 virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
292
305
317 virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
318
326
339 virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
340 virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
341
349 virtual void SetEstimatedRenderTime(double t)
350 {
351 this->EstimatedRenderTime = t;
352 this->SavedEstimatedRenderTime = t;
353 }
354
364 {
365 this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
366 }
367
381 virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
382 {
383 this->EstimatedRenderTime += t;
384 }
385
387
397 virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
398 {
399 this->AllocatedRenderTime = t;
400 this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
401 this->EstimatedRenderTime = 0.0;
402 }
404
406
410 vtkGetMacro(AllocatedRenderTime, double);
412
420 void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
421 vtkGetMacro(RenderTimeMultiplier, double);
422
428 virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
429
436 virtual bool GetSupportsSelection() { return false; }
437
443 vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
444 {
445 }
446
448
451 vtkGetMacro(NumberOfConsumers, int);
453
455
463
465
468 virtual void SetShaderProperty(vtkShaderProperty* property);
471
473 // Get if we are in the translucent polygonal geometry pass
474 virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
476
477protected:
479 ~vtkProp() override;
480
485
490
491 // how many consumers does this object have
494
495 // support multi-part props and access to paths of prop
496 // stuff that follows is used to build the assembly hierarchy
498
500
501 // User-defined shader replacement and uniform variables
503
504private:
505 vtkProp(const vtkProp&) = delete;
506 void operator=(const vtkProp&) = delete;
507};
508
509#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:119
Key for integer values in vtkInformation.
Store vtkAlgorithm input/output information.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:151
abstract base class for most VTK objects
Definition: vtkObject.h:79
virtual vtkMTimeType GetMTime()
Return this object's modified time.
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:73
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:181
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:442
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:317
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:340
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:493
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:497
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:420
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition: vtkProp.h:173
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:349
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:240
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition: vtkProp.h:499
bool UseBounds
Definition: vtkProp.h:484
vtkTypeBool Pickable
Definition: vtkProp.h:482
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:381
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:436
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int NumberOfConsumers
Definition: vtkProp.h:492
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double SavedEstimatedRenderTime
Definition: vtkProp.h:488
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:304
vtkTypeBool Dragable
Definition: vtkProp.h:483
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:487
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:242
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:182
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:151
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:241
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:397
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:83
vtkTypeBool Visibility
Definition: vtkProp.h:481
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:243
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:85
double RenderTimeMultiplier
Definition: vtkProp.h:489
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:502
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:133
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:339
double AllocatedRenderTime
Definition: vtkProp.h:486
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:325
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:363
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:84
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:474
represent GPU shader properties
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_SIZEHINT(...)