VTK
dox/Rendering/vtkQuadricLODActor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQuadricLODActor.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 =========================================================================*/
00052 #ifndef __vtkQuadricLODActor_h
00053 #define __vtkQuadricLODActor_h
00054 
00055 #include "vtkActor.h"
00056 
00057 class vtkQuadricClustering;
00058 class vtkPolyDataMapper;
00059 class vtkCamera;
00060 class vtkPolyData;
00061 
00062 class VTK_RENDERING_EXPORT vtkQuadricLODActor : public vtkActor
00063 {
00064 public:
00066   static vtkQuadricLODActor *New();
00067 
00069 
00070   vtkTypeMacro(vtkQuadricLODActor,vtkActor);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00075 
00079   vtkSetMacro(DeferLODConstruction,int);
00080   vtkGetMacro(DeferLODConstruction,int);
00081   vtkBooleanMacro(DeferLODConstruction,int);
00083 
00085 
00090   vtkSetMacro(Static,int);
00091   vtkGetMacro(Static,int);
00092   vtkBooleanMacro(Static,int);
00094 
00095 //BTX
00096   enum DataConfigurationEnum
00097   {
00098     UNKNOWN=0,
00099     XLINE,YLINE,ZLINE,
00100     XYPLANE,XZPLANE,YZPLANE,
00101     XYZVOLUME
00102   };
00103 //ETX
00105 
00116   vtkSetClampMacro(DataConfiguration,int,UNKNOWN,XYZVOLUME);
00117   vtkGetMacro(DataConfiguration,int);
00118   void SetDataConfigurationToUnknown()
00119     {this->SetDataConfiguration(UNKNOWN);}
00120   void SetDataConfigurationToXLine()
00121     {this->SetDataConfiguration(XLINE);}
00122   void SetDataConfigurationToYLine()
00123     {this->SetDataConfiguration(YLINE);}
00124   void SetDataConfigurationToZLine()
00125     {this->SetDataConfiguration(ZLINE);}
00126   void SetDataConfigurationToXYPlane()
00127     {this->SetDataConfiguration(XYPLANE);}
00128   void SetDataConfigurationToYZPlane()
00129     {this->SetDataConfiguration(YZPLANE);}
00130   void SetDataConfigurationToXZPlane()
00131     {this->SetDataConfiguration(XZPLANE);}
00132   void SetDataConfigurationToXYZVolume()
00133     {this->SetDataConfiguration(XYZVOLUME);}
00135 
00137 
00143   vtkSetClampMacro(CollapseDimensionRatio,double,0.0,1.0);
00144   vtkGetMacro(CollapseDimensionRatio,double);
00146 
00148 
00152   void SetLODFilter(vtkQuadricClustering *lodFilter);
00153   vtkGetObjectMacro(LODFilter,vtkQuadricClustering);
00155 
00157 
00163   vtkSetClampMacro(MaximumDisplayListSize,int,1000,VTK_LARGE_INTEGER);
00164   vtkGetMacro(MaximumDisplayListSize,int);
00166 
00167 //BTX
00168   enum PropTypeEnum
00169   {
00170     FOLLOWER=0,
00171     ACTOR
00172   };
00173 //ETX
00175 
00177   vtkSetClampMacro(PropType,int,FOLLOWER,ACTOR);
00178   vtkGetMacro(PropType,int);
00179   void SetPropTypeToFollower()
00180     {this->SetPropType(FOLLOWER);}
00181   void SetPropTypeToActor()
00182     {this->SetPropType(ACTOR);}
00184 
00186 
00188   void SetCamera(vtkCamera*);
00189   vtkGetObjectMacro(Camera,vtkCamera);
00191 
00195   virtual void Render(vtkRenderer *, vtkMapper *);
00196 
00199   int RenderOpaqueGeometry(vtkViewport *viewport);
00200 
00204   void ReleaseGraphicsResources(vtkWindow *);
00205 
00207   void ShallowCopy(vtkProp *prop);
00208 
00209 protected:
00210   vtkQuadricLODActor();
00211   ~vtkQuadricLODActor();
00212 
00213   // Renders the LOD
00214   vtkActor          *LODActor;
00215   vtkPolyDataMapper *LODMapper;
00216 
00217   // Keep track of the requested interactive frame rate
00218   double CachedInteractiveFrameRate;
00219 
00220   // Support various strategies
00221   vtkQuadricClustering *LODFilter;
00222 
00223   // Specify whether the mapper's should be set in to Static mode.
00224   int Static;
00225   
00226   // The dimension of the data
00227   double CollapseDimensionRatio;
00228   int DataConfiguration;
00229   
00230   // Control whether this is a follower or regular actor
00231   int        PropType;
00232   vtkCamera *Camera;
00233 
00234   // Control what size (in terms of number of graphics primitives)
00235   // where display lists should be used.
00236   int MaximumDisplayListSize;
00237 
00238   // Specify to defer construction of the LOD.
00239   int DeferLODConstruction;
00240 
00241   // Keep track of building
00242   vtkTimeStamp BuildTime;
00243 
00244   // Helper function determines display list size
00245   vtkIdType GetDisplayListSize(vtkPolyData *pd);
00246   
00247 private:
00248   vtkQuadricLODActor(const vtkQuadricLODActor&);  // Not implemented.
00249   void operator=(const vtkQuadricLODActor&);  // Not implemented.
00250 };
00251 
00252 #endif
00253 
00254