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

graphics/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 =========================================================================*/
00059 #ifndef __vtkLODProp3D_h
00060 #define __vtkLODProp3D_h
00061 
00062 #include "vtkProp3D.h"
00063 #include "vtkTransform.h"
00064 
00065 class vtkRenderer;
00066 class vtkMapper;
00067 class vtkVolumeMapper;
00068 class vtkProperty;
00069 class vtkVolumeProperty;
00070 class vtkTexture;
00071 
00072 typedef struct
00073 {
00074   vtkProp3D   *Prop3D;
00075   int         Prop3DType;
00076   int         ID;
00077   float       EstimatedTime;
00078   int         State;
00079   float       Level;
00080 } vtkLODProp3DEntry;
00081 
00082 class VTK_EXPORT vtkLODProp3D : public vtkProp3D
00083 {
00084 public:
00086   static vtkLODProp3D *New();
00087 
00088   vtkTypeMacro(vtkLODProp3D,vtkProp3D);
00089   void PrintSelf(ostream& os, vtkIndent indent);
00090 
00092   float *GetBounds();
00093   void GetBounds(float bounds[6]) { this->vtkProp3D::GetBounds( bounds ); };
00094 
00096   int RequiresRayCasting();
00097 
00099   int RequiresRenderingIntoImage();
00100  
00108   int AddLOD( vtkMapper *m, vtkProperty *p, vtkTexture *t, float time );
00109   int AddLOD( vtkMapper *m, vtkProperty *p, float time );
00110   int AddLOD( vtkMapper *m, vtkTexture *t, float time );
00111   int AddLOD( vtkMapper *m, float time );
00112   int AddLOD( vtkVolumeMapper *m, vtkVolumeProperty *p, float time );
00113   int AddLOD( vtkVolumeMapper *m, float time );
00114 
00117   void RemoveLOD( int id );
00118 
00123   void SetLODProperty( int id, vtkProperty  *p );
00124   void GetLODProperty( int id, vtkProperty  **p );
00125   void SetLODProperty( int id, vtkVolumeProperty  *p );
00126   void GetLODProperty( int id, vtkVolumeProperty  **p );
00127 
00132   void SetLODMapper( int id, vtkMapper  *m );
00133   void GetLODMapper( int id, vtkMapper  **m );
00134   void SetLODMapper( int id, vtkVolumeMapper  *m );
00135   void GetLODMapper( int id, vtkVolumeMapper  **m );
00136 
00139   void SetLODTexture( int id, vtkTexture *t );
00140   void GetLODTexture( int id, vtkTexture **t );
00141 
00145   void EnableLOD( int id );
00146   void DisableLOD( int id );
00147 
00153   void SetLODLevel( int id, float level );
00154   float GetLODLevel( int id );
00155   float GetLODIndexLevel( int index );
00156 
00160   float GetLODEstimatedRenderTime( int id );
00161   float GetLODIndexEstimatedRenderTime( int index );
00162 
00166   vtkSetClampMacro( AutomaticLODSelection, int, 0, 1 );
00167   vtkGetMacro( AutomaticLODSelection, int );
00168   vtkBooleanMacro( AutomaticLODSelection, int );
00169 
00172   vtkSetMacro( SelectedLODID, int );
00173   vtkGetMacro( SelectedLODID, int );
00174 
00177   int GetLastRenderedLODID();
00178 
00182   virtual void GetActors(vtkPropCollection *);
00183 
00186   void SetPickMethod(void (*f)(void *), void *arg);
00187   void SetPickMethodArgDelete(void (*f)(void *));
00188 
00191   void SetSelectedPickLODID(int id);
00192   vtkGetMacro( SelectedPickLODID, int );
00193 
00197   vtkSetClampMacro( AutomaticPickLODSelection, int, 0, 1 );
00198   vtkGetMacro( AutomaticPickLODSelection, int );
00199   vtkBooleanMacro( AutomaticPickLODSelection, int );
00200 
00202   void ShallowCopy(vtkProp *prop);
00203 
00204 //BTX
00205 
00207   int RenderOpaqueGeometry(vtkViewport *viewport);
00208   int RenderTranslucentGeometry(vtkViewport *viewport);
00209   int RenderIntoImage(vtkViewport *viewport);
00210   int CastViewRay( VTKRayCastRayInfo *rayInfo );
00211   int InitializeRayCasting( vtkViewport *viewport);
00212 
00216   void ReleaseGraphicsResources(vtkWindow *);
00217 
00221   void SetAllocatedRenderTime( float t, vtkViewport *vp );
00222 
00227   void RestoreEstimatedRenderTime( );
00228   
00231   virtual void AddEstimatedRenderTime( float t, vtkViewport *vp );
00232 
00233 //ETX
00234 
00235 protected:
00236   vtkLODProp3D();
00237   ~vtkLODProp3D();
00238   vtkLODProp3D(const vtkLODProp3D&) {};
00239   void operator=(const vtkLODProp3D&) {};
00240 
00241   int GetAutomaticPickPropIndex(void);
00242 
00243   vtkLODProp3DEntry *LODs;
00244   int               NumberOfEntries;
00245   int               NumberOfLODs;
00246   int               CurrentIndex;
00247 
00248   int               GetNextEntryIndex();
00249   int               ConvertIDToIndex( int id );
00250   int               SelectedLODIndex;
00251 
00252   int               AutomaticLODSelection;
00253   int               SelectedLODID;
00254   int               SelectedPickLODID;
00255   int               AutomaticPickLODSelection;
00256   vtkProp*          PreviousPickProp;
00257   void (*PreviousPickMethod)(void *);
00258   void *            PreviousPickMethodArg;
00259 };
00260 
00261 #endif
00262 

Generated on Wed Nov 21 12:27:00 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001