VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkProp.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00033 #ifndef __vtkProp_h 00034 #define __vtkProp_h 00035 00036 #include "vtkObject.h" 00037 00038 class vtkAssemblyPath; 00039 class vtkAssemblyPaths; 00040 class vtkMatrix4x4; 00041 class vtkPropCollection; 00042 class vtkViewport; 00043 class vtkWindow; 00044 class vtkInformation; 00045 00046 class VTK_COMMON_EXPORT vtkProp : public vtkObject 00047 { 00048 public: 00049 vtkTypeRevisionMacro(vtkProp,vtkObject); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00056 virtual void GetActors(vtkPropCollection *) {} 00057 virtual void GetActors2D(vtkPropCollection *) {} 00058 virtual void GetVolumes(vtkPropCollection *) {} 00060 00062 00063 vtkSetMacro(Visibility, int); 00064 vtkGetMacro(Visibility, int); 00065 vtkBooleanMacro(Visibility, int); 00067 00069 00072 vtkSetMacro(Pickable,int); 00073 vtkGetMacro(Pickable,int); 00074 vtkBooleanMacro(Pickable,int); 00076 00078 virtual void Pick(); 00079 00081 00087 vtkSetMacro(Dragable,int); 00088 vtkGetMacro(Dragable,int); 00089 vtkBooleanMacro(Dragable,int); 00091 00096 virtual unsigned long GetRedrawMTime() {return this->GetMTime();} 00097 00099 00103 vtkSetMacro(UseBounds,bool); 00104 vtkGetMacro(UseBounds,bool); 00105 vtkBooleanMacro(UseBounds,bool); 00107 00110 virtual double *GetBounds() {return NULL;} 00111 00113 virtual void ShallowCopy(vtkProp *prop); 00114 00116 00127 virtual void InitPathTraversal(); 00128 virtual vtkAssemblyPath *GetNextPath(); 00129 virtual int GetNumberOfPaths() {return 1;} 00131 00133 00136 virtual void PokeMatrix(vtkMatrix4x4 *vtkNotUsed(matrix)) {} 00137 virtual vtkMatrix4x4 *GetMatrix() {return NULL;} 00139 00141 00145 vtkGetObjectMacro(PropertyKeys,vtkInformation); 00146 virtual void SetPropertyKeys(vtkInformation *keys); 00148 00151 virtual bool HasKeys(vtkInformation *requiredKeys); 00152 00153 //BTX 00155 00168 virtual int RenderOpaqueGeometry( vtkViewport *) { return 0; } 00169 virtual int RenderTranslucentPolygonalGeometry( vtkViewport *) { return 0; } 00170 virtual int RenderVolumetricGeometry( vtkViewport *) { return 0; } 00171 virtual int RenderOverlay( vtkViewport *) { return 0; } 00173 00175 00181 virtual bool RenderFilteredOpaqueGeometry(vtkViewport *v, 00182 vtkInformation *requiredKeys); 00184 00186 00192 virtual bool RenderFilteredTranslucentPolygonalGeometry( 00193 vtkViewport *v, 00194 vtkInformation *requiredKeys); 00196 00198 00204 virtual bool RenderFilteredVolumetricGeometry(vtkViewport *v, 00205 vtkInformation *requiredKeys); 00207 00209 00215 virtual bool RenderFilteredOverlay(vtkViewport *v, 00216 vtkInformation *requiredKeys); 00218 00227 virtual int HasTranslucentPolygonalGeometry() { return 0; } 00228 00233 virtual void ReleaseGraphicsResources(vtkWindow *) {} 00234 00236 00246 virtual double GetEstimatedRenderTime( vtkViewport * ) 00247 { return this->EstimatedRenderTime; } 00248 virtual double GetEstimatedRenderTime(){ return this->EstimatedRenderTime; } 00250 00252 00256 virtual void SetEstimatedRenderTime(double t) 00257 {this->EstimatedRenderTime = t; this->SavedEstimatedRenderTime = t;} 00259 00261 00266 virtual void RestoreEstimatedRenderTime() 00267 { this->EstimatedRenderTime = this->SavedEstimatedRenderTime; } 00269 00270 00272 00282 virtual void AddEstimatedRenderTime(double t, vtkViewport *vtkNotUsed(vp)) 00283 {this->EstimatedRenderTime+=t;} 00285 00287 00294 virtual void SetAllocatedRenderTime(double t, vtkViewport *vtkNotUsed(v)) 00295 { 00296 this->AllocatedRenderTime = t; 00297 this->SavedEstimatedRenderTime = this->EstimatedRenderTime; 00298 this->EstimatedRenderTime = 0.0; 00299 } 00301 00303 00305 vtkGetMacro(AllocatedRenderTime, double); 00307 00309 00313 void SetRenderTimeMultiplier( double t ) { this->RenderTimeMultiplier = t; } 00314 vtkGetMacro(RenderTimeMultiplier, double); 00316 00320 virtual void BuildPaths(vtkAssemblyPaths *paths, vtkAssemblyPath *path); 00321 00323 00327 virtual bool GetSupportsSelection() 00328 { return false; } 00330 00332 00333 vtkGetMacro(NumberOfConsumers,int); 00335 00337 00338 void AddConsumer(vtkObject *c); 00339 void RemoveConsumer(vtkObject *c); 00340 vtkObject *GetConsumer(int i); 00341 int IsConsumer(vtkObject *c); 00343 00344 //ETX 00345 00346 protected: 00347 vtkProp(); 00348 ~vtkProp(); 00349 00350 int Visibility; 00351 int Pickable; 00352 int Dragable; 00353 bool UseBounds; 00354 00355 double AllocatedRenderTime; 00356 double EstimatedRenderTime; 00357 double SavedEstimatedRenderTime; 00358 double RenderTimeMultiplier; 00359 00360 // how many consumers does this object have 00361 int NumberOfConsumers; 00362 vtkObject **Consumers; 00363 00364 // support multi-part props and access to paths of prop 00365 // stuff that follows is used to build the assembly hierarchy 00366 vtkAssemblyPaths *Paths; 00367 00368 vtkInformation *PropertyKeys; 00369 00370 private: 00371 vtkProp(const vtkProp&); // Not implemented. 00372 void operator=(const vtkProp&); // Not implemented. 00373 }; 00374 00375 #endif 00376 00377