VTK
dox/Rendering/Core/vtkLODProp3D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkLODProp3D.h
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 =========================================================================*/
00038 #ifndef __vtkLODProp3D_h
00039 #define __vtkLODProp3D_h
00040 
00041 #include "vtkRenderingCoreModule.h" // For export macro
00042 #include "vtkProp3D.h"
00043 
00044 class vtkRenderer;
00045 class vtkMapper;
00046 class vtkAbstractVolumeMapper;
00047 class vtkAbstractMapper3D;
00048 class vtkImageMapper3D;
00049 class vtkProperty;
00050 class vtkVolumeProperty;
00051 class vtkImageProperty;
00052 class vtkTexture;
00053 class vtkLODProp3DCallback;
00054 
00055 typedef struct
00056 {
00057   vtkProp3D   *Prop3D;
00058   int         Prop3DType;
00059   int         ID;
00060   double       EstimatedTime;
00061   int         State;
00062   double       Level;
00063 } vtkLODProp3DEntry;
00064 
00065 class VTKRENDERINGCORE_EXPORT vtkLODProp3D : public vtkProp3D
00066 {
00067 public:
00069   static vtkLODProp3D *New();
00070 
00071   vtkTypeMacro(vtkLODProp3D, vtkProp3D);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00075 
00076   double *GetBounds();
00077   void GetBounds(double bounds[6])
00078     { this->vtkProp3D::GetBounds( bounds ); }
00080 
00082 
00089   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back,
00090               vtkTexture *t, double time );
00091   int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, double time );
00092   int AddLOD( vtkMapper *m, vtkProperty *p, vtkProperty *back, double time );
00093   int AddLOD( vtkMapper *m, vtkProperty *p, double time );
00094   int AddLOD( vtkMapper *m, vtkTexture *t, double time );
00095   int AddLOD( vtkMapper *m, double time );
00096   int AddLOD( vtkAbstractVolumeMapper *m, vtkVolumeProperty *p, double time );
00097   int AddLOD( vtkAbstractVolumeMapper *m, double time );
00098   int AddLOD( vtkImageMapper3D *m, vtkImageProperty *p, double time );
00099   int AddLOD( vtkImageMapper3D *m, double time );
00101 
00103 
00104   vtkGetMacro(NumberOfLODs, int);
00106 
00108 
00112   vtkGetMacro(CurrentIndex, int);
00114 
00117   void RemoveLOD(int id);
00118 
00120 
00124   void SetLODProperty(int id, vtkProperty *p);
00125   void GetLODProperty(int id, vtkProperty **p);
00126   void SetLODProperty(int id, vtkVolumeProperty *p);
00127   void GetLODProperty(int id, vtkVolumeProperty **p);
00128   void SetLODProperty(int id, vtkImageProperty *p);
00129   void GetLODProperty(int id, vtkImageProperty **p);
00131 
00133 
00137   void SetLODMapper(int id, vtkMapper *m);
00138   void GetLODMapper(int id, vtkMapper **m);
00139   void SetLODMapper(int id, vtkAbstractVolumeMapper *m);
00140   void GetLODMapper(int id, vtkAbstractVolumeMapper **m);
00141   void SetLODMapper(int id, vtkImageMapper3D *m);
00142   void GetLODMapper(int id, vtkImageMapper3D **m);
00144 
00148   vtkAbstractMapper3D *GetLODMapper(int id);
00149 
00151 
00153   void SetLODBackfaceProperty(int id, vtkProperty *t);
00154   void GetLODBackfaceProperty(int id, vtkProperty **t);
00156 
00158 
00160   void SetLODTexture(int id, vtkTexture *t);
00161   void GetLODTexture(int id, vtkTexture **t);
00163 
00165 
00168   void EnableLOD(int id);
00169   void DisableLOD(int id);
00170   int IsLODEnabled(int id);
00172 
00174 
00179   void SetLODLevel(int id, double level);
00180   double GetLODLevel(int id );
00181   double GetLODIndexLevel(int index);
00183 
00185 
00188   double GetLODEstimatedRenderTime(int id);
00189   double 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 
00216 
00219   virtual void GetActors(vtkPropCollection *);
00220   virtual void GetVolumes(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   virtual int RenderTranslucentPolygonalGeometry( vtkViewport *ren);
00248   virtual int RenderVolumetricGeometry( vtkViewport *ren);
00250 
00252   virtual int HasTranslucentPolygonalGeometry();
00253 
00257   void ReleaseGraphicsResources(vtkWindow *);
00258 
00262   void SetAllocatedRenderTime( double t, vtkViewport *vp );
00263 
00268   void RestoreEstimatedRenderTime( );
00269 
00272   virtual void AddEstimatedRenderTime( double t, vtkViewport *vp );
00273 
00274 //ETX
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   vtkLODProp3DCallback *PickCallback;
00296 
00297 private:
00298   vtkLODProp3D(const vtkLODProp3D&);  // Not implemented.
00299   void operator=(const vtkLODProp3D&);  // Not implemented.
00300 };
00301 
00302 #endif