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 vtkAbstractArray;
00052 class vtkActor;
00053 class vtkDataObject;
00054 class vtkDataSet;
00055 class vtkInformation;
00056 class vtkInformationIntegerKey;
00057 class vtkPainterObserver;
00058 class vtkRenderer;
00059 class vtkTimerLog;
00060 class vtkWindow;
00061
00062 class VTK_RENDERING_EXPORT vtkPainter : public vtkObject
00063 {
00064 public:
00065 vtkTypeMacro(vtkPainter, vtkObject);
00066 virtual void PrintSelf(ostream &os, vtkIndent indent);
00067
00072 static vtkInformationIntegerKey* STATIC_DATA();
00073
00078 static vtkInformationIntegerKey* CONSERVE_MEMORY();
00079
00083 static vtkInformationIntegerKey* HIGH_QUALITY();
00084
00086
00087 vtkGetObjectMacro(Information, vtkInformation);
00088 virtual void SetInformation(vtkInformation*);
00090
00092
00094 vtkGetObjectMacro(DelegatePainter, vtkPainter);
00095 virtual void SetDelegatePainter(vtkPainter*);
00097
00099
00100 virtual void Register(vtkObjectBase *o);
00101 virtual void UnRegister(vtkObjectBase *o);
00103
00104
00105 enum {
00106 VERTS = 0x1,
00107 LINES = 0x2,
00108 POLYS = 0x4,
00109 STRIPS = 0x8
00110 };
00111
00112
00114
00119 virtual void Render(vtkRenderer* renderer, vtkActor* actor,
00120 unsigned long typeflags, bool forceCompileOnly);
00122
00127 virtual void ReleaseGraphicsResources(vtkWindow *);
00128
00130
00131 vtkSetClampMacro(Progress,double,0.0,1.0);
00132 vtkGetMacro(Progress,double);
00134
00138 virtual double GetTimeToDraw();
00139
00143 virtual void UpdateBounds(double bounds[6]);
00144
00146
00148 void SetInput(vtkDataObject*);
00149 vtkGetObjectMacro(Input, vtkDataObject);
00151
00153
00155 virtual vtkDataObject* GetOutput()
00156 { return this->Input; }
00158
00159
00160 protected:
00161 vtkPainter();
00162 ~vtkPainter();
00163
00165 virtual void ReportReferences(vtkGarbageCollector *collector);
00166
00172 void UpdateDelegatePainter();
00173
00177 virtual void PassInformation(vtkPainter* toPainter);
00178
00183 virtual void PrepareForRendering(vtkRenderer*, vtkActor*) { }
00184
00186
00191 virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
00192 unsigned long typeflags, bool forceCompileOnly);
00194
00197 virtual void UpdateDelegateProgress(vtkPainter* delegate, double amount);
00198
00201 virtual void ProcessInformation(vtkInformation*) { }
00202
00205 virtual void ObserverPainterProgress(vtkPainter* toObserve);
00206
00210 void UpdateProgress(double amount);
00211
00213
00214 vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
00215 int fieldAttributeType,
00216 vtkDataSet* ds,
00217 bool *use_cell_data=0);
00218 vtkAbstractArray* GetInputArrayToProcess(int fieldAssociation,
00219 const char* name, vtkDataSet* dsl,
00220 bool *use_cell_data=0);
00222
00223
00224 vtkTimeStamp InformationProcessTime;
00225 friend class vtkPainterObserver;
00226 vtkPainterObserver* Observer;
00227
00228 vtkInformation* Information;
00229 vtkPainter* DelegatePainter;
00230
00231 double Progress;
00232 double ProgressOffset;
00233 double ProgressScaleFactor;
00234
00235 double TimeToDraw;
00236 vtkTimerLog* Timer;
00237
00238 vtkWeakPointer<vtkWindow> LastWindow;
00239
00240 private:
00241 vtkPainter(const vtkPainter &);
00242 void operator=(const vtkPainter &);
00243
00244 vtkDataObject* Input;
00245
00246 };
00247
00248 #endif //__vtkPainter_h