00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00045 #ifndef __vtkPainter_h
00046 #define __vtkPainter_h
00047
00048 #include "vtkObject.h"
00049 #include "vtkWeakPointer.h"
00050
00051 class vtkActor;
00052 class vtkDataObject;
00053 class vtkInformation;
00054 class vtkInformationIntegerKey;
00055 class vtkPainterObserver;
00056 class vtkRenderer;
00057 class vtkTimerLog;
00058 class vtkWindow;
00059
00060 class VTK_RENDERING_EXPORT vtkPainter : public vtkObject
00061 {
00062 public:
00063 vtkTypeRevisionMacro(vtkPainter, vtkObject);
00064 virtual void PrintSelf(ostream &os, vtkIndent indent);
00065
00070 static vtkInformationIntegerKey* STATIC_DATA();
00071
00076 static vtkInformationIntegerKey* CONSERVE_MEMORY();
00077
00081 static vtkInformationIntegerKey* HIGH_QUALITY();
00082
00084
00085 vtkGetObjectMacro(Information, vtkInformation);
00086 virtual void SetInformation(vtkInformation*);
00088
00090
00092 vtkGetObjectMacro(DelegatePainter, vtkPainter);
00093 virtual void SetDelegatePainter(vtkPainter*);
00095
00097
00098 virtual void Register(vtkObjectBase *o);
00099 virtual void UnRegister(vtkObjectBase *o);
00101
00102
00103 enum {
00104 VERTS = 0x1,
00105 LINES = 0x2,
00106 POLYS = 0x4,
00107 STRIPS = 0x8
00108 };
00109
00110
00112
00116 virtual void Render(vtkRenderer* renderer, vtkActor* actor,
00117 unsigned long typeflags);
00119
00124 virtual void ReleaseGraphicsResources(vtkWindow *);
00125
00127
00128 vtkSetClampMacro(Progress,double,0.0,1.0);
00129 vtkGetMacro(Progress,double);
00131
00135 virtual double GetTimeToDraw();
00136
00140 virtual void UpdateBounds(double bounds[6]);
00141
00143
00145 void SetInput(vtkDataObject*);
00146 vtkGetObjectMacro(Input, vtkDataObject);
00148
00150
00152 virtual vtkDataObject* GetOutput()
00153 { return this->Input; }
00155
00156
00157 protected:
00158 vtkPainter();
00159 ~vtkPainter();
00160
00162 virtual void ReportReferences(vtkGarbageCollector *collector);
00163
00169 void UpdateDelegatePainter();
00170
00174 virtual void PassInformation(vtkPainter* toPainter);
00175
00180 virtual void PrepareForRendering(vtkRenderer*, vtkActor*) { }
00181
00183
00188 virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
00189 unsigned long typeflags);
00191
00194 virtual void UpdateDelegateProgress(vtkPainter* delegate, double amount);
00195
00198 virtual void ProcessInformation(vtkInformation*) { }
00199
00202 virtual void ObserverPainterProgress(vtkPainter* toObserve);
00203
00207 void UpdateProgress(double amount);
00208
00209
00210 vtkTimeStamp InformationProcessTime;
00211 friend class vtkPainterObserver;
00212 vtkPainterObserver* Observer;
00213
00214 vtkInformation* Information;
00215 vtkPainter* DelegatePainter;
00216
00217 double Progress;
00218 double ProgressOffset;
00219 double ProgressScaleFactor;
00220
00221 double TimeToDraw;
00222 vtkTimerLog* Timer;
00223
00224 vtkWeakPointer<vtkWindow> LastWindow;
00225
00226 private:
00227 vtkPainter(const vtkPainter &);
00228 void operator=(const vtkPainter &);
00229
00230 vtkDataObject* Input;
00231
00232 };
00233
00234 #endif //__vtkPainter_h