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
00039
00063 #ifndef __vtkLODProp3D_h
00064 #define __vtkLODProp3D_h
00065
00066 #include "vtkProp3D.h"
00067 #include "vtkTransform.h"
00068
00069 class vtkRenderer;
00070 class vtkMapper;
00071 class vtkVolumeMapper;
00072 class vtkAbstractMapper3D;
00073 class vtkProperty;
00074 class vtkVolumeProperty;
00075 class vtkTexture;
00076
00077 typedef struct
00078 {
00079 vtkProp3D *Prop3D;
00080 int Prop3DType;
00081 int ID;
00082 float EstimatedTime;
00083 int State;
00084 float Level;
00085 } vtkLODProp3DEntry;
00086
00087 class VTK_RENDERING_EXPORT vtkLODProp3D : public vtkProp3D
00088 {
00089 public:
00091 static vtkLODProp3D *New();
00092
00093 vtkTypeMacro(vtkLODProp3D,vtkProp3D);
00094 void PrintSelf(ostream& os, vtkIndent indent);
00095
00097
00098 float *GetBounds();
00099 void GetBounds(float bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
00101
00103
00110 int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, vtkTexture *t, float time );
00111 int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, float time );
00112 int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, float time );
00113 int AddLOD( vtkMapper *m, vtkProperty *p, float time );
00114 int AddLOD( vtkMapper *m, vtkTexture *t, float time );
00115 int AddLOD( vtkMapper *m, float time );
00116 int AddLOD( vtkVolumeMapper *m, vtkVolumeProperty *p, float time );
00117 int AddLOD( vtkVolumeMapper *m, float time );
00119
00122 void RemoveLOD( int id );
00123
00125
00129 void SetLODProperty( int id, vtkProperty *p );
00130 void GetLODProperty( int id, vtkProperty **p );
00131 void SetLODProperty( int id, vtkVolumeProperty *p );
00132 void GetLODProperty( int id, vtkVolumeProperty **p );
00134
00136
00140 void SetLODMapper( int id, vtkMapper *m );
00141 void GetLODMapper( int id, vtkMapper **m );
00142 void SetLODMapper( int id, vtkVolumeMapper *m );
00143 void GetLODMapper( int id, vtkVolumeMapper **m );
00145
00149 vtkAbstractMapper3D *GetLODMapper(int id);
00150
00152
00154 void SetLODBackfaceProperty( int id, vtkProperty *t );
00155 void GetLODBackfaceProperty( int id, vtkProperty **t );
00157
00159
00161 void SetLODTexture( int id, vtkTexture *t );
00162 void GetLODTexture( int id, vtkTexture **t );
00164
00166
00169 void EnableLOD( int id );
00170 void DisableLOD( int id );
00172
00174
00179 void SetLODLevel( int id, float level );
00180 float GetLODLevel( int id );
00181 float GetLODIndexLevel( int index );
00183
00185
00188 float GetLODEstimatedRenderTime( int id );
00189 float GetLODIndexEstimatedRenderTime( int index );
00191
00193
00196 vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
00197 vtkGetMacro( AutomaticLODSelection, int );
00198 vtkBooleanMacro( AutomaticLODSelection, int );
00200
00202
00204 vtkSetMacro( SelectedLODID, int );
00205 vtkGetMacro( SelectedLODID, int );
00207
00210 int GetLastRenderedLODID();
00211
00213 int GetPickLODID(void);
00214
00218 virtual void GetActors(vtkPropCollection *);
00219
00221
00223 void SetPickMethod(void (*f)(void *), void *arg);
00224 void SetPickMethodArgDelete(void (*f)(void *));
00226
00228
00230 void SetSelectedPickLODID(int id);
00231 vtkGetMacro( SelectedPickLODID, int );
00233
00235
00238 vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
00239 vtkGetMacro( AutomaticPickLODSelection, int );
00240 vtkBooleanMacro( AutomaticPickLODSelection, int );
00242
00244 void ShallowCopy(vtkProp *prop);
00245
00246
00247
00249
00250 int RenderOpaqueGeometry(vtkViewport *viewport);
00251 int RenderTranslucentGeometry(vtkViewport *viewport);
00253
00257 void ReleaseGraphicsResources(vtkWindow *);
00258
00262 void SetAllocatedRenderTime( float t, vtkViewport *vp );
00263
00268 void RestoreEstimatedRenderTime( );
00269
00272 virtual void AddEstimatedRenderTime( float t, vtkViewport *vp );
00273
00274
00275
00276 protected:
00277 vtkLODProp3D();
00278 ~vtkLODProp3D();
00279
00280 int GetAutomaticPickPropIndex(void);
00281
00282 vtkLODProp3DEntry *LODs;
00283 int NumberOfEntries;
00284 int NumberOfLODs;
00285 int CurrentIndex;
00286
00287 int GetNextEntryIndex();
00288 int ConvertIDToIndex( int id );
00289 int SelectedLODIndex;
00290
00291 int AutomaticLODSelection;
00292 int SelectedLODID;
00293 int SelectedPickLODID;
00294 int AutomaticPickLODSelection;
00295 vtkProp* PreviousPickProp;
00296 void (*PreviousPickMethod)(void *);
00297 void * PreviousPickMethodArg;
00298 private:
00299 vtkLODProp3D(const vtkLODProp3D&);
00300 void operator=(const vtkLODProp3D&);
00301 };
00302
00303 #endif
00304