00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00060 #ifndef __vtkProp_h
00061 #define __vtkProp_h
00062
00063 #include "vtkObject.h"
00064 #include "vtkAssemblyPaths.h"
00065
00066 class vtkViewport;
00067 class vtkPropCollection;
00068 class vtkWindow;
00069 class vtkMatrix4x4;
00070
00071 class VTK_COMMON_EXPORT vtkProp : public vtkObject
00072 {
00073 public:
00075 static vtkProp* New();
00076
00077 vtkTypeMacro(vtkProp,vtkObject);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00081
00084 virtual void GetActors(vtkPropCollection *) {}
00085 virtual void GetActors2D(vtkPropCollection *) {}
00086 virtual void GetVolumes(vtkPropCollection *) {}
00088
00090
00091 vtkSetMacro(Visibility, int);
00092 vtkGetMacro(Visibility, int);
00093 vtkBooleanMacro(Visibility, int);
00095
00097
00099 vtkSetMacro(Pickable,int);
00100 vtkGetMacro(Pickable,int);
00101 vtkBooleanMacro(Pickable,int);
00103
00105
00107 void SetPickMethod(void (*f)(void *), void *arg);
00108 void SetPickMethodArgDelete(void (*f)(void *));
00110
00112 virtual void Pick();
00113
00115
00121 vtkSetMacro(Dragable,int);
00122 vtkGetMacro(Dragable,int);
00123 vtkBooleanMacro(Dragable,int);
00125
00130 virtual unsigned long GetRedrawMTime() {return this->GetMTime();}
00131
00134 virtual float *GetBounds() {return NULL;}
00135
00137 virtual void ShallowCopy(vtkProp *prop);
00138
00140
00151 virtual void InitPathTraversal();
00152 virtual vtkAssemblyPath *GetNextPath();
00153 virtual int GetNumberOfPaths() {return 1;}
00155
00157
00160 virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {}
00161 virtual vtkMatrix4x4 *GetMatrix() {return NULL;}
00163
00164
00166
00167 THESE METHODS OUTSIDE OF THE RENDERING PROCESS All concrete
00168 subclasses must be able to render themselves. There are three key
00169 render methods in vtk and they correspond to three different points
00170 in the rendering cycle. Any given prop may implement one or more of
00171 these methods. The first method is intended for rendering all opaque
00172 geometry. The second method is intended for rendering all translucent
00173 geometry. Most volume rendering mappers draw their results during
00174 this second method. The last method is to render any 2D annotation or
00175 overlays. Each of these methods return an integer value indicating
00176 whether or not this render method was applied to this data. */
00177 virtual int RenderOpaqueGeometry( vtkViewport *) { return 0; }
00178 virtual int RenderTranslucentGeometry( vtkViewport *) { return 0; }
00179 virtual int RenderOverlay( vtkViewport *) { return 0; }
00181
00186 virtual void ReleaseGraphicsResources(vtkWindow *) {}
00187
00189
00199 virtual float GetEstimatedRenderTime( vtkViewport * )
00200 { return this->EstimatedRenderTime; }
00201 virtual float GetEstimatedRenderTime(){ return this->EstimatedRenderTime; }
00203
00205
00209 virtual void SetEstimatedRenderTime(float t)
00210 {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;}
00212
00214
00219 virtual void RestoreEstimatedRenderTime()
00220 { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; }
00222
00223
00225
00235 virtual void AddEstimatedRenderTime(float t, vtkViewport *vtkNotUsed(vp))
00236 {this->EstimatedRenderTime+=t;}
00238
00240
00247 virtual void SetAllocatedRenderTime(float t, vtkViewport *vtkNotUsed(v))
00248 {
00249 this->AllocatedRenderTime = t;
00250 this->SavedEstimatedRenderTime = this->EstimatedRenderTime;
00251 this->EstimatedRenderTime = 0.0;
00252 }
00254
00256
00258 vtkGetMacro(AllocatedRenderTime, float);
00260
00262
00266 void SetRenderTimeMultiplier( float t ) { this->RenderTimeMultiplier = t; }
00267 vtkGetMacro(RenderTimeMultiplier, float);
00269
00273 virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path);
00274
00275
00276
00277 protected:
00278 vtkProp();
00279 ~vtkProp();
00280
00281 int Visibility;
00282 int Pickable;
00283 unsigned long PickTag;
00284 int Dragable;
00285
00286 float AllocatedRenderTime;
00287 float EstimatedRenderTime;
00288 float SavedEstimatedRenderTime;
00289 float RenderTimeMultiplier;
00290
00291
00292
00293 vtkAssemblyPaths *Paths;
00294
00295 private:
00296 vtkProp(const vtkProp&);
00297 void operator=(const vtkProp&);
00298 };
00299
00300 #endif
00301
00302