VTK
|
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 "vtkRenderingLODModule.h" // For export macro 00056 #include "vtkActor.h" 00057 00058 class vtkQuadricClustering; 00059 class vtkPolyDataMapper; 00060 class vtkCamera; 00061 class vtkPolyData; 00062 00063 class VTKRENDERINGLOD_EXPORT vtkQuadricLODActor : public vtkActor 00064 { 00065 public: 00067 static vtkQuadricLODActor *New(); 00068 00070 00071 vtkTypeMacro(vtkQuadricLODActor, vtkActor); 00072 void PrintSelf(ostream& os, vtkIndent indent); 00074 00076 00080 vtkSetMacro(DeferLODConstruction, int); 00081 vtkGetMacro(DeferLODConstruction, int); 00082 vtkBooleanMacro(DeferLODConstruction, int); 00084 00086 00091 vtkSetMacro(Static, int); 00092 vtkGetMacro(Static, int); 00093 vtkBooleanMacro(Static, int); 00095 00096 //BTX 00097 enum DataConfigurationEnum 00098 { 00099 UNKNOWN = 0, 00100 XLINE, YLINE, ZLINE, 00101 XYPLANE, XZPLANE, YZPLANE, 00102 XYZVOLUME 00103 }; 00104 //ETX 00106 00117 vtkSetClampMacro(DataConfiguration, int, UNKNOWN,XYZVOLUME); 00118 vtkGetMacro(DataConfiguration, int); 00119 void SetDataConfigurationToUnknown() 00120 { this->SetDataConfiguration(UNKNOWN); } 00121 void SetDataConfigurationToXLine() 00122 { this->SetDataConfiguration(XLINE); } 00123 void SetDataConfigurationToYLine() 00124 { this->SetDataConfiguration(YLINE); } 00125 void SetDataConfigurationToZLine() 00126 { this->SetDataConfiguration(ZLINE); } 00127 void SetDataConfigurationToXYPlane() 00128 { this->SetDataConfiguration(XYPLANE); } 00129 void SetDataConfigurationToYZPlane() 00130 { this->SetDataConfiguration(YZPLANE); } 00131 void SetDataConfigurationToXZPlane() 00132 { this->SetDataConfiguration(XZPLANE); } 00133 void SetDataConfigurationToXYZVolume() 00134 { this->SetDataConfiguration(XYZVOLUME); } 00136 00138 00144 vtkSetClampMacro(CollapseDimensionRatio, double, 0.0, 1.0); 00145 vtkGetMacro(CollapseDimensionRatio, double); 00147 00149 00153 void SetLODFilter(vtkQuadricClustering *lodFilter); 00154 vtkGetObjectMacro(LODFilter, vtkQuadricClustering); 00156 00158 00164 vtkSetClampMacro(MaximumDisplayListSize, int, 1000, VTK_INT_MAX); 00165 vtkGetMacro(MaximumDisplayListSize, int); 00167 00168 //BTX 00169 enum PropTypeEnum 00170 { 00171 FOLLOWER = 0, 00172 ACTOR 00173 }; 00174 //ETX 00176 00178 vtkSetClampMacro(PropType, int, FOLLOWER, ACTOR); 00179 vtkGetMacro(PropType, int); 00180 void SetPropTypeToFollower() 00181 { this->SetPropType(FOLLOWER); } 00182 void SetPropTypeToActor() 00183 { this->SetPropType(ACTOR); } 00185 00187 00189 void SetCamera(vtkCamera*); 00190 vtkGetObjectMacro(Camera, vtkCamera); 00192 00196 virtual void Render(vtkRenderer *, vtkMapper *); 00197 00200 int RenderOpaqueGeometry(vtkViewport *viewport); 00201 00205 void ReleaseGraphicsResources(vtkWindow *); 00206 00208 void ShallowCopy(vtkProp *prop); 00209 00210 protected: 00211 vtkQuadricLODActor(); 00212 ~vtkQuadricLODActor(); 00213 00214 // Renders the LOD 00215 vtkActor *LODActor; 00216 vtkPolyDataMapper *LODMapper; 00217 00218 // Keep track of the requested interactive frame rate 00219 double CachedInteractiveFrameRate; 00220 00221 // Support various strategies 00222 vtkQuadricClustering *LODFilter; 00223 00224 // Specify whether the mapper's should be set in to Static mode. 00225 int Static; 00226 00227 // The dimension of the data 00228 double CollapseDimensionRatio; 00229 int DataConfiguration; 00230 00231 // Control whether this is a follower or regular actor 00232 int PropType; 00233 vtkCamera *Camera; 00234 00235 // Control what size (in terms of number of graphics primitives) 00236 // where display lists should be used. 00237 int MaximumDisplayListSize; 00238 00239 // Specify to defer construction of the LOD. 00240 int DeferLODConstruction; 00241 00242 // Keep track of building 00243 vtkTimeStamp BuildTime; 00244 00245 // Helper function determines display list size 00246 vtkIdType GetDisplayListSize(vtkPolyData *pd); 00247 00248 private: 00249 vtkQuadricLODActor(const vtkQuadricLODActor&); // Not implemented. 00250 void operator=(const vtkQuadricLODActor&); // Not implemented. 00251 }; 00252 00253 #endif