VTK  9.7.1
vtkDataSetSurfaceFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
82 #ifndef vtkDataSetSurfaceFilter_h
83 #define vtkDataSetSurfaceFilter_h
84 
85 #include "vtkFiltersGeometryModule.h" // For export macro
86 #include "vtkGeometryFilter.h" // To facilitate delegation
87 #include "vtkPolyDataAlgorithm.h"
88 
89 VTK_ABI_NAMESPACE_BEGIN
90 template <typename ArrayType>
91 class vtkSmartPointer;
92 
93 class vtkPointData;
94 class vtkPoints;
95 class vtkIdTypeArray;
96 class vtkImageData;
97 class vtkRectilinearGrid;
98 class vtkStructuredGrid;
100 
101 // Helper structure for hashing faces.
103 {
106  int numPts;
108 };
110 
111 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
112 {
113 public:
115 
118  static vtkDataSetSurfaceFilter* New();
120  void PrintSelf(ostream& os, vtkIndent indent) override;
121 
123 
128  vtkSetMacro(PieceInvariant, int);
129  vtkGetMacro(PieceInvariant, int);
131 
133 
139  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
140  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
141  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
142  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
143  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
144  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
146 
148 
154  vtkSetMacro(FastMode, bool);
155  vtkGetMacro(FastMode, bool);
156  vtkBooleanMacro(FastMode, bool);
158 
160 
166  vtkSetStringMacro(OriginalCellIdsName);
167  virtual const char* GetOriginalCellIdsName()
168  {
169  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
170  }
171  vtkSetStringMacro(OriginalPointIdsName);
172  virtual const char* GetOriginalPointIdsName()
173  {
174  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
175  }
177 
179 
190  vtkSetMacro(NonlinearSubdivisionLevel, int);
191  vtkGetMacro(NonlinearSubdivisionLevel, int);
193 
195 
201  vtkSetMacro(MatchBoundariesIgnoringCellOrder, int);
202  vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
204 
206 
209  vtkSetMacro(AllowInterpolation, vtkTypeBool);
210  vtkGetMacro(AllowInterpolation, vtkTypeBool);
211  vtkBooleanMacro(AllowInterpolation, vtkTypeBool);
213 
215 
220  vtkSetMacro(Delegation, vtkTypeBool);
221  vtkGetMacro(Delegation, vtkTypeBool);
222  vtkBooleanMacro(Delegation, vtkTypeBool);
224 
226 
230  virtual int StructuredExecute(
231  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
232 #ifdef VTK_USE_64BIT_IDS
233  virtual int StructuredExecute(
234  vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
235  {
236  vtkIdType ext[6];
237  vtkIdType wholeExt[6];
238  for (int cc = 0; cc < 6; cc++)
239  {
240  ext[cc] = ext32[cc];
241  wholeExt[cc] = wholeExt32[cc];
242  }
243  return this->StructuredExecute(input, output, ext, wholeExt);
244  }
245 #endif
246 
255  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
257 
261  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
262  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
263  vtkIdType* wholeExt, bool extractface[6]);
265 
270  int UnstructuredGridExecute(
272 #ifdef VTK_USE_64BIT_IDS
273  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
274  const int* wholeExt32, bool extractface[6])
275  {
276  vtkIdType ext[6];
277  vtkIdType wholeExt[6];
278  for (int cc = 0; cc < 6; cc++)
279  {
280  ext[cc] = ext32[cc];
281  wholeExt[cc] = wholeExt32[cc];
282  }
283  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
284  }
285 #endif
286 
288 protected:
290  ~vtkDataSetSurfaceFilter() override;
291 
293 
295  int FillInputPortInformation(int port, vtkInformation* info) override;
296 
297  // Helper methods.
298 
306  void EstimateStructuredDataArraySizes(
307  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
308 
309  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
310  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
311 
312  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
313  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
314 
315  void InitializeQuadHash(vtkIdType numPoints);
316  void DeleteQuadHash();
317  virtual void InsertQuadInHash(
318  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
319  virtual void InsertTriInHash(
320  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
321  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
322  void InitQuadHashTraversal();
323  vtkFastGeomQuad* GetNextVisibleQuadFromHash();
324 
329 
331  vtkIdType GetOutputPointId(
332  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
333 
334  class vtkEdgeInterpolationMap;
335 
336  vtkEdgeInterpolationMap* EdgeMap;
337  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
338  vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
339  vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
340  double* weights, vtkPoints* outPts, vtkPointData* outPD);
342 
343  // Better memory allocation for faces (hash)
344  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
345  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
346  void DeleteAllFastGeomQuads();
347  // -----
350  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
351  // These indexes allow us to find the next available face.
354 
356 
358  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
359  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
362 
364  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
367 
372  bool FastMode;
373 
374 private:
375  int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
376  int UnstructuredGridExecuteInternal(
377  vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
378 
379  int StructuredExecuteNoBlanking(
380  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
381 
382  vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
383  double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
384 
386  void operator=(const vtkDataSetSurfaceFilter&) = delete;
387 };
388 
389 VTK_ABI_NAMESPACE_END
390 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
represent and manipulate point attribute data
Definition: vtkPointData.h:30
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
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
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
abstract class to specify cell behavior
Definition: vtkCell.h:50
Superclass for algorithms that produce only polydata as output.
struct vtkFastGeomQuadStruct * Next
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
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.
Extracts outer surface (as vtkPolyData) of any dataset.
dataset represents arbitrary combinations of all possible cell types.
represent and manipulate 3D points
Definition: vtkPoints.h:30
vtkEdgeInterpolationMap * EdgeMap
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.