Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Rendering/vtkLODProp3D.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkLODProp3D.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00039 #ifndef __vtkLODProp3D_h 00040 #define __vtkLODProp3D_h 00041 00042 #include "vtkProp3D.h" 00043 00044 class vtkRenderer; 00045 class vtkMapper; 00046 class vtkVolumeMapper; 00047 class vtkAbstractMapper3D; 00048 class vtkProperty; 00049 class vtkVolumeProperty; 00050 class vtkTexture; 00051 00052 typedef struct 00053 { 00054 vtkProp3D *Prop3D; 00055 int Prop3DType; 00056 int ID; 00057 float EstimatedTime; 00058 int State; 00059 float Level; 00060 } vtkLODProp3DEntry; 00061 00062 class VTK_RENDERING_EXPORT vtkLODProp3D : public vtkProp3D 00063 { 00064 public: 00066 static vtkLODProp3D *New(); 00067 00068 vtkTypeRevisionMacro(vtkLODProp3D,vtkProp3D); 00069 void PrintSelf(ostream& os, vtkIndent indent); 00070 00072 00073 float *GetBounds(); 00074 void GetBounds(float bounds[6]) { this->vtkProp3D::GetBounds( bounds ); }; 00076 00078 00085 int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, vtkTexture *t, float time ); 00086 int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, float time ); 00087 int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, float time ); 00088 int AddLOD( vtkMapper *m, vtkProperty *p, float time ); 00089 int AddLOD( vtkMapper *m, vtkTexture *t, float time ); 00090 int AddLOD( vtkMapper *m, float time ); 00091 int AddLOD( vtkVolumeMapper *m, vtkVolumeProperty *p, float time ); 00092 int AddLOD( vtkVolumeMapper *m, float time ); 00094 00096 00097 vtkGetMacro(NumberOfLODs, int); 00099 00101 00105 vtkGetMacro(CurrentIndex, int); 00107 00110 void RemoveLOD( int id ); 00111 00113 00117 void SetLODProperty( int id, vtkProperty *p ); 00118 void GetLODProperty( int id, vtkProperty **p ); 00119 void SetLODProperty( int id, vtkVolumeProperty *p ); 00120 void GetLODProperty( int id, vtkVolumeProperty **p ); 00122 00124 00128 void SetLODMapper( int id, vtkMapper *m ); 00129 void GetLODMapper( int id, vtkMapper **m ); 00130 void SetLODMapper( int id, vtkVolumeMapper *m ); 00131 void GetLODMapper( int id, vtkVolumeMapper **m ); 00133 00137 vtkAbstractMapper3D *GetLODMapper(int id); 00138 00140 00142 void SetLODBackfaceProperty( int id, vtkProperty *t ); 00143 void GetLODBackfaceProperty( int id, vtkProperty **t ); 00145 00147 00149 void SetLODTexture( int id, vtkTexture *t ); 00150 void GetLODTexture( int id, vtkTexture **t ); 00152 00154 00157 void EnableLOD( int id ); 00158 void DisableLOD( int id ); 00159 int IsLODEnabled( int id ); 00161 00163 00168 void SetLODLevel( int id, float level ); 00169 float GetLODLevel( int id ); 00170 float GetLODIndexLevel( int index ); 00172 00174 00177 float GetLODEstimatedRenderTime( int id ); 00178 float GetLODIndexEstimatedRenderTime( int index ); 00180 00182 00185 vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 ); 00186 vtkGetMacro( AutomaticLODSelection, int ); 00187 vtkBooleanMacro( AutomaticLODSelection, int ); 00189 00191 00193 vtkSetMacro( SelectedLODID, int ); 00194 vtkGetMacro( SelectedLODID, int ); 00196 00199 int GetLastRenderedLODID(); 00200 00202 int GetPickLODID(void); 00203 00207 virtual void GetActors(vtkPropCollection *); 00208 00210 00212 void SetPickMethod(void (*f)(void *), void *arg); 00213 void SetPickMethodArgDelete(void (*f)(void *)); 00215 00217 00219 void SetSelectedPickLODID(int id); 00220 vtkGetMacro( SelectedPickLODID, int ); 00222 00224 00227 vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 ); 00228 vtkGetMacro( AutomaticPickLODSelection, int ); 00229 vtkBooleanMacro( AutomaticPickLODSelection, int ); 00231 00233 void ShallowCopy(vtkProp *prop); 00234 00235 //BTX 00236 00238 00239 int RenderOpaqueGeometry(vtkViewport *viewport); 00240 int RenderTranslucentGeometry(vtkViewport *viewport); 00242 00246 void ReleaseGraphicsResources(vtkWindow *); 00247 00251 void SetAllocatedRenderTime( float t, vtkViewport *vp ); 00252 00257 void RestoreEstimatedRenderTime( ); 00258 00261 virtual void AddEstimatedRenderTime( float t, vtkViewport *vp ); 00262 00263 //ETX 00264 00265 protected: 00266 vtkLODProp3D(); 00267 ~vtkLODProp3D(); 00268 00269 int GetAutomaticPickPropIndex(void); 00270 00271 vtkLODProp3DEntry *LODs; 00272 int NumberOfEntries; 00273 int NumberOfLODs; 00274 int CurrentIndex; 00275 00276 int GetNextEntryIndex(); 00277 int ConvertIDToIndex( int id ); 00278 int SelectedLODIndex; 00279 00280 int AutomaticLODSelection; 00281 int SelectedLODID; 00282 int SelectedPickLODID; 00283 int AutomaticPickLODSelection; 00284 vtkProp* PreviousPickProp; 00285 void (*PreviousPickMethod)(void *); 00286 void * PreviousPickMethodArg; 00287 private: 00288 vtkLODProp3D(const vtkLODProp3D&); // Not implemented. 00289 void operator=(const vtkLODProp3D&); // Not implemented. 00290 }; 00291 00292 #endif 00293