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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 //BTX
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 //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   vtkProp*          PreviousPickProp;
00296   void (*PreviousPickMethod)(void *);
00297   void *            PreviousPickMethodArg;
00298 private:
00299   vtkLODProp3D(const vtkLODProp3D&);  // Not implemented.
00300   void operator=(const vtkLODProp3D&);  // Not implemented.
00301 };
00302 
00303 #endif
00304 

Generated on Thu Mar 28 14:19:32 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001