VTK  9.0.1
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 "vtkObject.h"
35 #include "vtkRenderingCoreModule.h" // For export macro
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 
111  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
112 
114 
120  vtkSetMacro(UseBounds, bool);
121  vtkGetMacro(UseBounds, bool);
122  vtkBooleanMacro(UseBounds, bool);
124 
129  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
130 
134  virtual void ShallowCopy(vtkProp* prop);
135 
137 
149  virtual void InitPathTraversal();
150  virtual vtkAssemblyPath* GetNextPath();
151  virtual int GetNumberOfPaths() { return 1; }
153 
159  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
160  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
161 
163 
170  vtkGetObjectMacro(PropertyKeys, vtkInformation);
171  virtual void SetPropertyKeys(vtkInformation* keys);
173 
178  virtual bool HasKeys(vtkInformation* requiredKeys);
179 
189  static vtkInformationIntegerKey* GeneralTextureUnit();
190 
200  static vtkInformationDoubleVectorKey* GeneralTextureTransform();
201 
218  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
220  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
221  virtual int RenderOverlay(vtkViewport*) { return 0; }
222 
232  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
233 
244  virtual bool RenderFilteredTranslucentPolygonalGeometry(
245  vtkViewport* v, vtkInformation* requiredKeys);
246 
257  virtual bool RenderFilteredVolumetricGeometry(vtkViewport* v, vtkInformation* requiredKeys);
258 
269  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
270 
283 
295  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
296 
304 
317  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
318  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
319 
327  virtual void SetEstimatedRenderTime(double t)
328  {
329  this->EstimatedRenderTime = t;
330  this->SavedEstimatedRenderTime = t;
331  }
332 
342  {
343  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
344  }
345 
359  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
360  {
361  this->EstimatedRenderTime += t;
362  }
363 
365 
375  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
376  {
377  this->AllocatedRenderTime = t;
378  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
379  this->EstimatedRenderTime = 0.0;
380  }
382 
384 
388  vtkGetMacro(AllocatedRenderTime, double);
390 
398  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
399  vtkGetMacro(RenderTimeMultiplier, double);
400 
406  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
407 
414  virtual bool GetSupportsSelection() { return false; }
415 
421  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
422  {
423  }
424 
426 
429  vtkGetMacro(NumberOfConsumers, int);
431 
433 
436  void AddConsumer(vtkObject* c);
437  void RemoveConsumer(vtkObject* c);
438  vtkObject* GetConsumer(int i);
439  int IsConsumer(vtkObject* c);
441 
443 
446  virtual void SetShaderProperty(vtkShaderProperty* property);
447  virtual vtkShaderProperty* GetShaderProperty();
449 
451  // Get if we are in the translucent polygonal geometry pass
452  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
454 
455 protected:
456  vtkProp();
457  ~vtkProp() override;
458 
462  bool UseBounds;
463 
468 
469  // how many consumers does this object have
472 
473  // support multi-part props and access to paths of prop
474  // stuff that follows is used to build the assembly hierarchy
476 
478 
479  // User-defined shader replacement and uniform variables
481 
482 private:
483  vtkProp(const vtkProp&) = delete;
484  void operator=(const vtkProp&) = delete;
485 };
486 
487 #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:327
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:160
abstract base class for most VTK objects
Definition: vtkObject.h:56
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:318
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool Pickable
Definition: vtkProp.h:460
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
double EstimatedRenderTime
Definition: vtkProp.h:465
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:218
int NumberOfConsumers
Definition: vtkProp.h:470
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:282
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:221
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:375
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:414
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:464
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:303
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:129
double SavedEstimatedRenderTime
Definition: vtkProp.h:466
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:111
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:220
Key for double vector values.
a list of nodes that form an assembly path
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:295
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:420
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:452
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:475
#define VTK_SIZEHINT(...)
vtkObject ** Consumers
Definition: vtkProp.h:471
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:398
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:480
vtkTypeBool Visibility
Definition: vtkProp.h:459
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:62
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:219
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:341
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:159
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g., vtkPropPicker).
Definition: vtkProp.h:151
double RenderTimeMultiplier
Definition: vtkProp.h:467
vtkTypeBool Dragable
Definition: vtkProp.h:461
vtkInformation * PropertyKeys
Definition: vtkProp.h:477
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:462