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 =========================================================================*/
34 #ifndef vtkProp_h
35 #define vtkProp_h
36 
37 #include "vtkRenderingCoreModule.h" // For export macro
38 #include "vtkObject.h"
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 
52 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
53 {
54 public:
55  vtkTypeMacro(vtkProp, vtkObject);
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
63  virtual void GetActors(vtkPropCollection *) {}
64  virtual void GetActors2D(vtkPropCollection *) {}
65  virtual void GetVolumes(vtkPropCollection *) {}
66 
68 
71  vtkSetMacro(Visibility, vtkTypeBool);
72  vtkGetMacro(Visibility, vtkTypeBool);
73  vtkBooleanMacro(Visibility, vtkTypeBool);
75 
77 
82  vtkSetMacro(Pickable, vtkTypeBool);
83  vtkGetMacro(Pickable, vtkTypeBool);
84  vtkBooleanMacro(Pickable, vtkTypeBool);
86 
90  virtual void Pick();
91 
93 
102  vtkSetMacro(Dragable, vtkTypeBool);
103  vtkGetMacro(Dragable, vtkTypeBool);
104  vtkBooleanMacro(Dragable, vtkTypeBool);
106 
114  { 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)
133  { return nullptr; }
134 
138  virtual void ShallowCopy(vtkProp *prop);
139 
141 
153  virtual void InitPathTraversal();
154  virtual vtkAssemblyPath *GetNextPath();
155  virtual int GetNumberOfPaths()
156  { return 1; }
158 
164  virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
166  { 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 
225  { return 0; }
227  { return 0; }
229  { return 0; }
230  virtual int RenderOverlay(vtkViewport *)
231  { return 0; }
232 
242  virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
243  vtkInformation *requiredKeys);
244 
255  virtual bool RenderFilteredTranslucentPolygonalGeometry(
256  vtkViewport *v,
257  vtkInformation *requiredKeys);
258 
269  virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
270  vtkInformation *requiredKeys);
271 
282  virtual bool RenderFilteredOverlay(vtkViewport *v,
283  vtkInformation *requiredKeys);
284 
297  { return 0; }
298 
306 
320  { return this->EstimatedRenderTime; }
321  virtual double GetEstimatedRenderTime()
322  { return this->EstimatedRenderTime; }
323 
331  virtual void SetEstimatedRenderTime(double t)
332  { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
333 
343  { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
344 
345 
359  virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
360  { this->EstimatedRenderTime += t; }
361 
363 
373  virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
374  {
375  this->AllocatedRenderTime = t;
376  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
377  this->EstimatedRenderTime = 0.0;
378  }
380 
382 
386  vtkGetMacro(AllocatedRenderTime, double);
388 
396  void SetRenderTimeMultiplier( double t )
397  { this->RenderTimeMultiplier = t; }
398  vtkGetMacro(RenderTimeMultiplier, double);
399 
405  virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
406 
413  virtual bool GetSupportsSelection()
414  { return false; }
415 
421  vtkHardwareSelector * /* sel */,
422  std::vector<unsigned int> & /* pixeloffsets */) { };
423 
425 
428  vtkGetMacro(NumberOfConsumers,int);
430 
432 
435  void AddConsumer(vtkObject *c);
436  void RemoveConsumer(vtkObject *c);
437  vtkObject *GetConsumer(int i);
438  int IsConsumer(vtkObject *c);
440 
441 protected:
442  vtkProp();
443  ~vtkProp() override;
444 
448  bool UseBounds;
449 
454 
455  // how many consumers does this object have
458 
459  // support multi-part props and access to paths of prop
460  // stuff that follows is used to build the assembly hierarchy
462 
464 
465 private:
466  vtkProp(const vtkProp&) = delete;
467  void operator=(const vtkProp&) = delete;
468 };
469 
470 #endif
vtkProp::EstimatedRenderTime
double EstimatedRenderTime
Definition: vtkProp.h:451
vtkProp::UseBounds
bool UseBounds
Definition: vtkProp.h:448
vtkProp::GetMatrix
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:165
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:164
vtkProp::Paths
vtkAssemblyPaths * Paths
Definition: vtkProp.h:461
vtkProp::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:64
vtkProp::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:230
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:413
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:321
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkProp::PropertyKeys
vtkInformation * PropertyKeys
Definition: vtkProp.h:463
vtkProp::NumberOfConsumers
int NumberOfConsumers
Definition: vtkProp.h:456
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:373
vtkProp::GetVolumes
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:65
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:296
vtkProp::RenderVolumetricGeometry
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:228
vtkProp::Consumers
vtkObject ** Consumers
Definition: vtkProp.h:457
vtkProp::Dragable
vtkTypeBool Dragable
Definition: vtkProp.h:447
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:63
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
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:452
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:445
vtkProp::AllocatedRenderTime
double AllocatedRenderTime
Definition: vtkProp.h:450
vtkProp::GetNumberOfPaths
virtual int GetNumberOfPaths()
Definition: vtkProp.h:155
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:396
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:446
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:319
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkObject.h
vtkProp::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:226
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
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:359
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:342
vtkProp::ProcessSelectorPixelBuffers
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:420
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:331
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
vtkProp::GetRedrawMTime
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:113
vtkProp::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:305
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkProp::RenderTimeMultiplier
double RenderTimeMultiplier
Definition: vtkProp.h:453
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302