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 =========================================================================*/
34 #ifndef vtkDataSetSurfaceFilter_h
35 #define vtkDataSetSurfaceFilter_h
36 
37 #include "vtkFiltersGeometryModule.h" // For export macro
38 #include "vtkPolyDataAlgorithm.h"
39 
40 class vtkPointData;
41 class vtkPoints;
42 class vtkIdTypeArray;
43 class vtkStructuredGrid;
44 
45 // Helper structure for hashing faces.
47 {
50  int numPts;
52 };
54 
55 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
56 {
57 public:
58  static vtkDataSetSurfaceFilter *New();
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  vtkSetMacro(UseStrips, int);
69  vtkGetMacro(UseStrips, int);
70  vtkBooleanMacro(UseStrips, int);
72 
74 
79  vtkSetMacro(PieceInvariant, int);
80  vtkGetMacro(PieceInvariant, int);
82 
84 
92  vtkSetMacro(PassThroughCellIds,int);
93  vtkGetMacro(PassThroughCellIds,int);
94  vtkBooleanMacro(PassThroughCellIds,int);
95  vtkSetMacro(PassThroughPointIds,int);
96  vtkGetMacro(PassThroughPointIds,int);
97  vtkBooleanMacro(PassThroughPointIds,int);
99 
101 
107  vtkSetStringMacro(OriginalCellIdsName);
108  virtual const char *GetOriginalCellIdsName()
109  {
110  return ( this->OriginalCellIdsName
111  ? this->OriginalCellIdsName : "vtkOriginalCellIds");
112  }
113  vtkSetStringMacro(OriginalPointIdsName);
114  virtual const char *GetOriginalPointIdsName()
115  {
116  return ( this->OriginalPointIdsName
117  ? this->OriginalPointIdsName : "vtkOriginalPointIds");
118  }
120 
122 
133  vtkSetMacro(NonlinearSubdivisionLevel, int);
134  vtkGetMacro(NonlinearSubdivisionLevel, int);
136 
138 
142  virtual int StructuredExecute(vtkDataSet *input,
143  vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt);
144 #ifdef VTK_USE_64BIT_IDS
145  virtual int StructuredExecute(vtkDataSet *input,
146  vtkPolyData *output, int *ext32, int *wholeExt32)
147  {
148  vtkIdType ext[6]; vtkIdType wholeExt[6];
149  for (int cc=0; cc < 6; cc++)
150  {
151  ext[cc] = ext32[cc];
152  wholeExt[cc] = wholeExt32[cc];
153  }
154  return this->StructuredExecute(input, output, ext, wholeExt);
155  }
156 #endif
157  virtual int UnstructuredGridExecute(vtkDataSet *input,
158  vtkPolyData *output);
159  virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output);
160  virtual int StructuredWithBlankingExecute(vtkStructuredGrid *input, vtkPolyData *output);
161  virtual int UniformGridExecute(
162  vtkDataSet *input, vtkPolyData *output,
163  vtkIdType *ext, vtkIdType *wholeExt, bool extractface[6] );
164 #ifdef VTK_USE_64BIT_IDS
165  virtual int UniformGridExecute(vtkDataSet *input,
166  vtkPolyData *output, int *ext32, int *wholeExt32, bool extractface[6] )
167  {
168  vtkIdType ext[6]; vtkIdType wholeExt[6];
169  for (int cc=0; cc < 6; cc++)
170  {
171  ext[cc] = ext32[cc];
172  wholeExt[cc] = wholeExt32[cc];
173  }
174  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
175  }
176 #endif
177 
178 
179 protected:
181  ~vtkDataSetSurfaceFilter() override;
182 
184 
186 
188  int FillInputPortInformation(int port, vtkInformation *info) override;
189 
190 
191  // Helper methods.
192 
200  void EstimateStructuredDataArraySizes(
201  vtkIdType *ext, vtkIdType *wholeExt,
202  vtkIdType &numPoints, vtkIdType &numCells );
203 
204  void ExecuteFaceStrips(vtkDataSet *input, vtkPolyData *output,
205  int maxFlag, vtkIdType *ext,
206  int aAxis, int bAxis, int cAxis,
207  vtkIdType *wholeExt);
208 
209  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
210  int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis,
211  vtkIdType *wholeExt, bool checkVisibility );
212 
213  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
214  int maxFlag, vtkIdType *ext,
215  int aAxis, int bAxis, int cAxis,
216  vtkIdType *wholeExt);
217 
218  void InitializeQuadHash(vtkIdType numPoints);
219  void DeleteQuadHash();
220  virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d,
221  vtkIdType sourceId);
222  virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c,
223  vtkIdType sourceId, vtkIdType faceId = -1);
224  virtual void InsertPolygonInHash(vtkIdType* ids, int numpts,
225  vtkIdType sourceId);
226  void InitQuadHashTraversal();
227  vtkFastGeomQuad *GetNextVisibleQuadFromHash();
228 
233 
235  vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input,
236  vtkPoints *outPts, vtkPointData *outPD);
237 
238  class vtkEdgeInterpolationMap;
239 
240  vtkEdgeInterpolationMap *EdgeMap;
241  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB,
242  vtkDataSet *input, vtkCell *cell,
243  double pcoords[3], vtkPoints *outPts,
244  vtkPointData *outPD);
245 
247 
248  // Better memory allocation for faces (hash)
249  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
250  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
251  void DeleteAllFastGeomQuads();
252  // -----
255  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
256  // These indexes allow us to find the next available face.
259 
261 
263  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
264  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad);
267 
269  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
272 
274 
275 private:
277  void operator=(const vtkDataSetSurfaceFilter&) = delete;
278 };
279 
280 #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 int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
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:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
static vtkPolyDataAlgorithm * New()
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
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
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
topologically regular array of data
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
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.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Extracts outer (polygonal) surface.
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkEdgeInterpolationMap * EdgeMap
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.