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
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
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:165
abstract base class for most VTK objects
Definition: vtkObject.h:59
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:321
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool Pickable
Definition: vtkProp.h:446
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
double EstimatedRenderTime
Definition: vtkProp.h:451
abstract specification for Viewports
Definition: vtkViewport.h:47
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
int NumberOfConsumers
Definition: vtkProp.h:456
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:296
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:230
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
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:413
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
double AllocatedRenderTime
Definition: vtkProp.h:450
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
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:305
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:132
double SavedEstimatedRenderTime
Definition: vtkProp.h:452
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:113
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:228
Key for double vector values.
a list of nodes that form an assembly path
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:420
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object&#39;s modified time.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:65
a list of lists of props representing an assembly hierarchy
vtkAssemblyPaths * Paths
Definition: vtkProp.h:461
#define VTK_SIZEHINT(...)
vtkObject ** Consumers
Definition: vtkProp.h:457
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
vtkTypeBool Visibility
Definition: vtkProp.h:445
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:64
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:226
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:342
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
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g., vtkPropPicker).
Definition: vtkProp.h:155
double RenderTimeMultiplier
Definition: vtkProp.h:453
vtkTypeBool Dragable
Definition: vtkProp.h:447
vtkInformation * PropertyKeys
Definition: vtkProp.h:463
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
bool UseBounds
Definition: vtkProp.h:448