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 "vtkObject.h"
49 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
50 
51 class vtkAbstractArray;
52 class vtkActor;
53 class vtkDataObject;
54 class vtkDataSet;
55 class vtkInformation;
57 class vtkPainterObserver;
58 class vtkRenderer;
59 class vtkTimerLog;
60 class vtkWindow;
61 
63 {
64 public:
65  vtkTypeMacro(vtkPainter, vtkObject);
66  virtual void PrintSelf(ostream &os, vtkIndent indent);
67 
72  static vtkInformationIntegerKey* STATIC_DATA();
73 
78  static vtkInformationIntegerKey* CONSERVE_MEMORY();
79 
83  static vtkInformationIntegerKey* HIGH_QUALITY();
84 
86 
87  vtkGetObjectMacro(Information, vtkInformation);
88  virtual void SetInformation(vtkInformation*);
90 
92 
94  vtkGetObjectMacro(DelegatePainter, vtkPainter);
95  virtual void SetDelegatePainter(vtkPainter*);
97 
99 
100  virtual void Register(vtkObjectBase *o);
101  virtual void UnRegister(vtkObjectBase *o);
103 
104  //BTX
105  enum {
106  VERTS = 0x1,
107  LINES = 0x2,
108  POLYS = 0x4,
109  STRIPS = 0x8
110  };
111  //ETX
112 
114 
119  virtual void Render(vtkRenderer* renderer, vtkActor* actor,
120  unsigned long typeflags, bool forceCompileOnly);
122 
127  virtual void ReleaseGraphicsResources(vtkWindow *);
128 
130 
131  vtkSetClampMacro(Progress,double,0.0,1.0);
132  vtkGetMacro(Progress,double);
134 
138  virtual double GetTimeToDraw();
139 
143  virtual void UpdateBounds(double bounds[6]);
144 
146 
148  void SetInput(vtkDataObject*);
149  vtkGetObjectMacro(Input, vtkDataObject);
151 
153 
155  virtual vtkDataObject* GetOutput()
156  { return this->Input; }
158 
159 //BTX
160 protected:
161  vtkPainter();
162  ~vtkPainter();
163 
165  virtual void ReportReferences(vtkGarbageCollector *collector);
166 
172  void UpdateDelegatePainter();
173 
177  virtual void PassInformation(vtkPainter* toPainter);
178 
184 
186 
191  virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
192  unsigned long typeflags, bool forceCompileOnly);
194 
197  virtual void UpdateDelegateProgress(vtkPainter* delegate, double amount);
198 
202 
205  virtual void ObserverPainterProgress(vtkPainter* toObserve);
206 
210  void UpdateProgress(double amount);
211 
213 
214  vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
215  int fieldAttributeType,
216  vtkDataSet* ds,
217  bool *use_cell_data=0);
218  vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
219  const char* name, vtkDataSet* dsl,
220  bool *use_cell_data=0);
222 
223  // Time of most recent call to ProcessInformation().
225  friend class vtkPainterObserver;
226  vtkPainterObserver* Observer;
227 
230 
231  double Progress;
234 
235  double TimeToDraw;
237 
238  vtkWeakPointer<vtkWindow> LastWindow; // Window used for previous render.
239  // This is not reference counted.
240 private:
241  vtkPainter(const vtkPainter &); // Not implemented.
242  void operator=(const vtkPainter &); // Not implemented.
243 
244  vtkDataObject* Input;
245 //ETX
246 };
247 
248 #endif //__vtkPainter_h