VTK
vtkDataSetSurfaceFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataSetSurfaceFilter.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 =========================================================================*/
33 #ifndef vtkDataSetSurfaceFilter_h
34 #define vtkDataSetSurfaceFilter_h
35 
36 #include "vtkFiltersGeometryModule.h" // For export macro
37 #include "vtkPolyDataAlgorithm.h"
38 
39 
40 class vtkPointData;
41 class vtkPoints;
42 class vtkIdTypeArray;
43 
44 //BTX
45 // Helper structure for hashing faces.
47 {
50  int numPts;
52 };
54 //ETX
55 
57 {
58 public:
59  static vtkDataSetSurfaceFilter *New();
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
67  vtkSetMacro(UseStrips, int);
68  vtkGetMacro(UseStrips, int);
69  vtkBooleanMacro(UseStrips, int);
71 
73 
76  vtkSetMacro(PieceInvariant, int);
77  vtkGetMacro(PieceInvariant, int);
79 
81 
87  vtkSetMacro(PassThroughCellIds,int);
88  vtkGetMacro(PassThroughCellIds,int);
89  vtkBooleanMacro(PassThroughCellIds,int);
90  vtkSetMacro(PassThroughPointIds,int);
91  vtkGetMacro(PassThroughPointIds,int);
92  vtkBooleanMacro(PassThroughPointIds,int);
94 
96 
100  vtkSetStringMacro(OriginalCellIdsName);
101  virtual const char *GetOriginalCellIdsName()
102  {
103  return ( this->OriginalCellIdsName
104  ? this->OriginalCellIdsName : "vtkOriginalCellIds");
105  }
106  vtkSetStringMacro(OriginalPointIdsName);
107  virtual const char *GetOriginalPointIdsName()
108  {
109  return ( this->OriginalPointIdsName
110  ? this->OriginalPointIdsName : "vtkOriginalPointIds");
111  }
113 
115 
125  vtkSetMacro(NonlinearSubdivisionLevel, int);
126  vtkGetMacro(NonlinearSubdivisionLevel, int);
128 
130 
132  virtual int StructuredExecute(vtkDataSet *input,
133  vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt);
134 #ifdef VTK_USE_64BIT_IDS
135  virtual int StructuredExecute(vtkDataSet *input,
136  vtkPolyData *output, int *ext32, int *wholeExt32)
137  {
138  vtkIdType ext[6]; vtkIdType wholeExt[6];
139  for (int cc=0; cc < 6; cc++)
140  {
141  ext[cc] = ext32[cc];
142  wholeExt[cc] = wholeExt32[cc];
143  }
144  return this->StructuredExecute(input, output, ext, wholeExt);
145  }
146 #endif
147  virtual int UnstructuredGridExecute(vtkDataSet *input,
148  vtkPolyData *output);
149  virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output);
150  virtual int UniformGridExecute(
151  vtkDataSet *input, vtkPolyData *output,
152  vtkIdType *ext, vtkIdType *wholeExt, bool extractface[6] );
153 #ifdef VTK_USE_64BIT_IDS
154  virtual int UniformGridExecute(vtkDataSet *input,
155  vtkPolyData *output, int *ext32, int *wholeExt32, bool extractface[6] )
156  {
157  vtkIdType ext[6]; vtkIdType wholeExt[6];
158  for (int cc=0; cc < 6; cc++)
159  {
160  ext[cc] = ext32[cc];
161  wholeExt[cc] = wholeExt32[cc];
162  }
163  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
164  }
165 #endif
166 
167 
168 protected:
171 
173 
175 
178 
179 
180  // Helper methods.
181 
183 
188  void EstimateStructuredDataArraySizes(
189  vtkIdType *ext, vtkIdType *wholeExt,
190  vtkIdType &numPoints, vtkIdType &numCells );
192 
193  void ExecuteFaceStrips(vtkDataSet *input, vtkPolyData *output,
194  int maxFlag, vtkIdType *ext,
195  int aAxis, int bAxis, int cAxis,
196  vtkIdType *wholeExt);
197 
198  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
199  int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis,
200  vtkIdType *wholeExt, bool checkVisibility );
201 
202  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
203  int maxFlag, vtkIdType *ext,
204  int aAxis, int bAxis, int cAxis,
205  vtkIdType *wholeExt);
206 
207  void InitializeQuadHash(vtkIdType numPoints);
208  void DeleteQuadHash();
209  virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d,
210  vtkIdType sourceId);
211  virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c,
212  vtkIdType sourceId, vtkIdType faceId = -1);
213  virtual void InsertPolygonInHash(vtkIdType* ids, int numpts,
214  vtkIdType sourceId);
215  void InitQuadHashTraversal();
216  vtkFastGeomQuad *GetNextVisibleQuadFromHash();
217 
222 
224  vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input,
225  vtkPoints *outPts, vtkPointData *outPD);
226 //BTX
227  class vtkEdgeInterpolationMap;
228 //ETX
229  vtkEdgeInterpolationMap *EdgeMap;
230  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB,
231  vtkDataSet *input, vtkCell *cell,
232  double pcoords[3], vtkPoints *outPts,
233  vtkPointData *outPD);
234 
236 
237  // Better memory allocation for faces (hash)
238  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
239  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
240  void DeleteAllFastGeomQuads();
241  // -----
244  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
245  // These indexes allow us to find the next available face.
248 
250 
252  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
253  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad);
256 
258  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
261 
263 
264 private:
265  vtkDataSetSurfaceFilter(const vtkDataSetSurfaceFilter&); // Not implemented.
266  void operator=(const vtkDataSetSurfaceFilter&); // Not implemented.
267 };
268 
269 #endif
virtual int FillInputPortInformation(int port, vtkInformation *info)
represent and manipulate point attribute data
Definition: vtkPointData.h:36
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual const char * GetOriginalCellIdsName()
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:247
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
abstract class to specify cell behavior
Definition: vtkCell.h:58
Superclass for algorithms that produce only polydata as output.
struct vtkFastGeomQuadStruct * Next
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual const char * GetOriginalPointIdsName()
Store zero or more vtkInformation instances.
#define VTKFILTERSGEOMETRY_EXPORT
Extracts outer (polygonal) surface.
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkEdgeInterpolationMap * EdgeMap