VTK  9.3.1
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
25 #ifndef vtkProp_h
26 #define vtkProp_h
27 
28 #include "vtkObject.h"
29 #include "vtkRenderingCoreModule.h" // For export macro
30 #include <vector> // for method args
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkAssemblyPath;
34 class vtkAssemblyPaths;
36 class vtkMatrix4x4;
37 class vtkPropCollection;
38 class vtkViewport;
39 class vtkWindow;
40 class vtkInformation;
43 class vtkShaderProperty;
44 
45 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
46 {
47 public:
48  vtkTypeMacro(vtkProp, vtkObject);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
56  virtual void GetActors(vtkPropCollection*) {}
57  virtual void GetActors2D(vtkPropCollection*) {}
58  virtual void GetVolumes(vtkPropCollection*) {}
59 
61 
64  vtkSetMacro(Visibility, vtkTypeBool);
65  vtkGetMacro(Visibility, vtkTypeBool);
66  vtkBooleanMacro(Visibility, vtkTypeBool);
68 
70 
75  vtkSetMacro(Pickable, vtkTypeBool);
76  vtkGetMacro(Pickable, vtkTypeBool);
77  vtkBooleanMacro(Pickable, vtkTypeBool);
79 
83  virtual void Pick();
84 
86 
95  vtkSetMacro(Dragable, vtkTypeBool);
96  vtkGetMacro(Dragable, vtkTypeBool);
97  vtkBooleanMacro(Dragable, vtkTypeBool);
99 
106  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
107 
109 
115  vtkSetMacro(UseBounds, bool);
116  vtkGetMacro(UseBounds, bool);
117  vtkBooleanMacro(UseBounds, bool);
119 
124  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
125 
129  virtual void ShallowCopy(vtkProp* prop);
130 
132 
144  virtual void InitPathTraversal();
145  virtual vtkAssemblyPath* GetNextPath();
146  virtual int GetNumberOfPaths() { return 1; }
148 
154  virtual void PokeMatrix(vtkMatrix4x4* vtkNotUsed(matrix)) {}
155  virtual vtkMatrix4x4* GetMatrix() { return nullptr; }
156 
158 
165  vtkGetObjectMacro(PropertyKeys, vtkInformation);
166  virtual void SetPropertyKeys(vtkInformation* keys);
168 
173  virtual bool HasKeys(vtkInformation* requiredKeys);
174 
184  static vtkInformationIntegerKey* GeneralTextureUnit();
185 
195  static vtkInformationDoubleVectorKey* GeneralTextureTransform();
196 
213  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
215  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
216  virtual int RenderOverlay(vtkViewport*) { return 0; }
217 
227  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
228 
239  virtual bool RenderFilteredTranslucentPolygonalGeometry(
240  vtkViewport* v, vtkInformation* requiredKeys);
241 
252  virtual bool RenderFilteredVolumetricGeometry(vtkViewport* v, vtkInformation* requiredKeys);
253 
264  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
265 
278 
290  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
291 
299 
312  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
313  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
314 
322  virtual void SetEstimatedRenderTime(double t)
323  {
324  this->EstimatedRenderTime = t;
325  this->SavedEstimatedRenderTime = t;
326  }
327 
337  {
338  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
339  }
340 
354  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
355  {
356  this->EstimatedRenderTime += t;
357  }
358 
360 
370  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
371  {
372  this->AllocatedRenderTime = t;
373  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
374  this->EstimatedRenderTime = 0.0;
375  }
377 
379 
383  vtkGetMacro(AllocatedRenderTime, double);
385 
393  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
394  vtkGetMacro(RenderTimeMultiplier, double);
395 
401  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
402 
409  virtual bool GetSupportsSelection() { return false; }
410 
416  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
417  {
418  }
419 
421 
424  vtkGetMacro(NumberOfConsumers, int);
426 
428 
431  void AddConsumer(vtkObject* c);
432  void RemoveConsumer(vtkObject* c);
433  vtkObject* GetConsumer(int i);
434  int IsConsumer(vtkObject* c);
436 
438 
441  virtual void SetShaderProperty(vtkShaderProperty* property);
442  virtual vtkShaderProperty* GetShaderProperty();
444 
446  // Get if we are in the translucent polygonal geometry pass
447  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
449 
450 protected:
451  vtkProp();
452  ~vtkProp() override;
453 
457  bool UseBounds;
458 
463 
464  // how many consumers does this object have
467 
468  // support multi-part props and access to paths of prop
469  // stuff that follows is used to build the assembly hierarchy
471 
473 
474  // User-defined shader replacement and uniform variables
476 
477 private:
478  vtkProp(const vtkProp&) = delete;
479  void operator=(const vtkProp&) = delete;
480 };
481 
482 VTK_ABI_NAMESPACE_END
483 #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:322
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:155
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
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.
vtkTypeBool Pickable
Definition: vtkProp.h:455
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
double EstimatedRenderTime
Definition: vtkProp.h:460
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:213
int NumberOfConsumers
Definition: vtkProp.h:465
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:277
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:216
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:370
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:409
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:312
double AllocatedRenderTime
Definition: vtkProp.h:459
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:354
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkProp.h:298
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:124
double SavedEstimatedRenderTime
Definition: vtkProp.h:461
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:106
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:215
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:290
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ProcessSelectorPixelBuffers(vtkHardwareSelector *, std::vector< unsigned int > &)
allows a prop to update a selections color buffers
Definition: vtkProp.h:415
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:447
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
represent GPU shader properties
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:58
a list of lists of props representing an assembly hierarchy
vtkAssemblyPaths * Paths
Definition: vtkProp.h:470
#define VTK_SIZEHINT(...)
vtkObject ** Consumers
Definition: vtkProp.h:466
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:393
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:475
vtkTypeBool Visibility
Definition: vtkProp.h:454
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:57
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:214
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:336
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:154
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g., vtkPropPicker).
Definition: vtkProp.h:146
double RenderTimeMultiplier
Definition: vtkProp.h:462
vtkTypeBool Dragable
Definition: vtkProp.h:456
vtkInformation * PropertyKeys
Definition: vtkProp.h:472
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:56
bool UseBounds
Definition: vtkProp.h:457