VTK
vtkPainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPainter.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 =========================================================================*/
15 
16 /*
17  * Copyright 2004 Sandia Corporation.
18  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
19  * license for use of this work by or on behalf of the
20  * U.S. Government. Redistribution and use in source and binary forms, with
21  * or without modification, are permitted provided that this Notice and any
22  * statement of authorship are reproduced on all copies.
23  */
24 
43 #ifndef vtkPainter_h
44 #define vtkPainter_h
45 
46 #include "vtkRenderingOpenGLModule.h" // For export macro
47 #include "vtkObject.h"
48 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
49 
50 class vtkAbstractArray;
51 class vtkActor;
52 class vtkDataObject;
53 class vtkDataSet;
54 class vtkInformation;
56 class vtkPainterObserver;
57 class vtkRenderer;
58 class vtkTimerLog;
59 class vtkWindow;
60 
61 class VTKRENDERINGOPENGL_EXPORT vtkPainter : public vtkObject
62 {
63 public:
64  vtkTypeMacro(vtkPainter, vtkObject);
65  virtual void PrintSelf(ostream &os, vtkIndent indent);
66 
73  static vtkInformationIntegerKey* STATIC_DATA();
74 
81  static vtkInformationIntegerKey* CONSERVE_MEMORY();
82 
88  static vtkInformationIntegerKey* HIGH_QUALITY();
89 
91 
94  vtkGetObjectMacro(Information, vtkInformation);
95  virtual void SetInformation(vtkInformation*);
97 
99 
102  vtkGetObjectMacro(DelegatePainter, vtkPainter);
103  virtual void SetDelegatePainter(vtkPainter*);
105 
107 
110  void Register(vtkObjectBase *o) VTK_OVERRIDE;
111  void UnRegister(vtkObjectBase *o) VTK_OVERRIDE;
113 
114  enum {
115  VERTS = 0x1,
116  LINES = 0x2,
117  POLYS = 0x4,
118  STRIPS = 0x8
119  };
120 
128  virtual void Render(vtkRenderer* renderer, vtkActor* actor,
129  unsigned long typeflags, bool forceCompileOnly);
130 
137  virtual void ReleaseGraphicsResources(vtkWindow *);
138 
140 
143  vtkSetClampMacro(Progress,double,0.0,1.0);
144  vtkGetMacro(Progress,double);
146 
152  virtual double GetTimeToDraw();
153 
159  virtual void UpdateBounds(double bounds[6]);
160 
162 
166  void SetInput(vtkDataObject*);
167  vtkGetObjectMacro(Input, vtkDataObject);
169 
175  { return this->Input; }
176 
177 protected:
178  vtkPainter();
179  ~vtkPainter();
180 
184  void ReportReferences(vtkGarbageCollector *collector) VTK_OVERRIDE;
185 
194  void UpdateDelegatePainter();
195 
201  virtual void PassInformation(vtkPainter* toPainter);
202 
211 
219  virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
220  unsigned long typeflags, bool forceCompileOnly);
221 
227  virtual void UpdateDelegateProgress(vtkPainter* delegate, double amount);
228 
234 
239  virtual void ObserverPainterProgress(vtkPainter* toObserve);
240 
246  void UpdateProgress(double amount);
247 
249 
252  vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
253  int fieldAttributeType,
254  vtkDataSet* ds,
255  bool *use_cell_data=0);
256  vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
257  const char* name, vtkDataSet* dsl,
258  bool *use_cell_data=0);
260 
261  // Time of most recent call to ProcessInformation().
263  friend class vtkPainterObserver;
264  vtkPainterObserver* Observer;
265 
268 
269  double Progress;
272 
273  double TimeToDraw;
275 
276 
277  vtkWeakPointer<vtkWindow> LastWindow; // Window used for previous render.
278  // This is not reference counted.
279 private:
280  vtkPainter(const vtkPainter &) VTK_DELETE_FUNCTION;
281  void operator=(const vtkPainter &) VTK_DELETE_FUNCTION;
282 
283  vtkDataObject* Input;
284 
285 };
286 
287 #endif //vtkPainter_h
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
abstract base class for most VTK objects
Definition: vtkObject.h:59
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWeakPointer< vtkWindow > LastWindow
Definition: vtkPainter.h:277
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
Abstract superclass for all arrays.
vtkTimerLog * Timer
Definition: vtkPainter.h:274
virtual void ProcessInformation(vtkInformation *)
Called before RenderInternal() if the Information has been changed since the last time this method wa...
Definition: vtkPainter.h:233
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkPainter * DelegatePainter
Definition: vtkPainter.h:267
virtual vtkDataObject * GetOutput()
Get the output data object from this painter.
Definition: vtkPainter.h:174
virtual void PrepareForRendering(vtkRenderer *, vtkActor *)
Some subclasses may need to do some preprocessing before the actual rendering can be done eg...
Definition: vtkPainter.h:210
abstract specification for renderers
Definition: vtkRenderer.h:63
double Progress
Definition: vtkPainter.h:269
Detect and break reference loops.
Timer support and logging.
Definition: vtkTimerLog.h:80
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual void UnRegister(vtkObjectBase *o)
Decrease the reference count (release by another object).
vtkInformation * Information
Definition: vtkPainter.h:266
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ReportReferences(vtkGarbageCollector *)
Key for integer values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:65
double ProgressOffset
Definition: vtkPainter.h:270
Abstract class for drawing poly data.
Definition: vtkPainter.h:61
double ProgressScaleFactor
Definition: vtkPainter.h:271
vtkTimeStamp InformationProcessTime
Definition: vtkPainter.h:262
general representation of visualization data
Definition: vtkDataObject.h:64
vtkPainterObserver * Observer
Definition: vtkPainter.h:264
double TimeToDraw
Definition: vtkPainter.h:273