VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkClipHyperOctree.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 =========================================================================*/ 00062 #ifndef __vtkClipHyperOctree_h 00063 #define __vtkClipHyperOctree_h 00064 00065 #include "vtkFiltersHyperTreeModule.h" // For export macro 00066 #include "vtkUnstructuredGridAlgorithm.h" 00067 00068 class vtkImplicitFunction; 00069 class vtkIncrementalPointLocator; 00070 class vtkHyperOctreeCursor; 00071 class vtkHyperOctree; 00072 class vtkUnsignedCharArray; 00073 class vtkIdTypeArray; 00074 class vtkCellArray; 00075 class vtkCellData; 00076 class vtkPointData; 00077 class vtkOrderedTriangulator; 00078 class vtkDoubleArray; 00079 class vtkTetra; 00080 class vtkPoints; 00081 class vtkPolygon; 00082 class vtkHyperOctreeClipCutPointsGrabber; 00083 00084 class VTKFILTERSHYPERTREE_EXPORT vtkClipHyperOctree : public vtkUnstructuredGridAlgorithm 00085 { 00086 public: 00087 vtkTypeMacro(vtkClipHyperOctree,vtkUnstructuredGridAlgorithm); 00088 void PrintSelf(ostream& os, vtkIndent indent); 00089 00092 static vtkClipHyperOctree *New(); 00093 00095 00098 vtkSetMacro(Value,double); 00099 vtkGetMacro(Value,double); 00101 00103 00108 vtkSetMacro(InsideOut,int); 00109 vtkGetMacro(InsideOut,int); 00110 vtkBooleanMacro(InsideOut,int); 00112 00114 00117 virtual void SetClipFunction(vtkImplicitFunction*); 00118 vtkGetObjectMacro(ClipFunction,vtkImplicitFunction); 00120 00122 00126 vtkSetMacro(GenerateClipScalars,int); 00127 vtkGetMacro(GenerateClipScalars,int); 00128 vtkBooleanMacro(GenerateClipScalars,int); 00130 00132 00134 vtkSetMacro(GenerateClippedOutput,int); 00135 vtkGetMacro(GenerateClippedOutput,int); 00136 vtkBooleanMacro(GenerateClippedOutput,int); 00138 00140 vtkUnstructuredGrid *GetClippedOutput(); 00141 00143 00145 void SetLocator(vtkIncrementalPointLocator *locator); 00146 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00148 00151 void CreateDefaultLocator(); 00152 00154 unsigned long GetMTime(); 00155 00156 protected: 00157 vtkClipHyperOctree(vtkImplicitFunction *cf=NULL); 00158 ~vtkClipHyperOctree(); 00159 00160 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00161 00163 00165 void ClipNode(vtkHyperOctreeCursor *cursor, 00166 int level, 00167 double bounds[6]); 00169 00170 virtual int FillInputPortInformation(int port, vtkInformation *info); 00171 vtkImplicitFunction *ClipFunction; 00172 00173 vtkIncrementalPointLocator *Locator; 00174 vtkIncrementalPointLocator *Locator2; // used for the clipped output 00175 00176 int InsideOut; 00177 double Value; 00178 int GenerateClipScalars; 00179 00180 int GenerateClippedOutput; 00181 00182 vtkHyperOctree *Input; 00183 vtkUnstructuredGrid *Output; 00184 vtkUnstructuredGrid *ClippedOutput; 00185 00186 vtkUnsignedCharArray *Types[2]; 00187 vtkIdTypeArray *Locs[2]; 00188 vtkCellArray *Conn[2]; 00189 vtkCellData *InCD; 00190 vtkCellData *OutCD[2]; 00191 vtkPointData *OutPD[2]; 00192 vtkOrderedTriangulator *Triangulator; 00193 00194 vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop 00195 00196 vtkDoubleArray *CellScalars; 00197 vtkTetra *Tetra; 00198 vtkDoubleArray *TetScalars; 00199 00200 vtkPoints *Pts; 00201 vtkPolygon *Polygon; 00202 00203 vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant 00204 vtkIdType TotalCounter; 00205 vtkIdType TemplateCounter; // record the number of octants that succceed 00206 // to use the template triangulator 00207 00208 vtkHyperOctreeClipCutPointsGrabber *Grabber; 00209 00210 private: 00211 vtkClipHyperOctree(const vtkClipHyperOctree&); // Not implemented. 00212 void operator=(const vtkClipHyperOctree&); // Not implemented. 00213 }; 00214 00215 #endif