VTK  9.0.1
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 =========================================================================*/
34 #ifndef vtkProp_h
35 #define vtkProp_h
36 
37 #include "vtkObject.h"
38 #include "vtkRenderingCoreModule.h" // For export macro
39 #include <vector> // for method args
40 
41 class vtkAssemblyPath;
42 class vtkAssemblyPaths;
44 class vtkMatrix4x4;
45 class vtkPropCollection;
46 class vtkViewport;
47 class vtkWindow;
48 class vtkInformation;
51 class vtkShaderProperty;
52 
53 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
54 {
55 public:
56  vtkTypeMacro(vtkProp, vtkObject);
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
64  virtual void GetActors(vtkPropCollection*) {}
65  virtual void GetActors2D(vtkPropCollection*) {}
66  virtual void GetVolumes(vtkPropCollection*) {}
67 
69 
72  vtkSetMacro(Visibility, vtkTypeBool);
73  vtkGetMacro(Visibility, vtkTypeBool);
74  vtkBooleanMacro(Visibility, vtkTypeBool);
76 
78 
83  vtkSetMacro(Pickable, vtkTypeBool);
84  vtkGetMacro(Pickable, vtkTypeBool);
85  vtkBooleanMacro(Pickable, vtkTypeBool);
87 
91  virtual void Pick();
92 
94 
103  vtkSetMacro(Dragable, vtkTypeBool);
104  vtkGetMacro(Dragable, vtkTypeBool);
105  vtkBooleanMacro(Dragable, vtkTypeBool);
107 
114  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
115 
117 
123  vtkSetMacro(UseBounds, bool);
124  vtkGetMacro(UseBounds, bool);
125  vtkBooleanMacro(UseBounds, bool);
127 
132  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
133 
137  virtual void ShallowCopy(vtkProp* prop);
138 
140 
152  virtual void InitPathTraversal();
153  virtual vtkAssemblyPath* GetNextPath();
154  virtual int GetNumberOfPaths() { return 1; }
156 
162  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
163  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
164 
166 
173  vtkGetObjectMacro(PropertyKeys, vtkInformation);
174  virtual void SetPropertyKeys(vtkInformation* keys);
176 
181  virtual bool HasKeys(vtkInformation* requiredKeys);
182 
192  static vtkInformationIntegerKey* GeneralTextureUnit();
193 
203  static vtkInformationDoubleVectorKey* GeneralTextureTransform();
204 
221  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
223  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
224  virtual int RenderOverlay(vtkViewport*) { return 0; }
225 
235  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
236 
247  virtual bool RenderFilteredTranslucentPolygonalGeometry(
248  vtkViewport* v, vtkInformation* requiredKeys);
249 
260  virtual bool RenderFilteredVolumetricGeometry(vtkViewport* v, vtkInformation* requiredKeys);
261 
272  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
273 
286 
298  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
299 
307 
320  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
321  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
322 
330  virtual void SetEstimatedRenderTime(double t)
331  {
332  this->EstimatedRenderTime = t;
333  this->SavedEstimatedRenderTime = t;
334  }
335 
345  {
346  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
347  }
348 
362  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
363  {
364  this->EstimatedRenderTime += t;
365  }
366 
368 
378  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
379  {
380  this->AllocatedRenderTime = t;
381  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
382  this->EstimatedRenderTime = 0.0;
383  }
385 
387 
391  vtkGetMacro(AllocatedRenderTime, double);
393 
401  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
402  vtkGetMacro(RenderTimeMultiplier, double);
403 
409  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
410 
417  virtual bool GetSupportsSelection() { return false; }
418 
424  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
425  {
426  }
427 
429 
432  vtkGetMacro(NumberOfConsumers, int);
434 
436 
439  void AddConsumer(vtkObject* c);
440  void RemoveConsumer(vtkObject* c);
441  vtkObject* GetConsumer(int i);
442  int IsConsumer(vtkObject* c);
444 
446 
449  virtual void SetShaderProperty(vtkShaderProperty* property);
450  virtual vtkShaderProperty* GetShaderProperty();
452 
454  // Get if we are in the translucent polygonal geometry pass
455  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
457 
458 protected:
459  vtkProp();
460  ~vtkProp() override;
461 
465  bool UseBounds;
466 
471 
472  // how many consumers does this object have
475 
476  // support multi-part props and access to paths of prop
477  // stuff that follows is used to build the assembly hierarchy
479 
481 
482  // User-defined shader replacement and uniform variables
484 
485 private:
486  vtkProp(const vtkProp&) = delete;
487  void operator=(const vtkProp&) = delete;
488 };
489 
490 #endif
vtkProp::EstimatedRenderTime
double EstimatedRenderTime
Definition: vtkProp.h:468
vtkProp::UseBounds
bool UseBounds
Definition: vtkProp.h:465
vtkProp::GetMatrix
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:163
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:162
vtkProp::Paths
vtkAssemblyPaths * Paths
Definition: vtkProp.h:478
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:65
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:224
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:417
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:221
vtkProp::GetEstimatedRenderTime
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:321
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkProp::PropertyKeys
vtkInformation * PropertyKeys
Definition: vtkProp.h:480
vtkProp::NumberOfConsumers
int NumberOfConsumers
Definition: vtkProp.h:473
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:41
vtkAssemblyPaths
a list of lists of props representing an assembly hierarchy
Definition: vtkAssemblyPaths.h:37
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:378
vtkProp::GetVolumes
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:66
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
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:285
vtkProp::RenderVolumetricGeometry
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:223
vtkProp::Consumers
vtkObject ** Consumers
Definition: vtkProp.h:474
vtkProp::Dragable
vtkTypeBool Dragable
Definition: vtkProp.h:464
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:64
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkHardwareSelector
Definition: vtkHardwareSelector.h:123
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:31
vtkProp::SavedEstimatedRenderTime
double SavedEstimatedRenderTime
Definition: vtkProp.h:469
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
vtkProp::Visibility
vtkTypeBool Visibility
Definition: vtkProp.h:462
vtkProp::AllocatedRenderTime
double AllocatedRenderTime
Definition: vtkProp.h:467
vtkProp::GetNumberOfPaths
virtual int GetNumberOfPaths()
Definition: vtkProp.h:154
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:401
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkProp::GetBounds
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:132
vtkProp::Pickable
vtkTypeBool Pickable
Definition: vtkProp.h:463
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:320
vtkProp::ShaderProperty
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:483
vtkProp::IsRenderingTranslucentPolygonalGeometry
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:455
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkObject.h
vtkShaderProperty
represent GPU shader properties
Definition: vtkShaderProperty.h:39
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:222
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
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:362
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:31
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:344
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:423
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:330
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:298
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:114
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:306
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp::RenderTimeMultiplier
double RenderTimeMultiplier
Definition: vtkProp.h:470
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293