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

vtkLODProp3D.h

Go to the documentation of this file.
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 =========================================================================*/
00051 #ifndef __vtkLODProp3D_h
00052 #define __vtkLODProp3D_h
00053 
00054 #include "vtkProp3D.h"
00055 
00056 class vtkRenderer;
00057 class vtkMapper;
00058 class vtkAbstractVolumeMapper;
00059 class vtkAbstractMapper3D;
00060 class vtkProperty;
00061 class vtkVolumeProperty;
00062 class vtkTexture;
00063 class vtkLODProp3DCallback;
00064 
00065 typedef struct
00066 {
00067   vtkProp3D   *Prop3D;
00068   int         Prop3DType;
00069   int         ID;
00070   double       EstimatedTime;
00071   int         State;
00072   double       Level;
00073 } vtkLODProp3DEntry;
00074 
00075 class VTK_RENDERING_EXPORT vtkLODProp3D : public vtkProp3D
00076 {
00077 public:
00079   static vtkLODProp3D *New();
00080 
00081   vtkTypeRevisionMacro(vtkLODProp3D,vtkProp3D);
00082   void PrintSelf(ostream& os, vtkIndent indent);
00083 
00085 
00086   double *GetBounds();
00087   void GetBounds(double bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
00089 
00091 
00098   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, 
00099               vtkTexture *t, double time );
00100   int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
00101   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
00102   int AddLOD( vtkMapper *m, vtkProperty *p, double time );
00103   int AddLOD( vtkMapper *m, vtkTexture *t, double time );
00104   int AddLOD( vtkMapper *m, double time );
00105   int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
00106   int AddLOD( vtkAbstractVolumeMapper *m, double time );
00108 
00110 
00111   vtkGetMacro(NumberOfLODs, int);
00113  
00115 
00119   vtkGetMacro(CurrentIndex, int);
00121 
00124   void RemoveLOD( int id );
00125 
00127 
00131   void SetLODProperty( int id, vtkProperty  *p );
00132   void GetLODProperty( int id, vtkProperty  **p );
00133   void SetLODProperty( int id, vtkVolumeProperty  *p );
00134   void GetLODProperty( int id, vtkVolumeProperty  **p );
00136 
00138 
00142   void SetLODMapper( int id, vtkMapper  *m );
00143   void GetLODMapper( int id, vtkMapper  **m );
00144   void SetLODMapper( int id, vtkAbstractVolumeMapper  *m );
00145   void GetLODMapper( int id, vtkAbstractVolumeMapper  **m );
00147 
00151   vtkAbstractMapper3D *GetLODMapper(int id);
00152 
00154 
00156   void SetLODBackfaceProperty( int id, vtkProperty *t );
00157   void GetLODBackfaceProperty( int id, vtkProperty **t );
00159 
00161 
00163   void SetLODTexture( int id, vtkTexture *t );
00164   void GetLODTexture( int id, vtkTexture **t );
00166 
00168 
00171   void EnableLOD( int id );
00172   void DisableLOD( int id );
00173   int IsLODEnabled( int id );
00175 
00177 
00182   void SetLODLevel( int id, double level );
00183   double GetLODLevel( int id );
00184   double GetLODIndexLevel( int index );
00186 
00188 
00191   double GetLODEstimatedRenderTime( int id );
00192   double GetLODIndexEstimatedRenderTime( int index );
00194 
00196 
00199   vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
00200   vtkGetMacro( AutomaticLODSelection, int );
00201   vtkBooleanMacro( AutomaticLODSelection, int );
00203 
00205 
00207   vtkSetMacro( SelectedLODID, int );
00208   vtkGetMacro( SelectedLODID, int );
00210 
00213   int GetLastRenderedLODID();
00214 
00216   int GetPickLODID(void);
00217 
00221   virtual void GetActors(vtkPropCollection *);
00222   
00224 
00226   void SetSelectedPickLODID(int id);
00227   vtkGetMacro( SelectedPickLODID, int );
00229 
00231 
00234   vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
00235   vtkGetMacro( AutomaticPickLODSelection, int );
00236   vtkBooleanMacro( AutomaticPickLODSelection, int );
00238 
00240   void ShallowCopy(vtkProp *prop);
00241 
00242 //BTX
00243 
00245 
00246   int RenderOpaqueGeometry(vtkViewport *viewport);
00247   int RenderTranslucentGeometry(vtkViewport *viewport);
00249 
00253   void ReleaseGraphicsResources(vtkWindow *);
00254 
00258   void SetAllocatedRenderTime( double t, vtkViewport *vp );
00259 
00264   void RestoreEstimatedRenderTime( );
00265   
00268   virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
00269 
00270 //ETX
00271 
00272 protected:
00273   vtkLODProp3D();
00274   ~vtkLODProp3D();
00275 
00276   int GetAutomaticPickPropIndex(void);
00277 
00278   vtkLODProp3DEntry *LODs;
00279   int               NumberOfEntries;
00280   int               NumberOfLODs;
00281   int               CurrentIndex;
00282 
00283   int               GetNextEntryIndex();
00284   int               ConvertIDToIndex( int id );
00285   int               SelectedLODIndex;
00286 
00287   int               AutomaticLODSelection;
00288   int               SelectedLODID;
00289   int               SelectedPickLODID;
00290   int               AutomaticPickLODSelection;
00291   vtkLODProp3DCallback *PickCallback;
00292 
00293 private:
00294   vtkLODProp3D(const vtkLODProp3D&);  // Not implemented.
00295   void operator=(const vtkLODProp3D&);  // Not implemented.
00296 };
00297 
00298 #endif
00299