VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkClipHyperOctree.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkClipHyperOctree.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
62 #ifndef __vtkClipHyperOctree_h
63 #define __vtkClipHyperOctree_h
64 
65 #include "vtkFiltersHyperTreeModule.h" // For export macro
66 #include "vtkUnstructuredGridAlgorithm.h"
67 
68 class vtkImplicitFunction;
69 class vtkIncrementalPointLocator;
70 class vtkHyperOctreeCursor;
71 class vtkHyperOctree;
72 class vtkUnsignedCharArray;
73 class vtkIdTypeArray;
74 class vtkCellArray;
75 class vtkCellData;
76 class vtkPointData;
77 class vtkOrderedTriangulator;
78 class vtkDoubleArray;
79 class vtkTetra;
80 class vtkPoints;
81 class vtkPolygon;
83 
84 class VTKFILTERSHYPERTREE_EXPORT vtkClipHyperOctree : public vtkUnstructuredGridAlgorithm
85 {
86 public:
87  vtkTypeMacro(vtkClipHyperOctree,vtkUnstructuredGridAlgorithm);
88  void PrintSelf(ostream& os, vtkIndent indent);
89 
92  static vtkClipHyperOctree *New();
93 
95 
98  vtkSetMacro(Value,double);
99  vtkGetMacro(Value,double);
101 
103 
108  vtkSetMacro(InsideOut,int);
109  vtkGetMacro(InsideOut,int);
110  vtkBooleanMacro(InsideOut,int);
112 
114 
117  virtual void SetClipFunction(vtkImplicitFunction*);
118  vtkGetObjectMacro(ClipFunction,vtkImplicitFunction);
120 
122 
126  vtkSetMacro(GenerateClipScalars,int);
127  vtkGetMacro(GenerateClipScalars,int);
128  vtkBooleanMacro(GenerateClipScalars,int);
130 
132 
134  vtkSetMacro(GenerateClippedOutput,int);
135  vtkGetMacro(GenerateClippedOutput,int);
136  vtkBooleanMacro(GenerateClippedOutput,int);
138 
140  vtkUnstructuredGrid *GetClippedOutput();
141 
143 
145  void SetLocator(vtkIncrementalPointLocator *locator);
146  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
148 
151  void CreateDefaultLocator();
152 
154  unsigned long GetMTime();
155 
156 protected:
157  vtkClipHyperOctree(vtkImplicitFunction *cf=NULL);
159 
160  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
161 
163 
165  void ClipNode(vtkHyperOctreeCursor *cursor,
166  int level,
167  double bounds[6]);
169 
170  virtual int FillInputPortInformation(int port, vtkInformation *info);
171  vtkImplicitFunction *ClipFunction;
172 
173  vtkIncrementalPointLocator *Locator;
174  vtkIncrementalPointLocator *Locator2; // used for the clipped output
175 
177  double Value;
179 
181 
182  vtkHyperOctree *Input;
183  vtkUnstructuredGrid *Output;
184  vtkUnstructuredGrid *ClippedOutput;
185 
186  vtkUnsignedCharArray *Types[2];
187  vtkIdTypeArray *Locs[2];
188  vtkCellArray *Conn[2];
189  vtkCellData *InCD;
190  vtkCellData *OutCD[2];
191  vtkPointData *OutPD[2];
192  vtkOrderedTriangulator *Triangulator;
193 
194  vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
195 
196  vtkDoubleArray *CellScalars;
197  vtkTetra *Tetra;
198  vtkDoubleArray *TetScalars;
199 
200  vtkPoints *Pts;
201  vtkPolygon *Polygon;
202 
203  vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
204  vtkIdType TotalCounter;
205  vtkIdType TemplateCounter; // record the number of octants that succceed
206  // to use the template triangulator
207 
209 
210 private:
211  vtkClipHyperOctree(const vtkClipHyperOctree&); // Not implemented.
212  void operator=(const vtkClipHyperOctree&); // Not implemented.
213 };
214 
215 #endif
vtkImplicitFunction * ClipFunction
vtkHyperOctreeCursor * Sibling
vtkDoubleArray * CellScalars
vtkHyperOctree * Input
vtkOrderedTriangulator * Triangulator
vtkDoubleArray * TetScalars
A concrete implementation of vtkHyperOctreePointsGrabber used by vtkClipHyperOctree and vtkHyperOctre...
vtkIncrementalPointLocator * Locator
vtkHyperOctreeClipCutPointsGrabber * Grabber
vtkIncrementalPointLocator * Locator2
vtkUnstructuredGrid * ClippedOutput
vtkUnstructuredGrid * Output
clip an hyperoctree with user-specified implicit function or input scalar data