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 =========================================================================*/
28 #ifndef vtkProp_h
29 #define vtkProp_h
30 
31 #include "vtkRenderingCoreModule.h" // For export macro
32 #include "vtkObject.h"
33 #include <vector> // for method args
34 
35 class vtkAssemblyPath;
36 class vtkAssemblyPaths;
38 class vtkMatrix4x4;
39 class vtkPropCollection;
40 class vtkViewport;
41 class vtkWindow;
42 class vtkInformation;
45 
46 class VTKRENDERINGCORE_EXPORT vtkProp : public vtkObject
47 {
48 public:
49  vtkTypeMacro(vtkProp, vtkObject);
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
57  virtual void GetActors(vtkPropCollection *) {}
58  virtual void GetActors2D(vtkPropCollection *) {}
59  virtual void GetVolumes(vtkPropCollection *) {}
60 
62 
65  vtkSetMacro(Visibility, vtkTypeBool);
66  vtkGetMacro(Visibility, vtkTypeBool);
67  vtkBooleanMacro(Visibility, vtkTypeBool);
69 
71 
76  vtkSetMacro(Pickable, vtkTypeBool);
77  vtkGetMacro(Pickable, vtkTypeBool);
78  vtkBooleanMacro(Pickable, vtkTypeBool);
80 
84  virtual void Pick();
85 
87 
96  vtkSetMacro(Dragable, vtkTypeBool);
97  vtkGetMacro(Dragable, vtkTypeBool);
98  vtkBooleanMacro(Dragable, vtkTypeBool);
100 
108  { return this->GetMTime(); }
109 
111 
117  vtkSetMacro(UseBounds, bool);
118  vtkGetMacro(UseBounds, bool);
119  vtkBooleanMacro(UseBounds, bool);
121 
126  virtual double *GetBounds() VTK_SIZEHINT(6)
127  { return nullptr; }
128 
132  virtual void ShallowCopy(vtkProp *prop);
133 
135 
147  virtual void InitPathTraversal();
148  virtual vtkAssemblyPath *GetNextPath();
149  virtual int GetNumberOfPaths()
150  { return 1; }
152 
158  virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
160  { 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 
219  { return 0; }
221  { return 0; }
223  { return 0; }
224  virtual int RenderOverlay(vtkViewport *)
225  { return 0; }
226 
236  virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v,
237  vtkInformation *requiredKeys);
238 
249  virtual bool RenderFilteredTranslucentPolygonalGeometry(
250  vtkViewport *v,
251  vtkInformation *requiredKeys);
252 
263  virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v,
264  vtkInformation *requiredKeys);
265 
276  virtual bool RenderFilteredOverlay(vtkViewport *v,
277  vtkInformation *requiredKeys);
278 
291  { return 0; }
292 
300 
314  { return this->EstimatedRenderTime; }
315  virtual double GetEstimatedRenderTime()
316  { return this->EstimatedRenderTime; }
317 
325  virtual void SetEstimatedRenderTime(double t)
326  { this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t; }
327 
337  { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
338 
339 
353  virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp))
354  { this->EstimatedRenderTime += t; }
355 
357 
367  virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v))
368  {
369  this->AllocatedRenderTime = t;
370  this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
371  this->EstimatedRenderTime = 0.0;
372  }
374 
376 
380  vtkGetMacro(AllocatedRenderTime, double);
382 
390  void SetRenderTimeMultiplier( double t )
391  { this->RenderTimeMultiplier = t; }
392  vtkGetMacro(RenderTimeMultiplier, double);
393 
399  virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
400 
407  virtual bool GetSupportsSelection()
408  { return false; }
409 
415  vtkHardwareSelector * /* sel */,
416  std::vector<unsigned int> & /* pixeloffsets */) { };
417 
419 
422  vtkGetMacro(NumberOfConsumers,int);
424 
426 
429  void AddConsumer(vtkObject *c);
430  void RemoveConsumer(vtkObject *c);
431  vtkObject *GetConsumer(int i);
432  int IsConsumer(vtkObject *c);
434 
435 protected:
436  vtkProp();
437  ~vtkProp() override;
438 
442  bool UseBounds;
443 
448 
449  // how many consumers does this object have
452 
453  // support multi-part props and access to paths of prop
454  // stuff that follows is used to build the assembly hierarchy
456 
458 
459 private:
460  vtkProp(const vtkProp&) = delete;
461  void operator=(const vtkProp&) = delete;
462 };
463 
464 #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:325
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:46
virtual vtkMatrix4x4 * GetMatrix()
Definition: vtkProp.h:159
abstract base class for most VTK objects
Definition: vtkObject.h:53
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
virtual double GetEstimatedRenderTime()
Definition: vtkProp.h:315
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool Pickable
Definition: vtkProp.h:440
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
double EstimatedRenderTime
Definition: vtkProp.h:445
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
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:290
int NumberOfConsumers
Definition: vtkProp.h:450
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:224
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:367
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:407
virtual double GetEstimatedRenderTime(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkProp.h:313
double AllocatedRenderTime
Definition: vtkProp.h:444
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:353
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:299
virtual double * GetBounds()
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkProp.h:126
double SavedEstimatedRenderTime
Definition: vtkProp.h:446
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:107
virtual int RenderVolumetricGeometry(vtkViewport *)
Definition: vtkProp.h:222
a list of nodes that form an assembly path
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:414
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
virtual void GetVolumes(vtkPropCollection *)
Definition: vtkProp.h:59
a list of lists of props representing an assembly hierarchy
vtkAssemblyPaths * Paths
Definition: vtkProp.h:455
#define VTK_SIZEHINT(...)
vtkObject ** Consumers
Definition: vtkProp.h:451
void SetRenderTimeMultiplier(double t)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkProp.h:390
vtkTypeBool Visibility
Definition: vtkProp.h:439
virtual void GetActors2D(vtkPropCollection *)
Definition: vtkProp.h:58
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkProp.h:220
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:158
virtual int GetNumberOfPaths()
vtkProp and its subclasses can be picked by subclasses of vtkAbstractPicker (e.g.,...
Definition: vtkProp.h:149
double RenderTimeMultiplier
Definition: vtkProp.h:447
vtkTypeBool Dragable
Definition: vtkProp.h:441
vtkInformation * PropertyKeys
Definition: vtkProp.h:457
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:57
bool UseBounds
Definition: vtkProp.h:442