VTK  9.0.20201201
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 =========================================================================*/
37 #ifndef vtkProp_h
38 #define vtkProp_h
39 
40 #include "vtkObject.h"
41 #include "vtkRenderingCoreModule.h" // For export macro
42 #include <vector> // for method args
43 
44 class vtkAssemblyPath;
45 class vtkAssemblyPaths;
47 class vtkMatrix4x4;
48 class vtkPropCollection;
49 class vtkViewport;
50 class vtkWindow;
51 class vtkInformation;
54 class vtkShaderProperty;
55 
56 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
57 {
58 public:
59  vtkTypeMacro(vtkProp, vtkObject);
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
67  virtual void GetActors(vtkPropCollection*) {}
68  virtual void GetActors2D(vtkPropCollection*) {}
69  virtual void GetVolumes(vtkPropCollection*) {}
70 
72 
75  vtkSetMacro(Visibility, vtkTypeBool);
76  vtkGetMacro(Visibility, vtkTypeBool);
77  vtkBooleanMacro(Visibility, vtkTypeBool);
79 
81 
86  vtkSetMacro(Pickable, vtkTypeBool);
87  vtkGetMacro(Pickable, vtkTypeBool);
88  vtkBooleanMacro(Pickable, vtkTypeBool);
90 
94  virtual void Pick();
95 
97 
106  vtkSetMacro(Dragable, vtkTypeBool);
107  vtkGetMacro(Dragable, vtkTypeBool);
108  vtkBooleanMacro(Dragable, vtkTypeBool);
110 
117  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
118 
120 
126  vtkSetMacro(UseBounds, bool);
127  vtkGetMacro(UseBounds, bool);
128  vtkBooleanMacro(UseBounds, bool);
130 
135  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
136 
140  virtual void ShallowCopy(vtkProp* prop);
141 
143 
155  virtual void InitPathTraversal();
156  virtual vtkAssemblyPath* GetNextPath();
157  virtual int GetNumberOfPaths() { return 1; }
159 
165  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
166  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
167 
169 
176  vtkGetObjectMacro(PropertyKeys, vtkInformation);
177  virtual void SetPropertyKeys(vtkInformation* keys);
179 
184  virtual bool HasKeys(vtkInformation* requiredKeys);
185 
195  static vtkInformationIntegerKey* GeneralTextureUnit();
196 
206  static vtkInformationDoubleVectorKey* GeneralTextureTransform();
207 
224  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
226  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
227  virtual int RenderOverlay(vtkViewport*) { return 0; }
228 
238  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
239 
250  virtual bool RenderFilteredTranslucentPolygonalGeometry(
251  vtkViewport* v, vtkInformation* requiredKeys);
252 
263  virtual bool RenderFilteredVolumetricGeometry(vtkViewport* v, vtkInformation* requiredKeys);
264 
275  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
276 
289 
301  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
302 
310 
323  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
324  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
325 
333  virtual void SetEstimatedRenderTime(double t)
334  {
335  this->EstimatedRenderTime = t;
336  this->SavedEstimatedRenderTime = t;
337  }
338 
348  {
349  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
350  }
351 
365  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
366  {
367  this->EstimatedRenderTime += t;
368  }
369 
371 
381  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
382  {
383  this->AllocatedRenderTime = t;
384  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
385  this->EstimatedRenderTime = 0.0;
386  }
388 
390 
394  vtkGetMacro(AllocatedRenderTime, double);
396 
404  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
405  vtkGetMacro(RenderTimeMultiplier, double);
406 
412  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
413 
420  virtual bool GetSupportsSelection() { return false; }
421 
427  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
428  {
429  }
430 
432 
435  vtkGetMacro(NumberOfConsumers, int);
437 
439 
442  void AddConsumer(vtkObject* c);
443  void RemoveConsumer(vtkObject* c);
444  vtkObject* GetConsumer(int i);
445  int IsConsumer(vtkObject* c);
447 
449 
452  virtual void SetShaderProperty(vtkShaderProperty* property);
453  virtual vtkShaderProperty* GetShaderProperty();
455 
457  // Get if we are in the translucent polygonal geometry pass
458  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
460 
461 protected:
462  vtkProp();
463  ~vtkProp() override;
464 
468  bool UseBounds;
469 
474 
475  // how many consumers does this object have
478 
479  // support multi-part props and access to paths of prop
480  // stuff that follows is used to build the assembly hierarchy
482 
484 
485  // User-defined shader replacement and uniform variables
487 
488 private:
489  vtkProp(const vtkProp&) = delete;
490  void operator=(const vtkProp&) = delete;
491 };
492 
493 #endif
vtkProp::EstimatedRenderTime
double EstimatedRenderTime
Definition: vtkProp.h:471
vtkProp::UseBounds
bool UseBounds
Definition: vtkProp.h:468
vtkProp::GetMatrix
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:166
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:165
vtkProp::Paths
vtkAssemblyPaths * Paths
Definition: vtkProp.h:481
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:68
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:227
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:420
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:224
vtkProp::GetEstimatedRenderTime
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:324
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkProp::PropertyKeys
vtkInformation * PropertyKeys
Definition: vtkProp.h:483
vtkProp::NumberOfConsumers
int NumberOfConsumers
Definition: vtkProp.h:476
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:381
vtkProp::GetVolumes
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:69
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
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:288
vtkProp::RenderVolumetricGeometry
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:226
vtkProp::Consumers
vtkObject ** Consumers
Definition: vtkProp.h:477
vtkProp::Dragable
vtkTypeBool Dragable
Definition: vtkProp.h:467
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:67
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:472
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:465
vtkProp::AllocatedRenderTime
double AllocatedRenderTime
Definition: vtkProp.h:470
vtkProp::GetNumberOfPaths
virtual int GetNumberOfPaths()
Definition: vtkProp.h:157
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:404
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:135
vtkProp::Pickable
vtkTypeBool Pickable
Definition: vtkProp.h:466
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:323
vtkProp::ShaderProperty
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:486
vtkProp::IsRenderingTranslucentPolygonalGeometry
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:458
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:225
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
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:365
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:347
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:426
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:333
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:301
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:117
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:309
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp::RenderTimeMultiplier
double RenderTimeMultiplier
Definition: vtkProp.h:473
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:285