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 =========================================================================*/
31 #ifndef vtkDataSetSurfaceFilter_h
32 #define vtkDataSetSurfaceFilter_h
33 
34 #include "vtkFiltersGeometryModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 
37 class vtkPointData;
38 class vtkPoints;
39 class vtkIdTypeArray;
40 class vtkStructuredGrid;
41 
42 // Helper structure for hashing faces.
44 {
47  int numPts;
49 };
51 
52 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
53 {
54 public:
55  static vtkDataSetSurfaceFilter *New();
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
65  vtkSetMacro(UseStrips, vtkTypeBool);
66  vtkGetMacro(UseStrips, vtkTypeBool);
67  vtkBooleanMacro(UseStrips, vtkTypeBool);
69 
71 
76  vtkSetMacro(PieceInvariant, int);
77  vtkGetMacro(PieceInvariant, int);
79 
81 
89  vtkSetMacro(PassThroughCellIds,vtkTypeBool);
90  vtkGetMacro(PassThroughCellIds,vtkTypeBool);
91  vtkBooleanMacro(PassThroughCellIds,vtkTypeBool);
92  vtkSetMacro(PassThroughPointIds,vtkTypeBool);
93  vtkGetMacro(PassThroughPointIds,vtkTypeBool);
94  vtkBooleanMacro(PassThroughPointIds,vtkTypeBool);
96 
98 
104  vtkSetStringMacro(OriginalCellIdsName);
105  virtual const char *GetOriginalCellIdsName()
106  {
107  return ( this->OriginalCellIdsName
108  ? this->OriginalCellIdsName : "vtkOriginalCellIds");
109  }
110  vtkSetStringMacro(OriginalPointIdsName);
111  virtual const char *GetOriginalPointIdsName()
112  {
113  return ( this->OriginalPointIdsName
114  ? this->OriginalPointIdsName : "vtkOriginalPointIds");
115  }
117 
119 
130  vtkSetMacro(NonlinearSubdivisionLevel, int);
131  vtkGetMacro(NonlinearSubdivisionLevel, int);
133 
135 
139  virtual int StructuredExecute(vtkDataSet *input,
140  vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt);
141 #ifdef VTK_USE_64BIT_IDS
142  virtual int StructuredExecute(vtkDataSet *input,
143  vtkPolyData *output, int *ext32, int *wholeExt32)
144  {
145  vtkIdType ext[6]; vtkIdType wholeExt[6];
146  for (int cc=0; cc < 6; cc++)
147  {
148  ext[cc] = ext32[cc];
149  wholeExt[cc] = wholeExt32[cc];
150  }
151  return this->StructuredExecute(input, output, ext, wholeExt);
152  }
153 #endif
154  virtual int UnstructuredGridExecute(vtkDataSet *input,
155  vtkPolyData *output);
156  virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output);
157  virtual int StructuredWithBlankingExecute(vtkStructuredGrid *input, vtkPolyData *output);
158  virtual int UniformGridExecute(
159  vtkDataSet *input, vtkPolyData *output,
160  vtkIdType *ext, vtkIdType *wholeExt, bool extractface[6] );
161 #ifdef VTK_USE_64BIT_IDS
162  virtual int UniformGridExecute(vtkDataSet *input,
163  vtkPolyData *output, int *ext32, int *wholeExt32, bool extractface[6] )
164  {
165  vtkIdType ext[6]; vtkIdType wholeExt[6];
166  for (int cc=0; cc < 6; cc++)
167  {
168  ext[cc] = ext32[cc];
169  wholeExt[cc] = wholeExt32[cc];
170  }
171  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
172  }
173 #endif
174 
175 
176 protected:
178  ~vtkDataSetSurfaceFilter() override;
179 
181 
182  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
183 
184  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
185  int FillInputPortInformation(int port, vtkInformation *info) override;
186 
187 
188  // Helper methods.
189 
197  void EstimateStructuredDataArraySizes(
198  vtkIdType *ext, vtkIdType *wholeExt,
199  vtkIdType &numPoints, vtkIdType &numCells );
200 
201  void ExecuteFaceStrips(vtkDataSet *input, vtkPolyData *output,
202  int maxFlag, vtkIdType *ext,
203  int aAxis, int bAxis, int cAxis,
204  vtkIdType *wholeExt);
205 
206  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
207  int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis,
208  vtkIdType *wholeExt, bool checkVisibility );
209 
210  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
211  int maxFlag, vtkIdType *ext,
212  int aAxis, int bAxis, int cAxis,
213  vtkIdType *wholeExt);
214 
215  void InitializeQuadHash(vtkIdType numPoints);
216  void DeleteQuadHash();
217  virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d,
218  vtkIdType sourceId);
219  virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c,
220  vtkIdType sourceId, vtkIdType faceId = -1);
221  virtual void InsertPolygonInHash(vtkIdType* ids, int numpts,
222  vtkIdType sourceId);
223  void InitQuadHashTraversal();
224  vtkFastGeomQuad *GetNextVisibleQuadFromHash();
225 
230 
232  vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input,
233  vtkPoints *outPts, vtkPointData *outPD);
234 
235  class vtkEdgeInterpolationMap;
236 
237  vtkEdgeInterpolationMap *EdgeMap;
238  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB,
239  vtkDataSet *input, vtkCell *cell,
240  double pcoords[3], vtkPoints *outPts,
241  vtkPointData *outPD);
242 
244 
245  // Better memory allocation for faces (hash)
246  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
247  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
248  void DeleteAllFastGeomQuads();
249  // -----
252  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
253  // These indexes allow us to find the next available face.
256 
258 
260  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
261  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad);
264 
266  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
269 
271 
272 private:
274  void operator=(const vtkDataSetSurfaceFilter&) = delete;
275 };
276 
277 #endif
represent and manipulate point attribute data
Definition: vtkPointData.h:37
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual const char * GetOriginalCellIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
int vtkTypeBool
Definition: vtkABI.h:69
abstract class to specify cell behavior
Definition: vtkCell.h:59
Superclass for algorithms that produce only polydata as output.
struct vtkFastGeomQuadStruct * Next
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically regular array of data
virtual const char * GetOriginalPointIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
Store zero or more vtkInformation instances.
Extracts outer (polygonal) surface.
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkEdgeInterpolationMap * EdgeMap