VTK  9.4.20251007
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
78
79#ifndef vtkDataSetSurfaceFilter_h
80#define vtkDataSetSurfaceFilter_h
81
82#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
83#include "vtkFiltersGeometryModule.h" // For export macro
84#include "vtkGeometryFilter.h" // To facilitate delegation
86
87VTK_ABI_NAMESPACE_BEGIN
88template <typename ArrayType>
89class vtkSmartPointer;
90
91class vtkPointData;
92class vtkPoints;
93class vtkIdTypeArray;
94class vtkImageData;
98
99// Helper structure for hashing faces.
108
109class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
110{
111public:
113
118 void PrintSelf(ostream& os, vtkIndent indent) override;
119
121
126 vtkSetMacro(PieceInvariant, int);
127 vtkGetMacro(PieceInvariant, int);
129
131
144
146
152 vtkSetMacro(FastMode, bool);
153 vtkGetMacro(FastMode, bool);
154 vtkBooleanMacro(FastMode, bool);
156
158
164 vtkSetStringMacro(OriginalCellIdsName);
165 virtual const char* GetOriginalCellIdsName()
166 {
167 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
168 }
169 vtkSetStringMacro(OriginalPointIdsName);
170 virtual const char* GetOriginalPointIdsName()
171 {
172 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
173 }
174
175
177
188 vtkSetMacro(NonlinearSubdivisionLevel, int);
189 vtkGetMacro(NonlinearSubdivisionLevel, int);
191
193
202
204
211
213
218 vtkSetMacro(Delegation, vtkTypeBool);
219 vtkGetMacro(Delegation, vtkTypeBool);
220 vtkBooleanMacro(Delegation, vtkTypeBool);
222
224
228 virtual int StructuredExecute(
229 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
230#ifdef VTK_USE_64BIT_IDS
231 virtual int StructuredExecute(
232 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
233 {
234 vtkIdType ext[6];
235 vtkIdType wholeExt[6];
236 for (int cc = 0; cc < 6; cc++)
237 {
238 ext[cc] = ext32[cc];
239 wholeExt[cc] = wholeExt32[cc];
240 }
241 return this->StructuredExecute(input, output, ext, wholeExt);
242 }
243#endif
244
253 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
255
259 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
260 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
261 vtkIdType* wholeExt, bool extractface[6]);
263
269 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
270#ifdef VTK_USE_64BIT_IDS
271 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
272 const int* wholeExt32, bool extractface[6])
273 {
274 vtkIdType ext[6];
275 vtkIdType wholeExt[6];
276 for (int cc = 0; cc < 6; cc++)
277 {
278 ext[cc] = ext32[cc];
279 wholeExt[cc] = wholeExt32[cc];
280 }
281 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
282 }
283#endif
285
286protected:
289
291
293 int FillInputPortInformation(int port, vtkInformation* info) override;
294
295 // Helper methods.
296
305 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
306
307 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
308 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
309
310 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
311 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
312
315 virtual void InsertQuadInHash(
316 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
317 virtual void InsertTriInHash(
318 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
319 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
322
327
330 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
331
332 VTK_DEPRECATED_IN_9_3_0("This function is deprecated since reserved for private usage.")
334 double* weights, vtkPoints* outPts, vtkPointData* outPD);
335
336 class vtkEdgeInterpolationMap;
337
338 vtkEdgeInterpolationMap* EdgeMap;
340 vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
341 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
342 double* weights, vtkPoints* outPts, vtkPointData* outPD);
344
345 // Better memory allocation for faces (hash)
349 // -----
352 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
353 // These indexes allow us to find the next available face.
356
358
360 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
361 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
364
366 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
369
375
376private:
377 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
378 int UnstructuredGridExecuteInternal(
379 vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
380
381 int StructuredExecuteNoBlanking(
382 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
383
385 double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
386
388 void operator=(const vtkDataSetSurfaceFilter&) = delete;
389};
390
391VTK_ABI_NAMESPACE_END
392#endif
abstract class to specify cell behavior
Definition vtkCell.h:51
static vtkDataSetSurfaceFilter * New()
Statndard methods for object instantiation, type information, and printing.
vtkFastGeomQuad * NewFastGeomQuad(int numPts)
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)
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)
vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet *input, vtkCell *cell, double *pcoords, double *weights, vtkPoints *outPts, vtkPointData *outPD)
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 const char * GetOriginalCellIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
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.
virtual const char * GetOriginalPointIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet *input, vtkCell *cell, double *weights, vtkPoints *outPts, vtkPointData *outPD)
vtkEdgeInterpolationMap * EdgeMap
void InitFastGeomQuadAllocation(vtkIdType numberOfCells)
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
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 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:57
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
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
represent and manipulate 3D points
Definition vtkPoints.h:30
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
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.
struct vtkFastGeomQuadStruct * Next
int vtkTypeBool
Definition vtkABI.h:64
struct vtkFastGeomQuadStruct vtkFastGeomQuad
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition vtkType.h:315