VTK  9.7.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 
30 #include "vtkDeprecation.h" // for deprecation macro
31 #include "vtkRenderingCoreModule.h" // For export macro
32 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 
34 #include <vector> // for method args
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkAssemblyPath;
38 class vtkAssemblyPaths;
40 class vtkMatrix4x4;
41 class vtkPropCollection;
42 class vtkViewport;
43 class vtkWindow;
44 class vtkInformation;
47 class vtkShaderProperty;
48 
49 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp : public vtkObject
50 {
51 public:
52  vtkTypeMacro(vtkProp, vtkObject);
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
60  virtual void GetActors(vtkPropCollection*) {}
61  virtual void GetActors2D(vtkPropCollection*) {}
62  virtual void GetVolumes(vtkPropCollection*) {}
63 
65 
68  vtkSetMacro(Visibility, vtkTypeBool);
69  vtkGetMacro(Visibility, vtkTypeBool);
70  vtkBooleanMacro(Visibility, vtkTypeBool);
72 
74 
79  vtkSetMacro(Pickable, vtkTypeBool);
80  vtkGetMacro(Pickable, vtkTypeBool);
81  vtkBooleanMacro(Pickable, vtkTypeBool);
83 
87  virtual void Pick();
88 
90 
99  vtkSetMacro(Dragable, vtkTypeBool);
100  vtkGetMacro(Dragable, vtkTypeBool);
101  vtkBooleanMacro(Dragable, vtkTypeBool);
103 
110  virtual vtkMTimeType GetRedrawMTime() { return this->GetMTime(); }
111 
113 
119  vtkSetMacro(UseBounds, bool);
120  vtkGetMacro(UseBounds, bool);
121  vtkBooleanMacro(UseBounds, bool);
123 
128  virtual double* GetBounds() VTK_SIZEHINT(6) { return nullptr; }
129 
133  virtual void ShallowCopy(vtkProp* prop);
134 
136 
148  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 
175  vtkGetObjectMacro(PropertyKeys, vtkInformation);
176  virtual void SetPropertyKeys(vtkInformation* keys);
178 
183  virtual bool HasKeys(vtkInformation* requiredKeys);
184 
186 
196  VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_UNIT() instead.")
197  static vtkInformationIntegerKey* GeneralTextureUnit() { return vtkProp::GENERAL_TEXTURE_UNIT(); }
198  static vtkInformationIntegerKey* GENERAL_TEXTURE_UNIT();
200 
202 
212  VTK_DEPRECATED_IN_9_6_0("Please use GENERAL_TEXTURE_TRANSFORM() instead.")
213  static vtkInformationDoubleVectorKey* GeneralTextureTransform()
214  {
216  }
217  static vtkInformationDoubleVectorKey* GENERAL_TEXTURE_TRANSFORM();
219 
236  virtual int RenderOpaqueGeometry(vtkViewport*) { return 0; }
238  virtual int RenderVolumetricGeometry(vtkViewport*) { return 0; }
239  virtual int RenderOverlay(vtkViewport*) { return 0; }
240 
250  virtual bool RenderFilteredOpaqueGeometry(vtkViewport* v, vtkInformation* requiredKeys);
251 
262  virtual bool RenderFilteredTranslucentPolygonalGeometry(
263  vtkViewport* v, vtkInformation* requiredKeys);
264 
275  virtual bool RenderFilteredVolumetricGeometry(vtkViewport* v, vtkInformation* requiredKeys);
276 
287  virtual bool RenderFilteredOverlay(vtkViewport* v, vtkInformation* requiredKeys);
288 
301 
313  virtual vtkTypeBool HasOpaqueGeometry() { return 1; }
314 
322 
335  virtual double GetEstimatedRenderTime(vtkViewport*) { return this->EstimatedRenderTime; }
336  virtual double GetEstimatedRenderTime() { return this->EstimatedRenderTime; }
337 
345  virtual void SetEstimatedRenderTime(double t)
346  {
347  this->EstimatedRenderTime = t;
348  this->SavedEstimatedRenderTime = t;
349  }
350 
360  {
361  this->EstimatedRenderTime = this->SavedEstimatedRenderTime;
362  }
363 
377  virtual void AddEstimatedRenderTime(double t, vtkViewport* vtkNotUsed(vp))
378  {
379  this->EstimatedRenderTime += t;
380  }
381 
383 
393  virtual void SetAllocatedRenderTime(double t, vtkViewport* vtkNotUsed(v))
394  {
395  this->AllocatedRenderTime = t;
396  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
397  this->EstimatedRenderTime = 0.0;
398  }
400 
402 
406  vtkGetMacro(AllocatedRenderTime, double);
408 
416  void SetRenderTimeMultiplier(double t) { this->RenderTimeMultiplier = t; }
417  vtkGetMacro(RenderTimeMultiplier, double);
418 
424  virtual void BuildPaths(vtkAssemblyPaths* paths, vtkAssemblyPath* path);
425 
432  virtual bool GetSupportsSelection() { return false; }
433 
439  vtkHardwareSelector* /* sel */, std::vector<unsigned int>& /* pixeloffsets */)
440  {
441  }
442 
444 
447  vtkGetMacro(NumberOfConsumers, int);
449 
451 
454  void AddConsumer(vtkObject* c);
455  void RemoveConsumer(vtkObject* c);
456  vtkObject* GetConsumer(int i);
457  int IsConsumer(vtkObject* c);
459 
461 
464  virtual void SetShaderProperty(vtkShaderProperty* property);
465  virtual vtkShaderProperty* GetShaderProperty();
467 
469  // Get if we are in the translucent polygonal geometry pass
470  virtual bool IsRenderingTranslucentPolygonalGeometry() { return false; }
472 
473 protected:
474  vtkProp();
475  ~vtkProp() override;
476 
480  bool UseBounds;
481 
486 
487  // how many consumers does this object have
490 
491  // support multi-part props and access to paths of prop
492  // stuff that follows is used to build the assembly hierarchy
494 
496 
497  // User-defined shader replacement and uniform variables
499 
500 private:
501  vtkProp(const vtkProp&) = delete;
502  void operator=(const vtkProp&) = delete;
503 };
504 
505 VTK_ABI_NAMESPACE_END
506 #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:345
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:160
static vtkInformationDoubleVectorKey * GENERAL_TEXTURE_TRANSFORM()
Optional Key Indicating the texture transform for general texture mapping Old OpenGL was a state mach...
abstract base class for most VTK objects
Definition: vtkObject.h:52
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:31
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:336
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool Pickable
Definition: vtkProp.h:478
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
double EstimatedRenderTime
Definition: vtkProp.h:483
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:236
int NumberOfConsumers
Definition: vtkProp.h:488
virtual vtkTypeBool HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:300
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:239
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:432
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:335
double AllocatedRenderTime
Definition: vtkProp.h:482
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:321
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:128
double SavedEstimatedRenderTime
Definition: vtkProp.h:484
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
virtual vtkMTimeType GetRedrawMTime()
Return the mtime of anything that would cause the rendered image to appear differently.
Definition: vtkProp.h:110
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:238
#define VTK_DEPRECATED_IN_9_6_0(reason)
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:313
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:438
virtual bool IsRenderingTranslucentPolygonalGeometry()
Definition: vtkProp.h:470
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:62
a list of lists of props representing an assembly hierarchy
vtkAssemblyPaths * Paths
Definition: vtkProp.h:493
#define VTK_SIZEHINT(...)
vtkObject ** Consumers
Definition: vtkProp.h:489
#define VTK_MARSHALEXCLUDE(reason)
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:416
vtkShaderProperty * ShaderProperty
Definition: vtkProp.h:498
vtkTypeBool Visibility
Definition: vtkProp.h:477
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:61
virtual void PokeMatrix(vtkMatrix4x4 *matrix)
These methods are used by subclasses to place a matrix (if any) in the prop prior to rendering...
Definition: vtkProp.h:159
virtual void SetAllocatedRenderTime(double t, vtkViewport *v)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:393
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:237
virtual void RestoreEstimatedRenderTime()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:359
double RenderTimeMultiplier
Definition: vtkProp.h:485
#define VTK_MARSHALAUTO
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
virtual void AddEstimatedRenderTime(double t, vtkViewport *vp)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:377
vtkTypeBool Dragable
Definition: vtkProp.h:479
vtkInformation * PropertyKeys
Definition: vtkProp.h:495
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:60
static vtkInformationIntegerKey * GENERAL_TEXTURE_UNIT()
Optional Key Indicating the texture unit for general texture mapping Old OpenGL was a state machine w...
bool UseBounds
Definition: vtkProp.h:480