VTK  9.1.0
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 =========================================================================*/
56 #ifndef vtkProp_h
57 #define vtkProp_h
58 
59 #include "vtkObject.h"
60 #include "vtkRenderingCoreModule.h" // For export macro
61 #include <vector> // for method args
62 
63 class vtkAssemblyPath;
64 class vtkAssemblyPaths;
66 class vtkMatrix4x4;
67 class vtkPropCollection;
68 class vtkViewport;
69 class vtkWindow;
70 class vtkInformation;
73 class vtkShaderProperty;
74 
75 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
76 {
77 public:
78  vtkTypeMacro(vtkProp, vtkObject);
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
86  virtual void GetActors(vtkPropCollection*) {}
87  virtual void GetActors2D(vtkPropCollection*) {}
88  virtual void GetVolumes(vtkPropCollection*) {}
89 
91 
94  vtkSetMacro(Visibility, vtkTypeBool);
95  vtkGetMacro(Visibility, vtkTypeBool);
96  vtkBooleanMacro(Visibility, vtkTypeBool);
98 
100 
105  vtkSetMacro(Pickable, vtkTypeBool);
106  vtkGetMacro(Pickable, vtkTypeBool);
107  vtkBooleanMacro(Pickable, vtkTypeBool);
109 
113  virtual void Pick();
114 
116 
125  vtkSetMacro(Dragable, vtkTypeBool);
126  vtkGetMacro(Dragable, vtkTypeBool);
127  vtkBooleanMacro(Dragable, vtkTypeBool);
129 
136  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
137 
139 
145  vtkSetMacro(UseBounds, bool);
146  vtkGetMacro(UseBounds, bool);
147  vtkBooleanMacro(UseBounds, bool);
149 
154  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
155 
159  virtual void ShallowCopy(vtkProp* prop);
160 
162 
174  virtual void InitPathTraversal();
176  virtual int GetNumberOfPaths() { return 1; }
178 
184  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
185  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
186 
188 
195  vtkGetObjectMacro(PropertyKeys, vtkInformation);
196  virtual void SetPropertyKeys(vtkInformation* keys);
198 
203  virtual bool HasKeys(vtkInformation* requiredKeys);
204 
215 
226 
243  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
245  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
246  virtual int RenderOverlay(vtkViewport*) { return 0; }
247 
257  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
258 
270  vtkViewport* v, vtkInformation* requiredKeys);
271 
283 
294  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
295 
308 
320  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
321 
329 
342  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
343  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
344 
352  virtual void SetEstimatedRenderTime(double t)
353  {
354  this->EstimatedRenderTime = t;
355  this->SavedEstimatedRenderTime = t;
356  }
357 
367  {
368  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
369  }
370 
384  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
385  {
386  this->EstimatedRenderTime += t;
387  }
388 
390 
400  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
401  {
402  this->AllocatedRenderTime = t;
403  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
404  this->EstimatedRenderTime = 0.0;
405  }
407 
409 
413  vtkGetMacro(AllocatedRenderTime, double);
415 
423  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
424  vtkGetMacro(RenderTimeMultiplier, double);
425 
431  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
432 
439  virtual bool GetSupportsSelection() { return false; }
440 
446  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
447  {
448  }
449 
451 
454  vtkGetMacro(NumberOfConsumers, int);
456 
458 
466 
468 
471  virtual void SetShaderProperty(vtkShaderProperty* property);
474 
476  // Get if we are in the translucent polygonal geometry pass
477  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
479 
480 protected:
482  ~vtkProp() override;
483 
487  bool UseBounds;
488 
493 
494  // how many consumers does this object have
497 
498  // support multi-part props and access to paths of prop
499  // stuff that follows is used to build the assembly hierarchy
501 
503 
504  // User-defined shader replacement and uniform variables
506 
507 private:
508  vtkProp(const vtkProp&) = delete;
509  void operator=(const vtkProp&) = delete;
510 };
511 
512 #endif
vtkProp::GetShaderProperty
virtual vtkShaderProperty * GetShaderProperty()
Set/Get the shader property.
vtkProp::vtkProp
vtkProp()
vtkProp::EstimatedRenderTime
double EstimatedRenderTime
Definition: vtkProp.h:490
vtkProp::UseBounds
bool UseBounds
Definition: vtkProp.h:487
vtkProp::GetMatrix
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:185
vtkProp::PokeMatrix
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:184
vtkProp::Paths
vtkAssemblyPaths * Paths
Definition: vtkProp.h:500
vtkProp::InitPathTraversal
virtual void InitPathTraversal()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:87
vtkProp::GetNextPath
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:246
vtkProp::GetSupportsSelection
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:439
vtkProp::IsConsumer
int IsConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
vtkProp::Pick
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkProp::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:243
vtkProp::GetEstimatedRenderTime
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:343
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkProp::PropertyKeys
vtkInformation * PropertyKeys
Definition: vtkProp.h:502
vtkProp::NumberOfConsumers
int NumberOfConsumers
Definition: vtkProp.h:495
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:91
vtkAssemblyPaths
a list of lists of props representing an assembly hierarchy
Definition: vtkAssemblyPaths.h:38
vtkProp::SetAllocatedRenderTime
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:400
vtkProp::GetVolumes
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:88
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkProp::HasTranslucentPolygonalGeometry
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:307
vtkProp::RenderFilteredOpaqueGeometry
virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the opaque geometry only if the prop has all the requiredKeys.
vtkProp::RenderVolumetricGeometry
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:245
vtkProp::Consumers
vtkObject ** Consumers
Definition: vtkProp.h:496
vtkProp::BuildPaths
virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkProp::Dragable
vtkTypeBool Dragable
Definition: vtkProp.h:486
vtkProp::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkProp::GetActors
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:86
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
vtkProp::SetShaderProperty
virtual void SetShaderProperty(vtkShaderProperty *property)
Set/Get the shader property.
vtkProp::RenderFilteredTranslucentPolygonalGeometry
virtual bool RenderFilteredTranslucentPolygonalGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the translucent polygonal geometry only if the prop has all the requiredKeys.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkProp::GetConsumer
vtkObject * GetConsumer(int i)
Add or remove or get or check a consumer,.
vtkHardwareSelector
Definition: vtkHardwareSelector.h:153
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:32
vtkProp::SavedEstimatedRenderTime
double SavedEstimatedRenderTime
Definition: vtkProp.h:491
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
vtkProp::SetPropertyKeys
virtual void SetPropertyKeys(vtkInformation *keys)
Set/Get property keys.
vtkProp::Visibility
vtkTypeBool Visibility
Definition: vtkProp.h:484
vtkProp::AllocatedRenderTime
double AllocatedRenderTime
Definition: vtkProp.h:489
vtkProp::GetNumberOfPaths
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition: vtkProp.h:176
vtkProp::SetRenderTimeMultiplier
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:423
vtkProp::GetBounds
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:154
vtkProp::RenderFilteredVolumetricGeometry
virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the volumetric geometry only if the prop has all the requiredKeys.
vtkProp::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp.
vtkProp::Pickable
vtkTypeBool Pickable
Definition: vtkProp.h:485
vtkProp::GetEstimatedRenderTime
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:342
vtkProp::ShaderProperty
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:505
vtkProp::IsRenderingTranslucentPolygonalGeometry
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:477
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkObject.h
vtkShaderProperty
represent GPU shader properties
Definition: vtkShaderProperty.h:129
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:244
vtkProp::GeneralTextureTransform
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
vtkProp::AddEstimatedRenderTime
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:384
vtkProp::RenderFilteredOverlay
virtual bool RenderFilteredOverlay(vtkViewport *v, vtkInformation *requiredKeys)
Render in the overlay of the viewport only if the prop has all the requiredKeys.
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:51
vtkProp::RemoveConsumer
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
vtkProp::RestoreEstimatedRenderTime
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:366
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:445
vtkProp::HasKeys
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
vtkProp::~vtkProp
~vtkProp() override
vtkProp::SetEstimatedRenderTime
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:352
vtkProp::HasOpaqueGeometry
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:320
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkProp::AddConsumer
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:136
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:328
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp::RenderTimeMultiplier
double RenderTimeMultiplier
Definition: vtkProp.h:492
vtkProp::GeneralTextureUnit
static vtkInformationIntegerKey * GeneralTextureUnit()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287