VTK  9.3.0
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
79 #ifndef vtkDataSetSurfaceFilter_h
80 #define vtkDataSetSurfaceFilter_h
81 
82 #include "vtkFiltersGeometryModule.h" // For export macro
83 #include "vtkGeometryFilter.h" // To facilitate delegation
84 #include "vtkPolyDataAlgorithm.h"
85 
86 VTK_ABI_NAMESPACE_BEGIN
87 template <typename ArrayType>
88 class vtkSmartPointer;
89 
90 class vtkPointData;
91 class vtkPoints;
92 class vtkIdTypeArray;
93 class vtkImageData;
94 class vtkRectilinearGrid;
95 class vtkStructuredGrid;
97 
98 // Helper structure for hashing faces.
100 {
103  int numPts;
105 };
107 
108 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
109 {
110 public:
112 
117  void PrintSelf(ostream& os, vtkIndent indent) override;
118 
120 
125  vtkSetMacro(PieceInvariant, int);
126  vtkGetMacro(PieceInvariant, int);
128 
130 
136  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
137  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
138  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
139  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
140  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
141  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
143 
145 
151  vtkSetMacro(FastMode, bool);
152  vtkGetMacro(FastMode, bool);
153  vtkBooleanMacro(FastMode, bool);
155 
157 
163  vtkSetStringMacro(OriginalCellIdsName);
164  virtual const char* GetOriginalCellIdsName()
165  {
166  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
167  }
168  vtkSetStringMacro(OriginalPointIdsName);
169  virtual const char* GetOriginalPointIdsName()
170  {
171  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
172  }
174 
176 
187  vtkSetMacro(NonlinearSubdivisionLevel, int);
188  vtkGetMacro(NonlinearSubdivisionLevel, int);
190 
192 
197  vtkSetMacro(Delegation, vtkTypeBool);
198  vtkGetMacro(Delegation, vtkTypeBool);
199  vtkBooleanMacro(Delegation, vtkTypeBool);
201 
203 
207  virtual int StructuredExecute(
208  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
209 #ifdef VTK_USE_64BIT_IDS
210  virtual int StructuredExecute(
211  vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
212  {
213  vtkIdType ext[6];
214  vtkIdType wholeExt[6];
215  for (int cc = 0; cc < 6; cc++)
216  {
217  ext[cc] = ext32[cc];
218  wholeExt[cc] = wholeExt32[cc];
219  }
220  return this->StructuredExecute(input, output, ext, wholeExt);
221  }
222 #endif
223 
232  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
234 
238  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
239  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
240  vtkIdType* wholeExt, bool extractface[6]);
242 
249 #ifdef VTK_USE_64BIT_IDS
250  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
251  const int* wholeExt32, bool extractface[6])
252  {
253  vtkIdType ext[6];
254  vtkIdType wholeExt[6];
255  for (int cc = 0; cc < 6; cc++)
256  {
257  ext[cc] = ext32[cc];
258  wholeExt[cc] = wholeExt32[cc];
259  }
260  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
261  }
262 #endif
264 
265 protected:
268 
270 
273 
274  // Helper methods.
275 
284  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
285 
286  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
287  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
288 
289  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
290  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
291 
292  void InitializeQuadHash(vtkIdType numPoints);
294  virtual void InsertQuadInHash(
295  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
296  virtual void InsertTriInHash(
297  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
298  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
301 
306 
309  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
311  double* weights, vtkPoints* outPts, vtkPointData* outPD);
312 
313  class vtkEdgeInterpolationMap;
314 
315  vtkEdgeInterpolationMap* EdgeMap;
317  vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
318  vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
319  double* weights, vtkPoints* outPts, vtkPointData* outPD);
321 
322  // Better memory allocation for faces (hash)
326  // -----
329  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
330  // These indexes allow us to find the next available face.
333 
335 
337  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
338  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
341 
343  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
346 
349  bool FastMode;
350 
351 private:
352  int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
353  int UnstructuredGridExecuteInternal(
354  vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
355 
356  int StructuredExecuteNoBlanking(
357  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
358 
360  void operator=(const vtkDataSetSurfaceFilter&) = delete;
361 };
362 
363 VTK_ABI_NAMESPACE_END
364 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:50
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.
vtkIdType GetInterpolatedPointId(vtkDataSet *input, vtkCell *cell, double pcoords[3], double *weights, vtkPoints *outPts, vtkPointData *outPD)
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...
vtkFastGeomQuad * NewFastGeomQuad(int numPts)
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.
vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet *input, vtkCell *cell, double *weights, vtkPoints *outPts, vtkPointData *outPD)
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
vtkEdgeInterpolationMap * EdgeMap
virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad)
vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet *input, vtkCell *cell, double pcoords[3], double *weights, vtkPoints *outPts, vtkPointData *outPD)
void InitFastGeomQuadAllocation(vtkIdType numberOfCells)
void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId)
void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId)
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:53
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:30
represent and manipulate 3D points
Definition: vtkPoints.h:29
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
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
int vtkIdType
Definition: vtkType.h:315