VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkLODProp3D.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 =========================================================================*/ 00035 #ifndef __vtkLODProp3D_h 00036 #define __vtkLODProp3D_h 00037 00038 #include "vtkProp3D.h" 00039 00040 class vtkRenderer; 00041 class vtkMapper; 00042 class vtkAbstractVolumeMapper; 00043 class vtkAbstractMapper3D; 00044 class vtkProperty; 00045 class vtkVolumeProperty; 00046 class vtkTexture; 00047 class vtkLODProp3DCallback; 00048 00049 typedef struct 00050 { 00051 vtkProp3D *Prop3D; 00052 int Prop3DType; 00053 int ID; 00054 double EstimatedTime; 00055 int State; 00056 double Level; 00057 } vtkLODProp3DEntry; 00058 00059 class VTK_RENDERING_EXPORT vtkLODProp3D : public vtkProp3D 00060 { 00061 public: 00063 static vtkLODProp3D *New(); 00064 00065 vtkTypeRevisionMacro(vtkLODProp3D,vtkProp3D); 00066 void PrintSelf(ostream& os, vtkIndent indent); 00067 00069 00070 double *GetBounds(); 00071 void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds( bounds ); }; 00073 00075 00082 int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, 00083 vtkTexture *t, double time ); 00084 int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time ); 00085 int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time ); 00086 int AddLOD( vtkMapper *m, vtkProperty *p, double time ); 00087 int AddLOD( vtkMapper *m, vtkTexture *t, double time ); 00088 int AddLOD( vtkMapper *m, double time ); 00089 int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time ); 00090 int AddLOD( vtkAbstractVolumeMapper *m, double time ); 00092 00094 00095 vtkGetMacro(NumberOfLODs, int); 00097 00099 00103 vtkGetMacro(CurrentIndex, int); 00105 00108 void RemoveLOD( int id ); 00109 00111 00115 void SetLODProperty( int id, vtkProperty *p ); 00116 void GetLODProperty( int id, vtkProperty **p ); 00117 void SetLODProperty( int id, vtkVolumeProperty *p ); 00118 void GetLODProperty( int id, vtkVolumeProperty **p ); 00120 00122 00126 void SetLODMapper( int id, vtkMapper *m ); 00127 void GetLODMapper( int id, vtkMapper **m ); 00128 void SetLODMapper( int id, vtkAbstractVolumeMapper *m ); 00129 void GetLODMapper( int id, vtkAbstractVolumeMapper **m ); 00131 00135 vtkAbstractMapper3D *GetLODMapper(int id); 00136 00138 00140 void SetLODBackfaceProperty( int id, vtkProperty *t ); 00141 void GetLODBackfaceProperty( int id, vtkProperty **t ); 00143 00145 00147 void SetLODTexture( int id, vtkTexture *t ); 00148 void GetLODTexture( int id, vtkTexture **t ); 00150 00152 00155 void EnableLOD( int id ); 00156 void DisableLOD( int id ); 00157 int IsLODEnabled( int id ); 00159 00161 00166 void SetLODLevel( int id, double level ); 00167 double GetLODLevel( int id ); 00168 double GetLODIndexLevel( int index ); 00170 00172 00175 double GetLODEstimatedRenderTime( int id ); 00176 double GetLODIndexEstimatedRenderTime( int index ); 00178 00180 00183 vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 ); 00184 vtkGetMacro( AutomaticLODSelection, int ); 00185 vtkBooleanMacro( AutomaticLODSelection, int ); 00187 00189 00191 vtkSetMacro( SelectedLODID, int ); 00192 vtkGetMacro( SelectedLODID, int ); 00194 00197 int GetLastRenderedLODID(); 00198 00200 int GetPickLODID(void); 00201 00203 00206 virtual void GetActors(vtkPropCollection *); 00207 virtual void GetVolumes(vtkPropCollection *); 00209 00211 00213 void SetSelectedPickLODID(int id); 00214 vtkGetMacro( SelectedPickLODID, int ); 00216 00218 00221 vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 ); 00222 vtkGetMacro( AutomaticPickLODSelection, int ); 00223 vtkBooleanMacro( AutomaticPickLODSelection, int ); 00225 00227 void ShallowCopy(vtkProp *prop); 00228 00229 //BTX 00230 00232 00233 int RenderOpaqueGeometry(vtkViewport *viewport); 00234 virtual int RenderTranslucentPolygonalGeometry( vtkViewport *ren); 00235 virtual int RenderVolumetricGeometry( vtkViewport *ren); 00237 00239 virtual int HasTranslucentPolygonalGeometry(); 00240 00244 void ReleaseGraphicsResources(vtkWindow *); 00245 00249 void SetAllocatedRenderTime( double t, vtkViewport *vp ); 00250 00255 void RestoreEstimatedRenderTime( ); 00256 00259 virtual void AddEstimatedRenderTime( double t, vtkViewport *vp ); 00260 00261 //ETX 00262 00263 protected: 00264 vtkLODProp3D(); 00265 ~vtkLODProp3D(); 00266 00267 int GetAutomaticPickPropIndex(void); 00268 00269 vtkLODProp3DEntry *LODs; 00270 int NumberOfEntries; 00271 int NumberOfLODs; 00272 int CurrentIndex; 00273 00274 int GetNextEntryIndex(); 00275 int ConvertIDToIndex( int id ); 00276 int SelectedLODIndex; 00277 00278 int AutomaticLODSelection; 00279 int SelectedLODID; 00280 int SelectedPickLODID; 00281 int AutomaticPickLODSelection; 00282 vtkLODProp3DCallback *PickCallback; 00283 00284 private: 00285 vtkLODProp3D(const vtkLODProp3D&); // Not implemented. 00286 void operator=(const vtkLODProp3D&); // Not implemented. 00287 }; 00288 00289 #endif 00290