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 =========================================================================*/
28 #ifndef vtkProp_h
29 #define vtkProp_h
30 
31 #include "vtkObject.h"
32 #include "vtkRenderingCoreModule.h" // For export macro
33 #include <vector> // for method args
34 
35 class vtkAssemblyPath;
36 class vtkAssemblyPaths;
38 class vtkMatrix4x4;
39 class vtkPropCollection;
40 class vtkViewport;
41 class vtkWindow;
42 class vtkInformation;
45 class vtkShaderProperty;
46 
47 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
48 {
49 public:
50  vtkTypeMacro(vtkProp, vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
58  virtual void GetActors(vtkPropCollection*) {}
59  virtual void GetActors2D(vtkPropCollection*) {}
60  virtual void GetVolumes(vtkPropCollection*) {}
61 
63 
66  vtkSetMacro(Visibility, vtkTypeBool);
67  vtkGetMacro(Visibility, vtkTypeBool);
68  vtkBooleanMacro(Visibility, vtkTypeBool);
70 
72 
77  vtkSetMacro(Pickable, vtkTypeBool);
78  vtkGetMacro(Pickable, vtkTypeBool);
79  vtkBooleanMacro(Pickable, vtkTypeBool);
81 
85  virtual void Pick();
86 
88 
97  vtkSetMacro(Dragable, vtkTypeBool);
98  vtkGetMacro(Dragable, vtkTypeBool);
99  vtkBooleanMacro(Dragable, vtkTypeBool);
101 
108  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
109 
111 
117  vtkSetMacro(UseBounds, bool);
118  vtkGetMacro(UseBounds, bool);
119  vtkBooleanMacro(UseBounds, bool);
121 
126  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
127 
131  virtual void ShallowCopy(vtkProp* prop);
132 
134 
146  virtual void InitPathTraversal();
147  virtual vtkAssemblyPath* GetNextPath();
148  virtual int GetNumberOfPaths() { return 1; }
150 
156  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
157  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
158 
160 
167  vtkGetObjectMacro(PropertyKeys, vtkInformation);
168  virtual void SetPropertyKeys(vtkInformation* keys);
170 
175  virtual bool HasKeys(vtkInformation* requiredKeys);
176 
186  static vtkInformationIntegerKey* GeneralTextureUnit();
187 
197  static vtkInformationDoubleVectorKey* GeneralTextureTransform();
198 
215  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
217  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
218  virtual int RenderOverlay(vtkViewport*) { return 0; }
219 
229  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
230 
241  virtual bool RenderFilteredTranslucentPolygonalGeometry(
242  vtkViewport* v, vtkInformation* requiredKeys);
243 
254  virtual bool RenderFilteredVolumetricGeometry(vtkViewport* v, vtkInformation* requiredKeys);
255 
266  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
267 
280 
292  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
293 
301 
314  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
315  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
316 
324  virtual void SetEstimatedRenderTime(double t)
325  {
326  this->EstimatedRenderTime = t;
327  this->SavedEstimatedRenderTime = t;
328  }
329 
339  {
340  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
341  }
342 
356  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
357  {
358  this->EstimatedRenderTime += t;
359  }
360 
362 
372  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
373  {
374  this->AllocatedRenderTime = t;
375  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
376  this->EstimatedRenderTime = 0.0;
377  }
379 
381 
385  vtkGetMacro(AllocatedRenderTime, double);
387 
395  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
396  vtkGetMacro(RenderTimeMultiplier, double);
397 
403  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
404 
411  virtual bool GetSupportsSelection() { return false; }
412 
418  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
419  {
420  }
421 
423 
426  vtkGetMacro(NumberOfConsumers, int);
428 
430 
433  void AddConsumer(vtkObject* c);
434  void RemoveConsumer(vtkObject* c);
435  vtkObject* GetConsumer(int i);
436  int IsConsumer(vtkObject* c);
438 
440 
443  virtual void SetShaderProperty(vtkShaderProperty* property);
444  virtual vtkShaderProperty* GetShaderProperty();
446 
448  // Get if we are in the translucent polygonal geometry pass
449  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
451 
452 protected:
453  vtkProp();
454  ~vtkProp() override;
455 
459  bool UseBounds;
460 
465 
466  // how many consumers does this object have
469 
470  // support multi-part props and access to paths of prop
471  // stuff that follows is used to build the assembly hierarchy
473 
475 
476  // User-defined shader replacement and uniform variables
478 
479 private:
480  vtkProp(const vtkProp&) = delete;
481  void operator=(const vtkProp&) = delete;
482 };
483 
484 #endif
vtkProp::EstimatedRenderTime
double EstimatedRenderTime
Definition: vtkProp.h:462
vtkProp::UseBounds
bool UseBounds
Definition: vtkProp.h:459
vtkProp::GetMatrix
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:157
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:156
vtkProp::Paths
vtkAssemblyPaths * Paths
Definition: vtkProp.h:472
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:59
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:218
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:411
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:215
vtkProp::GetEstimatedRenderTime
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:315
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkProp::PropertyKeys
vtkInformation * PropertyKeys
Definition: vtkProp.h:474
vtkProp::NumberOfConsumers
int NumberOfConsumers
Definition: vtkProp.h:467
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:372
vtkProp::GetVolumes
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:60
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:279
vtkProp::RenderVolumetricGeometry
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:217
vtkProp::Consumers
vtkObject ** Consumers
Definition: vtkProp.h:468
vtkProp::Dragable
vtkTypeBool Dragable
Definition: vtkProp.h:458
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:58
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:463
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:456
vtkProp::AllocatedRenderTime
double AllocatedRenderTime
Definition: vtkProp.h:461
vtkProp::GetNumberOfPaths
virtual int GetNumberOfPaths()
Definition: vtkProp.h:148
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:395
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:126
vtkProp::Pickable
vtkTypeBool Pickable
Definition: vtkProp.h:457
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:314
vtkProp::ShaderProperty
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:477
vtkProp::IsRenderingTranslucentPolygonalGeometry
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:449
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:216
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
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:356
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:338
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:417
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:324
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:292
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:108
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:300
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp::RenderTimeMultiplier
double RenderTimeMultiplier
Definition: vtkProp.h:464
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:298