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 
45 #ifndef vtkPainter_h
46 #define vtkPainter_h
47 
48 #include "vtkRenderingOpenGLModule.h" // For export macro
49 #include "vtkObject.h"
50 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
51 
52 class vtkAbstractArray;
53 class vtkActor;
54 class vtkDataObject;
55 class vtkDataSet;
56 class vtkInformation;
58 class vtkPainterObserver;
59 class vtkRenderer;
60 class vtkTimerLog;
61 class vtkWindow;
62 
64 {
65 public:
66  vtkTypeMacro(vtkPainter, vtkObject);
67  virtual void PrintSelf(ostream &os, vtkIndent indent);
68 
73  static vtkInformationIntegerKey* STATIC_DATA();
74 
79  static vtkInformationIntegerKey* CONSERVE_MEMORY();
80 
84  static vtkInformationIntegerKey* HIGH_QUALITY();
85 
87 
88  vtkGetObjectMacro(Information, vtkInformation);
89  virtual void SetInformation(vtkInformation*);
91 
93 
95  vtkGetObjectMacro(DelegatePainter, vtkPainter);
96  virtual void SetDelegatePainter(vtkPainter*);
98 
100 
101  virtual void Register(vtkObjectBase *o);
102  virtual void UnRegister(vtkObjectBase *o);
104 
105  //BTX
106  enum {
107  VERTS = 0x1,
108  LINES = 0x2,
109  POLYS = 0x4,
110  STRIPS = 0x8
111  };
112  //ETX
113 
115 
120  virtual void Render(vtkRenderer* renderer, vtkActor* actor,
121  unsigned long typeflags, bool forceCompileOnly);
123 
128  virtual void ReleaseGraphicsResources(vtkWindow *);
129 
131 
132  vtkSetClampMacro(Progress,double,0.0,1.0);
133  vtkGetMacro(Progress,double);
135 
139  virtual double GetTimeToDraw();
140 
144  virtual void UpdateBounds(double bounds[6]);
145 
147 
149  void SetInput(vtkDataObject*);
150  vtkGetObjectMacro(Input, vtkDataObject);
152 
154 
157  { return this->Input; }
159 
160 //BTX
161 protected:
162  vtkPainter();
163  ~vtkPainter();
164 
166  virtual void ReportReferences(vtkGarbageCollector *collector);
167 
173  void UpdateDelegatePainter();
174 
178  virtual void PassInformation(vtkPainter* toPainter);
179 
185 
187 
192  virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
193  unsigned long typeflags, bool forceCompileOnly);
195 
198  virtual void UpdateDelegateProgress(vtkPainter* delegate, double amount);
199 
203 
206  virtual void ObserverPainterProgress(vtkPainter* toObserve);
207 
211  void UpdateProgress(double amount);
212 
214 
215  vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
216  int fieldAttributeType,
217  vtkDataSet* ds,
218  bool *use_cell_data=0);
219  vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
220  const char* name, vtkDataSet* dsl,
221  bool *use_cell_data=0);
223 
224  // Time of most recent call to ProcessInformation().
226  friend class vtkPainterObserver;
227  vtkPainterObserver* Observer;
228 
231 
232  double Progress;
235 
236  double TimeToDraw;
238 
239 
240  vtkWeakPointer<vtkWindow> LastWindow; // Window used for previous render.
241  // This is not reference counted.
242 private:
243  vtkPainter(const vtkPainter &); // Not implemented.
244  void operator=(const vtkPainter &); // Not implemented.
245 
246  vtkDataObject* Input;
247 //ETX
248 };
249 
250 #endif //vtkPainter_h
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual void Register(vtkObjectBase *o)
vtkWeakPointer< vtkWindow > LastWindow
Definition: vtkPainter.h:240
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
Abstract superclass for all arrays.
vtkTimerLog * Timer
Definition: vtkPainter.h:237
virtual void ProcessInformation(vtkInformation *)
Definition: vtkPainter.h:202
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkPainter * DelegatePainter
Definition: vtkPainter.h:230
virtual vtkDataObject * GetOutput()
Definition: vtkPainter.h:156
virtual void PrepareForRendering(vtkRenderer *, vtkActor *)
Definition: vtkPainter.h:184
abstract specification for renderers
Definition: vtkRenderer.h:63
double Progress
Definition: vtkPainter.h:232
Detect and break reference loops.
Timer support and logging.
Definition: vtkTimerLog.h:81
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void UnRegister(vtkObjectBase *o)
vtkInformation * Information
Definition: vtkPainter.h:229
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ReportReferences(vtkGarbageCollector *)
#define VTKRENDERINGOPENGL_EXPORT
Key for integer values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:59
double ProgressOffset
Definition: vtkPainter.h:233
Abstract class for drawing poly data.
Definition: vtkPainter.h:63
double ProgressScaleFactor
Definition: vtkPainter.h:234
vtkTimeStamp InformationProcessTime
Definition: vtkPainter.h:225
general representation of visualization data
Definition: vtkDataObject.h:64
vtkPainterObserver * Observer
Definition: vtkPainter.h:227
double TimeToDraw
Definition: vtkPainter.h:236