VTK
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 =========================================================================*/
31 #ifndef vtkProp_h
32 #define vtkProp_h
33 
34 #include "vtkRenderingCoreModule.h" // For export macro
35 #include "vtkObject.h"
36 #include <vector> // for method args
37 
38 class vtkAssemblyPath;
39 class vtkAssemblyPaths;
41 class vtkMatrix4x4;
42 class vtkPropCollection;
43 class vtkViewport;
44 class vtkWindow;
45 class vtkInformation;
48 class vtkShaderProperty;
49 
50 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
51 {
52 public:
53  vtkTypeMacro(vtkProp, vtkObject);
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
61  virtual void GetActors(vtkPropCollection *) {}
62  virtual void GetActors2D(vtkPropCollection *) {}
63  virtual void GetVolumes(vtkPropCollection *) {}
64 
66 
69  vtkSetMacro(Visibility, vtkTypeBool);
70  vtkGetMacro(Visibility, vtkTypeBool);
71  vtkBooleanMacro(Visibility, vtkTypeBool);
73 
75 
80  vtkSetMacro(Pickable, vtkTypeBool);
81  vtkGetMacro(Pickable, vtkTypeBool);
82  vtkBooleanMacro(Pickable, vtkTypeBool);
84 
88  virtual void Pick();
89 
91 
100  vtkSetMacro(Dragable, vtkTypeBool);
101  vtkGetMacro(Dragable, vtkTypeBool);
102  vtkBooleanMacro(Dragable, vtkTypeBool);
104 
112  { return this->GetMTime(); }
113 
115 
121  vtkSetMacro(UseBounds, bool);
122  vtkGetMacro(UseBounds, bool);
123  vtkBooleanMacro(UseBounds, bool);
125 
130  virtual double *GetBounds() VTK_SIZEHINT(6)
131  { return nullptr; }
132 
136  virtual void ShallowCopy(vtkProp *prop);
137 
139 
151  virtual void InitPathTraversal();
152  virtual vtkAssemblyPath *GetNextPath();
153  virtual int GetNumberOfPaths()
154  { return 1; }
156 
162  virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
164  { return nullptr; }
165 
167 
174  vtkGetObjectMacro(PropertyKeys,vtkInformation);
175  virtual void SetPropertyKeys(vtkInformation *keys);
177 
182  virtual bool HasKeys(vtkInformation *requiredKeys);
183 
193  static vtkInformationIntegerKey *GeneralTextureUnit();
194 
204  static vtkInformationDoubleVectorKey *GeneralTextureTransform();
205 
223  { return 0; }
225  { return 0; }
227  { return 0; }
228  virtual int RenderOverlay(vtkViewport *)
229  { return 0; }
230 
240  virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
241  vtkInformation *requiredKeys);
242 
253  virtual bool RenderFilteredTranslucentPolygonalGeometry(
254  vtkViewport *v,
255  vtkInformation *requiredKeys);
256 
267  virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
268  vtkInformation *requiredKeys);
269 
280  virtual bool RenderFilteredOverlay(vtkViewport *v,
281  vtkInformation *requiredKeys);
282 
295  { return 0; }
296 
309  { return 1; }
310 
318 
332  { return this->EstimatedRenderTime; }
333  virtual double GetEstimatedRenderTime()
334  { return this->EstimatedRenderTime; }
335 
343  virtual void SetEstimatedRenderTime(double t)
344  { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
345 
355  { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
356 
357 
371  virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
372  { this->EstimatedRenderTime += t; }
373 
375 
385  virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
386  {
387  this->AllocatedRenderTime = t;
388  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
389  this->EstimatedRenderTime = 0.0;
390  }
392 
394 
398  vtkGetMacro(AllocatedRenderTime, double);
400 
408  void SetRenderTimeMultiplier( double t )
409  { this->RenderTimeMultiplier = t; }
410  vtkGetMacro(RenderTimeMultiplier, double);
411 
417  virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
418 
425  virtual bool GetSupportsSelection()
426  { return false; }
427 
433  vtkHardwareSelector * /* sel */,
434  std::vector<unsigned int> & /* pixeloffsets */) { };
435 
437 
440  vtkGetMacro(NumberOfConsumers,int);
442 
444 
447  void AddConsumer(vtkObject *c);
448  void RemoveConsumer(vtkObject *c);
449  vtkObject *GetConsumer(int i);
450  int IsConsumer(vtkObject *c);
452 
454 
457  virtual void SetShaderProperty(vtkShaderProperty *property);
458  virtual vtkShaderProperty *GetShaderProperty();
460 
462  // Get if we are in the translucent polygonal geometry pass
463  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; };
465 
466 protected:
467  vtkProp();
468  ~vtkProp() override;
469 
473  bool UseBounds;
474 
479 
480  // how many consumers does this object have
483 
484  // support multi-part props and access to paths of prop
485  // stuff that follows is used to build the assembly hierarchy
487 
489 
490  // User-defined shader replacement and uniform variables
492 
493 private:
494  vtkProp(const vtkProp&) = delete;
495  void operator=(const vtkProp&) = delete;
496 };
497 
498 #endif
vtkProp::EstimatedRenderTime
double EstimatedRenderTime
Definition: vtkProp.h:476
vtkProp::UseBounds
bool UseBounds
Definition: vtkProp.h:473
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:486
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:62
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:228
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:425
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:222
vtkProp::GetEstimatedRenderTime
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:333
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkProp::PropertyKeys
vtkInformation * PropertyKeys
Definition: vtkProp.h:488
vtkProp::NumberOfConsumers
int NumberOfConsumers
Definition: vtkProp.h:481
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:44
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:385
vtkProp::GetVolumes
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:63
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
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:294
vtkProp::RenderVolumetricGeometry
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:226
vtkProp::Consumers
vtkObject ** Consumers
Definition: vtkProp.h:482
vtkProp::Dragable
vtkTypeBool Dragable
Definition: vtkProp.h:472
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:61
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:34
vtkProp::SavedEstimatedRenderTime
double SavedEstimatedRenderTime
Definition: vtkProp.h:477
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
vtkProp::Visibility
vtkTypeBool Visibility
Definition: vtkProp.h:470
vtkProp::AllocatedRenderTime
double AllocatedRenderTime
Definition: vtkProp.h:475
vtkProp::GetNumberOfPaths
virtual int GetNumberOfPaths()
Definition: vtkProp.h:153
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:408
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:130
vtkProp::Pickable
vtkTypeBool Pickable
Definition: vtkProp.h:471
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:331
vtkProp::ShaderProperty
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:491
vtkProp::IsRenderingTranslucentPolygonalGeometry
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:463
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkObject.h
vtkShaderProperty
represent GPU shader properties
Definition: vtkShaderProperty.h:42
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:70
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
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:371
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:34
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:354
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:432
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:343
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:308
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:38
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:111
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:317
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp::RenderTimeMultiplier
double RenderTimeMultiplier
Definition: vtkProp.h:478
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304