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

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 =========================================================================*/
00051 #ifndef __vtkLODProp3D_h
00052 #define __vtkLODProp3D_h
00053 
00054 #include "vtkProp3D.h"
00055 
00056 class vtkRenderer;
00057 class vtkMapper;
00058 class vtkVolumeMapper;
00059 class vtkAbstractMapper3D;
00060 class vtkProperty;
00061 class vtkVolumeProperty;
00062 class vtkTexture;
00063 
00064 typedef struct
00065 {
00066   vtkProp3D   *Prop3D;
00067   int         Prop3DType;
00068   int         ID;
00069   float       EstimatedTime;
00070   int         State;
00071   float       Level;
00072 } vtkLODProp3DEntry;
00073 
00074 class VTK_RENDERING_EXPORT vtkLODProp3D : public vtkProp3D
00075 {
00076 public:
00078   static vtkLODProp3D *New();
00079 
00080   vtkTypeRevisionMacro(vtkLODProp3D,vtkProp3D);
00081   void PrintSelf(ostream& os, vtkIndent indent);
00082 
00084 
00085   float *GetBounds();
00086   void GetBounds(float bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
00088 
00090 
00097   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, vtkTexture *t, float time );
00098   int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, float time );
00099   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, float time );
00100   int AddLOD( vtkMapper *m, vtkProperty *p, float time );
00101   int AddLOD( vtkMapper *m, vtkTexture *t, float time );
00102   int AddLOD( vtkMapper *m, float time );
00103   int AddLOD( vtkVolumeMapper *m, vtkVolumeProperty *p, float time );
00104   int AddLOD( vtkVolumeMapper *m, float time );
00106 
00108 
00109   vtkGetMacro(NumberOfLODs, int);
00111  
00113 
00117   vtkGetMacro(CurrentIndex, int);
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 );
00171   int IsLODEnabled( int id );
00173 
00175 
00180   void SetLODLevel( int id, float level );
00181   float GetLODLevel( int id );
00182   float GetLODIndexLevel( int index );
00184 
00186 
00189   float GetLODEstimatedRenderTime( int id );
00190   float GetLODIndexEstimatedRenderTime( int index );
00192 
00194 
00197   vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
00198   vtkGetMacro( AutomaticLODSelection, int );
00199   vtkBooleanMacro( AutomaticLODSelection, int );
00201 
00203 
00205   vtkSetMacro( SelectedLODID, int );
00206   vtkGetMacro( SelectedLODID, int );
00208 
00211   int GetLastRenderedLODID();
00212 
00214   int GetPickLODID(void);
00215 
00219   virtual void GetActors(vtkPropCollection *);
00220   
00222 
00224   void SetPickMethod(void (*f)(void *), void *arg);
00225   void SetPickMethodArgDelete(void (*f)(void *));
00227 
00229 
00231   void SetSelectedPickLODID(int id);
00232   vtkGetMacro( SelectedPickLODID, int );
00234 
00236 
00239   vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
00240   vtkGetMacro( AutomaticPickLODSelection, int );
00241   vtkBooleanMacro( AutomaticPickLODSelection, int );
00243 
00245   void ShallowCopy(vtkProp *prop);
00246 
00247 //BTX
00248 
00250 
00251   int RenderOpaqueGeometry(vtkViewport *viewport);
00252   int RenderTranslucentGeometry(vtkViewport *viewport);
00254 
00258   void ReleaseGraphicsResources(vtkWindow *);
00259 
00263   void SetAllocatedRenderTime( float t, vtkViewport *vp );
00264 
00269   void RestoreEstimatedRenderTime( );
00270   
00273   virtual void AddEstimatedRenderTime( float t, vtkViewport *vp );
00274 
00275 //ETX
00276 
00277 protected:
00278   vtkLODProp3D();
00279   ~vtkLODProp3D();
00280 
00281   int GetAutomaticPickPropIndex(void);
00282 
00283   vtkLODProp3DEntry *LODs;
00284   int               NumberOfEntries;
00285   int               NumberOfLODs;
00286   int               CurrentIndex;
00287 
00288   int               GetNextEntryIndex();
00289   int               ConvertIDToIndex( int id );
00290   int               SelectedLODIndex;
00291 
00292   int               AutomaticLODSelection;
00293   int               SelectedLODID;
00294   int               SelectedPickLODID;
00295   int               AutomaticPickLODSelection;
00296   vtkProp*          PreviousPickProp;
00297   void (*PreviousPickMethod)(void *);
00298   void *            PreviousPickMethodArg;
00299 private:
00300   vtkLODProp3D(const vtkLODProp3D&);  // Not implemented.
00301   void operator=(const vtkLODProp3D&);  // Not implemented.
00302 };
00303 
00304 #endif
00305