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 =========================================================================*/
31 #ifndef vtkProp_h
32 #define vtkProp_h
33 
34 #include "vtkRenderingCoreModule.h" // For export macro
35 #include "vtkObject.h"
36 #include <vector> // for method args
37 
38 class vtkAssemblyPath;
39 class vtkAssemblyPaths;
41 class vtkMatrix4x4;
42 class vtkPropCollection;
43 class vtkViewport;
44 class vtkWindow;
45 class vtkInformation;
48 class vtkShaderProperty;
49 
50 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
51 {
52 public:
53  vtkTypeMacro(vtkProp, vtkObject);
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
61  virtual void GetActors(vtkPropCollection *) {}
62  virtual void GetActors2D(vtkPropCollection *) {}
63  virtual void GetVolumes(vtkPropCollection *) {}
64 
66 
69  vtkSetMacro(Visibility, vtkTypeBool);
70  vtkGetMacro(Visibility, vtkTypeBool);
71  vtkBooleanMacro(Visibility, vtkTypeBool);
73 
75 
80  vtkSetMacro(Pickable, vtkTypeBool);
81  vtkGetMacro(Pickable, vtkTypeBool);
82  vtkBooleanMacro(Pickable, vtkTypeBool);
84 
88  virtual void Pick();
89 
91 
100  vtkSetMacro(Dragable, vtkTypeBool);
101  vtkGetMacro(Dragable, vtkTypeBool);
102  vtkBooleanMacro(Dragable, vtkTypeBool);
104 
112  { return this->GetMTime(); }
113 
115 
121  vtkSetMacro(UseBounds, bool);
122  vtkGetMacro(UseBounds, bool);
123  vtkBooleanMacro(UseBounds, bool);
125 
130  virtual double *GetBounds() VTK_SIZEHINT(6)
131  { return nullptr; }
132 
136  virtual void ShallowCopy(vtkProp *prop);
137 
139 
151  virtual void InitPathTraversal();
152  virtual vtkAssemblyPath *GetNextPath();
153  virtual int GetNumberOfPaths()
154  { return 1; }
156 
162  virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
164  { return nullptr; }
165 
167 
174  vtkGetObjectMacro(PropertyKeys,vtkInformation);
175  virtual void SetPropertyKeys(vtkInformation *keys);
177 
182  virtual bool HasKeys(vtkInformation *requiredKeys);
183 
193  static vtkInformationIntegerKey *GeneralTextureUnit();
194 
204  static vtkInformationDoubleVectorKey *GeneralTextureTransform();
205 
223  { return 0; }
225  { return 0; }
227  { return 0; }
228  virtual int RenderOverlay(vtkViewport *)
229  { return 0; }
230 
240  virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
241  vtkInformation *requiredKeys);
242 
253  virtual bool RenderFilteredTranslucentPolygonalGeometry(
254  vtkViewport *v,
255  vtkInformation *requiredKeys);
256 
267  virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
268  vtkInformation *requiredKeys);
269 
280  virtual bool RenderFilteredOverlay(vtkViewport *v,
281  vtkInformation *requiredKeys);
282 
295  { return 0; }
296 
304 
318  { return this->EstimatedRenderTime; }
319  virtual double GetEstimatedRenderTime()
320  { return this->EstimatedRenderTime; }
321 
329  virtual void SetEstimatedRenderTime(double t)
330  { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
331 
341  { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
342 
343 
357  virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
358  { this->EstimatedRenderTime += t; }
359 
361 
371  virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
372  {
373  this->AllocatedRenderTime = t;
374  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
375  this->EstimatedRenderTime = 0.0;
376  }
378 
380 
384  vtkGetMacro(AllocatedRenderTime, double);
386 
394  void SetRenderTimeMultiplier( double t )
395  { this->RenderTimeMultiplier = t; }
396  vtkGetMacro(RenderTimeMultiplier, double);
397 
403  virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
404 
411  virtual bool GetSupportsSelection()
412  { return false; }
413 
419  vtkHardwareSelector * /* sel */,
420  std::vector<unsigned int> & /* pixeloffsets */) { };
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 
447 protected:
448  vtkProp();
449  ~vtkProp() override;
450 
454  bool UseBounds;
455 
460 
461  // how many consumers does this object have
464 
465  // support multi-part props and access to paths of prop
466  // stuff that follows is used to build the assembly hierarchy
468 
470 
471  // User-defined shader replacement and uniform variables
473 
474 private:
475  vtkProp(const vtkProp&) = delete;
476  void operator=(const vtkProp&) = delete;
477 };
478 
479 #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:329
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:163
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:319
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool Pickable
Definition: vtkProp.h:452
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
double EstimatedRenderTime
Definition: vtkProp.h:457
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:222
int NumberOfConsumers
Definition: vtkProp.h:462
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:294
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:228
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:371
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:411
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:317
double AllocatedRenderTime
Definition: vtkProp.h:456
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:357
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:303
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:130
double SavedEstimatedRenderTime
Definition: vtkProp.h:458
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:111
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:226
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:418
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object&#39;s modified time.
represent GPU shader properties
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:63
a list of lists of props representing an assembly hierarchy
vtkAssemblyPaths * Paths
Definition: vtkProp.h:467
#define VTK_SIZEHINT(...)
vtkObject ** Consumers
Definition: vtkProp.h:463
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:394
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:472
vtkTypeBool Visibility
Definition: vtkProp.h:451
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:62
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:224
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:340
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:162
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g., vtkPropPicker).
Definition: vtkProp.h:153
double RenderTimeMultiplier
Definition: vtkProp.h:459
vtkTypeBool Dragable
Definition: vtkProp.h:453
vtkInformation * PropertyKeys
Definition: vtkProp.h:469
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:61
bool UseBounds
Definition: vtkProp.h:454