VTK  9.3.0
vtkProp.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
34 #ifndef vtkProp_h
35 #define vtkProp_h
36 
37 #include "vtkObject.h"
38 #include "vtkRenderingCoreModule.h" // For export macro
39 #include <vector> // for method args
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkAssemblyPath;
43 class vtkAssemblyPaths;
45 class vtkMatrix4x4;
46 class vtkPropCollection;
47 class vtkViewport;
48 class vtkWindow;
49 class vtkInformation;
52 class vtkShaderProperty;
53 
54 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
55 {
56 public:
57  vtkTypeMacro(vtkProp, vtkObject);
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
65  virtual void GetActors(vtkPropCollection*) {}
66  virtual void GetActors2D(vtkPropCollection*) {}
67  virtual void GetVolumes(vtkPropCollection*) {}
68 
70 
73  vtkSetMacro(Visibility, vtkTypeBool);
74  vtkGetMacro(Visibility, vtkTypeBool);
75  vtkBooleanMacro(Visibility, vtkTypeBool);
77 
79 
84  vtkSetMacro(Pickable, vtkTypeBool);
85  vtkGetMacro(Pickable, vtkTypeBool);
86  vtkBooleanMacro(Pickable, vtkTypeBool);
88 
92  virtual void Pick();
93 
95 
104  vtkSetMacro(Dragable, vtkTypeBool);
105  vtkGetMacro(Dragable, vtkTypeBool);
106  vtkBooleanMacro(Dragable, vtkTypeBool);
108 
115  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
116 
118 
124  vtkSetMacro(UseBounds, bool);
125  vtkGetMacro(UseBounds, bool);
126  vtkBooleanMacro(UseBounds, bool);
128 
133  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
134 
138  virtual void ShallowCopy(vtkProp* prop);
139 
141 
153  virtual void InitPathTraversal();
155  virtual int GetNumberOfPaths() { return 1; }
157 
163  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
164  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
165 
167 
174  vtkGetObjectMacro(PropertyKeys, vtkInformation);
175  virtual void SetPropertyKeys(vtkInformation* keys);
177 
182  virtual bool HasKeys(vtkInformation* requiredKeys);
183 
194 
205 
222  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
224  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
225  virtual int RenderOverlay(vtkViewport*) { return 0; }
226 
236  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
237 
249  vtkViewport* v, vtkInformation* requiredKeys);
250 
262 
273  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
274 
287 
299  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
300 
308 
321  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
322  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
323 
331  virtual void SetEstimatedRenderTime(double t)
332  {
333  this->EstimatedRenderTime = t;
334  this->SavedEstimatedRenderTime = t;
335  }
336 
346  {
347  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
348  }
349 
363  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
364  {
365  this->EstimatedRenderTime += t;
366  }
367 
369 
379  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
380  {
381  this->AllocatedRenderTime = t;
382  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
383  this->EstimatedRenderTime = 0.0;
384  }
386 
388 
392  vtkGetMacro(AllocatedRenderTime, double);
394 
402  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
403  vtkGetMacro(RenderTimeMultiplier, double);
404 
410  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
411 
418  virtual bool GetSupportsSelection() { return false; }
419 
425  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
426  {
427  }
428 
430 
433  vtkGetMacro(NumberOfConsumers, int);
435 
437 
445 
447 
450  virtual void SetShaderProperty(vtkShaderProperty* property);
453 
455  // Get if we are in the translucent polygonal geometry pass
456  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
458 
459 protected:
461  ~vtkProp() override;
462 
466  bool UseBounds;
467 
472 
473  // how many consumers does this object have
476 
477  // support multi-part props and access to paths of prop
478  // stuff that follows is used to build the assembly hierarchy
480 
482 
483  // User-defined shader replacement and uniform variables
485 
486 private:
487  vtkProp(const vtkProp&) = delete;
488  void operator=(const vtkProp&) = delete;
489 };
490 
491 VTK_ABI_NAMESPACE_END
492 #endif
a list of nodes that form an assembly path
a list of lists of props representing an assembly hierarchy
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for integer values in vtkInformation.
Store vtkAlgorithm input/output information.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual vtkMTimeType GetMTime()
Return this object's modified time.
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
virtual vtkShaderProperty * GetShaderProperty()
Set/Get the shader property.
vtkObject * GetConsumer(int i)
Add or remove or get or check a consumer,.
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:163
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:424
virtual vtkTypeBool HasOpaqueGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:299
virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual bool RenderFilteredTranslucentPolygonalGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the translucent polygonal geometry only if the prop has all the requiredKeys.
static vtkInformationIntegerKey * GeneralTextureUnit()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:322
virtual bool RenderFilteredOverlay(vtkViewport *v, vtkInformation *requiredKeys)
Render in the overlay of the viewport only if the prop has all the requiredKeys.
vtkObject ** Consumers
Definition: vtkProp.h:475
virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the volumetric geometry only if the prop has all the requiredKeys.
~vtkProp() override
vtkAssemblyPaths * Paths
Definition: vtkProp.h:479
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:402
virtual vtkAssemblyPath * GetNextPath()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition: vtkProp.h:155
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
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
virtual void Pick()
Method fires PickEvent if the prop is picked.
vtkInformation * PropertyKeys
Definition: vtkProp.h:481
bool UseBounds
Definition: vtkProp.h:466
vtkTypeBool Pickable
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:363
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:418
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:164
int NumberOfConsumers
Definition: vtkProp.h:474
void RemoveConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:133
double SavedEstimatedRenderTime
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:286
vtkTypeBool Dragable
Definition: vtkProp.h:465
virtual void InitPathTraversal()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
int IsConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
double EstimatedRenderTime
Definition: vtkProp.h:469
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:224
void AddConsumer(vtkObject *c)
Add or remove or get or check a consumer,.
static vtkInformationDoubleVectorKey * GeneralTextureTransform()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:223
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:379
virtual void SetPropertyKeys(vtkInformation *keys)
Set/Get property keys.
virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v, vtkInformation *requiredKeys)
Render the opaque geometry only if the prop has all the requiredKeys.
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:65
vtkTypeBool Visibility
Definition: vtkProp.h:463
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:225
virtual bool HasKeys(vtkInformation *requiredKeys)
Tells if the prop has all the required keys.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:67
double RenderTimeMultiplier
Definition: vtkProp.h:471
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:484
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:115
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:321
double AllocatedRenderTime
Definition: vtkProp.h:468
virtual void SetShaderProperty(vtkShaderProperty *property)
Set/Get the shader property.
virtual void ShallowCopy(vtkProp *prop)
Shallow copy of this vtkProp.
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:307
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:345
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:66
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:456
represent GPU shader properties
abstract specification for Viewports
Definition: vtkViewport.h:54
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
int vtkTypeBool
Definition: vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_SIZEHINT(...)