Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class 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 =========================================================================*/
00052 #ifndef __vtkLODProp3D_h
00053 #define __vtkLODProp3D_h
00054 
00055 #include "vtkProp3D.h"
00056 
00057 class vtkRenderer;
00058 class vtkMapper;
00059 class vtkVolumeMapper;
00060 class vtkAbstractMapper3D;
00061 class vtkProperty;
00062 class vtkVolumeProperty;
00063 class vtkTexture;
00064 
00065 typedef struct
00066 {
00067   vtkProp3D   *Prop3D;
00068   int         Prop3DType;
00069   int         ID;
00070   float       EstimatedTime;
00071   int         State;
00072   float       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   float *GetBounds();
00087   void GetBounds(float bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
00089 
00091 
00098   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, vtkTexture *t, float time );
00099   int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, float time );
00100   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, float time );
00101   int AddLOD( vtkMapper *m, vtkProperty *p, float time );
00102   int AddLOD( vtkMapper *m, vtkTexture *t, float time );
00103   int AddLOD( vtkMapper *m, float time );
00104   int AddLOD( vtkVolumeMapper *m, vtkVolumeProperty *p, float time );
00105   int AddLOD( vtkVolumeMapper *m, float time );
00107 
00109 
00110   vtkGetMacro(NumberOfLODs, int);
00112  
00114 
00118   vtkGetMacro(CurrentIndex, int);
00120 
00123   void RemoveLOD( int id );
00124 
00126 
00130   void SetLODProperty( int id, vtkProperty  *p );
00131   void GetLODProperty( int id, vtkProperty  **p );
00132   void SetLODProperty( int id, vtkVolumeProperty  *p );
00133   void GetLODProperty( int id, vtkVolumeProperty  **p );
00135 
00137 
00141   void SetLODMapper( int id, vtkMapper  *m );
00142   void GetLODMapper( int id, vtkMapper  **m );
00143   void SetLODMapper( int id, vtkVolumeMapper  *m );
00144   void GetLODMapper( int id, vtkVolumeMapper  **m );
00146 
00150   vtkAbstractMapper3D *GetLODMapper(int id);
00151 
00153 
00155   void SetLODBackfaceProperty( int id, vtkProperty *t );
00156   void GetLODBackfaceProperty( int id, vtkProperty **t );
00158 
00160 
00162   void SetLODTexture( int id, vtkTexture *t );
00163   void GetLODTexture( int id, vtkTexture **t );
00165 
00167 
00170   void EnableLOD( int id );
00171   void DisableLOD( int id );
00172   int IsLODEnabled( int id );
00174 
00176 
00181   void SetLODLevel( int id, float level );
00182   float GetLODLevel( int id );
00183   float GetLODIndexLevel( int index );
00185 
00187 
00190   float GetLODEstimatedRenderTime( int id );
00191   float GetLODIndexEstimatedRenderTime( int index );
00193 
00195 
00198   vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
00199   vtkGetMacro( AutomaticLODSelection, int );
00200   vtkBooleanMacro( AutomaticLODSelection, int );
00202 
00204 
00206   vtkSetMacro( SelectedLODID, int );
00207   vtkGetMacro( SelectedLODID, int );
00209 
00212   int GetLastRenderedLODID();
00213 
00215   int GetPickLODID(void);
00216 
00220   virtual void GetActors(vtkPropCollection *);
00221   
00223 
00225   void SetPickMethod(void (*f)(void *), void *arg);
00226   void SetPickMethodArgDelete(void (*f)(void *));
00228 
00230 
00232   void SetSelectedPickLODID(int id);
00233   vtkGetMacro( SelectedPickLODID, int );
00235 
00237 
00240   vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
00241   vtkGetMacro( AutomaticPickLODSelection, int );
00242   vtkBooleanMacro( AutomaticPickLODSelection, int );
00244 
00246   void ShallowCopy(vtkProp *prop);
00247 
00248 //BTX
00249 
00251 
00252   int RenderOpaqueGeometry(vtkViewport *viewport);
00253   int RenderTranslucentGeometry(vtkViewport *viewport);
00255 
00259   void ReleaseGraphicsResources(vtkWindow *);
00260 
00264   void SetAllocatedRenderTime( float t, vtkViewport *vp );
00265 
00270   void RestoreEstimatedRenderTime( );
00271   
00274   virtual void AddEstimatedRenderTime( float t, vtkViewport *vp );
00275 
00276 //ETX
00277 
00278 protected:
00279   vtkLODProp3D();
00280   ~vtkLODProp3D();
00281 
00282   int GetAutomaticPickPropIndex(void);
00283 
00284   vtkLODProp3DEntry *LODs;
00285   int               NumberOfEntries;
00286   int               NumberOfLODs;
00287   int               CurrentIndex;
00288 
00289   int               GetNextEntryIndex();
00290   int               ConvertIDToIndex( int id );
00291   int               SelectedLODIndex;
00292 
00293   int               AutomaticLODSelection;
00294   int               SelectedLODID;
00295   int               SelectedPickLODID;
00296   int               AutomaticPickLODSelection;
00297   vtkProp*          PreviousPickProp;
00298   void (*PreviousPickMethod)(void *);
00299   void *            PreviousPickMethodArg;
00300 private:
00301   vtkLODProp3D(const vtkLODProp3D&);  // Not implemented.
00302   void operator=(const vtkLODProp3D&);  // Not implemented.
00303 };
00304 
00305 #endif
00306