VTK  9.3.20240419
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
168 #ifndef vtkDataSetSurfaceFilter_h
169 #define vtkDataSetSurfaceFilter_h
170 
171 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
172 #include "vtkFiltersGeometryModule.h" // For export macro
173 #include "vtkGeometryFilter.h" // To facilitate delegation
174 #include "vtkPolyDataAlgorithm.h"
175 
176 VTK_ABI_NAMESPACE_BEGIN
177 template <typename ArrayType>
178 class vtkSmartPointer;
179 
180 class vtkPointData;
181 class vtkPoints;
182 class vtkIdTypeArray;
183 class vtkImageData;
184 class vtkRectilinearGrid;
185 class vtkStructuredGrid;
187 
188 // Helper structure for hashing faces.
190 {
193  int numPts;
195 };
197 
198 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
199 {
200 public:
202 
207  void PrintSelf(ostream& os, vtkIndent indent) override;
208 
210 
215  vtkSetMacro(PieceInvariant, int);
216  vtkGetMacro(PieceInvariant, int);
218 
220 
226  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
227  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
228  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
229  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
230  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
231  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
233 
235 
241  vtkSetMacro(FastMode, bool);
242  vtkGetMacro(FastMode, bool);
243  vtkBooleanMacro(FastMode, bool);
245 
247 
253  vtkSetStringMacro(OriginalCellIdsName);
254  virtual const char* GetOriginalCellIdsName()
255  {
256  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
257  }
258  vtkSetStringMacro(OriginalPointIdsName);
259  virtual const char* GetOriginalPointIdsName()
260  {
261  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
262  }
264 
266 
277  vtkSetMacro(NonlinearSubdivisionLevel, int);
278  vtkGetMacro(NonlinearSubdivisionLevel, int);
280 
282 
288  vtkSetMacro(MatchBoundariesIgnoringCellOrder, int);
289  vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
291 
293 
298  vtkSetMacro(Delegation, vtkTypeBool);
299  vtkGetMacro(Delegation, vtkTypeBool);
300  vtkBooleanMacro(Delegation, vtkTypeBool);
302 
304 
308  virtual int StructuredExecute(
309  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
310 #ifdef VTK_USE_64BIT_IDS
311  virtual int StructuredExecute(
312  vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
313  {
314  vtkIdType ext[6];
315  vtkIdType wholeExt[6];
316  for (int cc = 0; cc < 6; cc++)
317  {
318  ext[cc] = ext32[cc];
319  wholeExt[cc] = wholeExt32[cc];
320  }
321  return this->StructuredExecute(input, output, ext, wholeExt);
322  }
323 #endif
324 
333  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
335 
339  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
340  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
341  vtkIdType* wholeExt, bool extractface[6]);
343 
350 #ifdef VTK_USE_64BIT_IDS
351  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
352  const int* wholeExt32, bool extractface[6])
353  {
354  vtkIdType ext[6];
355  vtkIdType wholeExt[6];
356  for (int cc = 0; cc < 6; cc++)
357  {
358  ext[cc] = ext32[cc];
359  wholeExt[cc] = wholeExt32[cc];
360  }
361  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
362  }
363 #endif
365 
366 protected:
369 
371 
374 
375  // Helper methods.
376 
385  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
386 
387  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
388  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
389 
390  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
391  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
392 
393  void InitializeQuadHash(vtkIdType numPoints);
395  virtual void InsertQuadInHash(
396  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
397  virtual void InsertTriInHash(
398  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
399  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
402 
407 
410  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
411 
412  VTK_DEPRECATED_IN_9_3_0("This function is deprecated since reserved for private usage.")
413  vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
414  double* weights, vtkPoints* outPts, vtkPointData* outPD);
415 
416  class vtkEdgeInterpolationMap;
417 
418  vtkEdgeInterpolationMap* EdgeMap;
419  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
420  vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
421  vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
422  double* weights, vtkPoints* outPts, vtkPointData* outPD);
423  vtkIdType NumberOfNewCells;
424 
425  // Better memory allocation for faces (hash)
426  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
427  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
428  void DeleteAllFastGeomQuads();
429  // -----
430  vtkIdType FastGeomQuadArrayLength;
431  vtkIdType NumberOfFastGeomQuadArrays;
432  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
433  // These indexes allow us to find the next available face.
434  vtkIdType NextArrayIndex;
435  vtkIdType NextQuadIndex;
436 
437  int PieceInvariant;
438 
439  vtkTypeBool PassThroughCellIds;
440  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
441  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
442  vtkIdTypeArray* OriginalCellIds;
443  char* OriginalCellIdsName;
444 
445  vtkTypeBool PassThroughPointIds;
446  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
447  vtkIdTypeArray* OriginalPointIds;
448  char* OriginalPointIdsName;
449 
450  int NonlinearSubdivisionLevel;
451  int MatchBoundariesIgnoringCellOrder;
452  vtkTypeBool Delegation;
453  bool FastMode;
454 
455 private:
456  int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
457  int UnstructuredGridExecuteInternal(
458  vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
459 
460  int StructuredExecuteNoBlanking(
461  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
462 
463  vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
464  double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
465 
467  void operator=(const vtkDataSetSurfaceFilter&) = delete;
468 };
469 
470 VTK_ABI_NAMESPACE_END
471 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:130
Extracts outer surface (as vtkPolyData) of any dataset.
vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input, vtkPoints *outPts, vtkPointData *outPD)
void PrintSelf(ostream &os, vtkIndent indent) override
Statndard methods for object instantiation, type information, and printing.
void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output, int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis, vtkIdType *wholeExt)
static vtkDataSetSurfaceFilter * New()
Statndard methods for object instantiation, type information, and printing.
int UnstructuredGridExecute(vtkDataSet *input, vtkPolyData *output, vtkGeometryFilterHelper *info)
Optimized UnstructuredGridExecute function for vtkUnstructuredGrid and subclass instances only.
virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output)
Execute the filter on input and store the result in output.
virtual void InsertPolygonInHash(const vtkIdType *ids, int numpts, vtkIdType sourceId)
virtual const char * GetOriginalCellIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output, int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis, vtkIdType *wholeExt, bool checkVisibility)
virtual int UniformGridExecute(vtkDataSet *input, vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt, bool extractface[6])
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
~vtkDataSetSurfaceFilter() override
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void EstimateStructuredDataArraySizes(vtkIdType *ext, vtkIdType *wholeExt, vtkIdType &numPoints, vtkIdType &numCells)
Estimates the total number of points & cells on the surface to render ext – the extent of the structu...
virtual int StructuredExecute(vtkDataSet *input, vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
virtual int UnstructuredGridExecute(vtkDataSet *input, vtkPolyData *output)
Execute the filter on input and store the result in output.
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
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...
virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId=-1)
void InitializeQuadHash(vtkIdType numPoints)
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:156
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:140
represent and manipulate 3D points
Definition: vtkPoints.h:139
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:181
a dataset that is topologically regular with variable spacing in the three coordinate directions
Hold a reference to a vtkObjectBase instance.
topologically regular array of data
dataset represents arbitrary combinations of all possible cell types.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
struct vtkFastGeomQuadStruct * Next
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition: vtkType.h:315