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 "vtkRenderingCoreModule.h" // For export macro
32 #include "vtkObject.h"
33 
34 class vtkAssemblyPath;
35 class vtkAssemblyPaths;
36 class vtkMatrix4x4;
37 class vtkPropCollection;
38 class vtkViewport;
39 class vtkWindow;
40 class vtkInformation;
43 
44 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
45 {
46 public:
47  vtkTypeMacro(vtkProp, vtkObject);
48  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49 
55  virtual void GetActors(vtkPropCollection *) {}
56  virtual void GetActors2D(vtkPropCollection *) {}
57  virtual void GetVolumes(vtkPropCollection *) {}
58 
60 
63  vtkSetMacro(Visibility, int);
64  vtkGetMacro(Visibility, int);
65  vtkBooleanMacro(Visibility, int);
67 
69 
74  vtkSetMacro(Pickable, int);
75  vtkGetMacro(Pickable, int);
76  vtkBooleanMacro(Pickable, int);
78 
82  virtual void Pick();
83 
85 
94  vtkSetMacro(Dragable, int);
95  vtkGetMacro(Dragable, int);
96  vtkBooleanMacro(Dragable, int);
98 
106  { return this->GetMTime(); }
107 
109 
115  vtkSetMacro(UseBounds, bool);
116  vtkGetMacro(UseBounds, bool);
117  vtkBooleanMacro(UseBounds, bool);
119 
124  virtual double *GetBounds()
125  { return NULL; }
126 
130  virtual void ShallowCopy(vtkProp *prop);
131 
133 
145  virtual void InitPathTraversal();
146  virtual vtkAssemblyPath *GetNextPath();
147  virtual int GetNumberOfPaths()
148  { return 1; }
150 
156  virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
158  { return NULL; }
159 
161 
168  vtkGetObjectMacro(PropertyKeys,vtkInformation);
169  virtual void SetPropertyKeys(vtkInformation *keys);
171 
176  virtual bool HasKeys(vtkInformation *requiredKeys);
177 
187  static vtkInformationIntegerKey *GeneralTextureUnit();
188 
198  static vtkInformationDoubleVectorKey *GeneralTextureTransform();
199 
217  { return 0; }
219  { return 0; }
221  { return 0; }
222  virtual int RenderOverlay(vtkViewport *)
223  { return 0; }
224 
234  virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
235  vtkInformation *requiredKeys);
236 
247  virtual bool RenderFilteredTranslucentPolygonalGeometry(
248  vtkViewport *v,
249  vtkInformation *requiredKeys);
250 
261  virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
262  vtkInformation *requiredKeys);
263 
274  virtual bool RenderFilteredOverlay(vtkViewport *v,
275  vtkInformation *requiredKeys);
276 
289  { return 0; }
290 
298 
312  { return this->EstimatedRenderTime; }
313  virtual double GetEstimatedRenderTime()
314  { return this->EstimatedRenderTime; }
315 
323  virtual void SetEstimatedRenderTime(double t)
324  { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
325 
335  { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
336 
337 
351  virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
352  { this->EstimatedRenderTime += t; }
353 
355 
365  virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
366  {
367  this->AllocatedRenderTime = t;
368  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
369  this->EstimatedRenderTime = 0.0;
370  }
372 
374 
378  vtkGetMacro(AllocatedRenderTime, double);
380 
388  void SetRenderTimeMultiplier( double t )
389  { this->RenderTimeMultiplier = t; }
390  vtkGetMacro(RenderTimeMultiplier, double);
391 
397  virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
398 
405  virtual bool GetSupportsSelection()
406  { return false; }
407 
409 
412  vtkGetMacro(NumberOfConsumers,int);
414 
416 
419  void AddConsumer(vtkObject *c);
420  void RemoveConsumer(vtkObject *c);
421  vtkObject *GetConsumer(int i);
422  int IsConsumer(vtkObject *c);
424 
425 protected:
426  vtkProp();
427  ~vtkProp() VTK_OVERRIDE;
428 
429  int Visibility;
430  int Pickable;
431  int Dragable;
432  bool UseBounds;
433 
434  double AllocatedRenderTime;
435  double EstimatedRenderTime;
436  double SavedEstimatedRenderTime;
437  double RenderTimeMultiplier;
438 
439  // how many consumers does this object have
440  int NumberOfConsumers;
441  vtkObject **Consumers;
442 
443  // support multi-part props and access to paths of prop
444  // stuff that follows is used to build the assembly hierarchy
446 
447  vtkInformation *PropertyKeys;
448 
449 private:
450  vtkProp(const vtkProp&) VTK_DELETE_FUNCTION;
451  void operator=(const vtkProp&) VTK_DELETE_FUNCTION;
452 };
453 
454 #endif
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:323
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:157
abstract base class for most VTK objects
Definition: vtkObject.h:53
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:313
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract specification for Viewports
Definition: vtkViewport.h:44
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:216
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:288
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:222
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:365
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:405
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:311
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:351
an ordered list of Props
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:297
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:124
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:105
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:220
Key for double vector values.
a list of nodes that form an assembly path
a simple class to control print indentation
Definition: vtkIndent.h:33
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:57
a list of lists of props representing an assembly hierarchy
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:388
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:56
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:218
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:334
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
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g., vtkPropPicker).
Definition: vtkProp.h:147
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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:55