VTK  9.4.20250209
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 "vtkFiltersGeometryModule.h" // For export macro
172#include "vtkGeometryFilter.h" // To facilitate delegation
173#include "vtkPolyDataAlgorithm.h"
174
175VTK_ABI_NAMESPACE_BEGIN
176template <typename ArrayType>
177class vtkSmartPointer;
178
179class vtkPointData;
180class vtkPoints;
181class vtkIdTypeArray;
182class vtkImageData;
186
187// Helper structure for hashing faces.
189{
194};
196
197class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
198{
199public:
201
206 void PrintSelf(ostream& os, vtkIndent indent) override;
207
209
214 vtkSetMacro(PieceInvariant, int);
215 vtkGetMacro(PieceInvariant, int);
217
219
225 vtkSetMacro(PassThroughCellIds, vtkTypeBool);
226 vtkGetMacro(PassThroughCellIds, vtkTypeBool);
227 vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
228 vtkSetMacro(PassThroughPointIds, vtkTypeBool);
229 vtkGetMacro(PassThroughPointIds, vtkTypeBool);
230 vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
232
234
240 vtkSetMacro(FastMode, bool);
241 vtkGetMacro(FastMode, bool);
242 vtkBooleanMacro(FastMode, bool);
244
246
252 vtkSetStringMacro(OriginalCellIdsName);
253 virtual const char* GetOriginalCellIdsName()
254 {
255 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
256 }
257 vtkSetStringMacro(OriginalPointIdsName);
258 virtual const char* GetOriginalPointIdsName()
259 {
260 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
261 }
263
265
276 vtkSetMacro(NonlinearSubdivisionLevel, int);
277 vtkGetMacro(NonlinearSubdivisionLevel, int);
279
281
287 vtkSetMacro(MatchBoundariesIgnoringCellOrder, int);
288 vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
290
292
295 vtkSetMacro(AllowInterpolation, vtkTypeBool);
296 vtkGetMacro(AllowInterpolation, vtkTypeBool);
297 vtkBooleanMacro(AllowInterpolation, vtkTypeBool);
299
301
306 vtkSetMacro(Delegation, vtkTypeBool);
307 vtkGetMacro(Delegation, vtkTypeBool);
308 vtkBooleanMacro(Delegation, vtkTypeBool);
310
312
316 virtual int StructuredExecute(
317 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
318#ifdef VTK_USE_64BIT_IDS
319 virtual int StructuredExecute(
320 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
321 {
322 vtkIdType ext[6];
323 vtkIdType wholeExt[6];
324 for (int cc = 0; cc < 6; cc++)
325 {
326 ext[cc] = ext32[cc];
327 wholeExt[cc] = wholeExt32[cc];
328 }
329 return this->StructuredExecute(input, output, ext, wholeExt);
330 }
331#endif
332
341 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
343
347 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
348 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
349 vtkIdType* wholeExt, bool extractface[6]);
351
357 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
358#ifdef VTK_USE_64BIT_IDS
359 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
360 const int* wholeExt32, bool extractface[6])
361 {
362 vtkIdType ext[6];
363 vtkIdType wholeExt[6];
364 for (int cc = 0; cc < 6; cc++)
365 {
366 ext[cc] = ext32[cc];
367 wholeExt[cc] = wholeExt32[cc];
368 }
369 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
370 }
371#endif
373
374protected:
377
379
381 int FillInputPortInformation(int port, vtkInformation* info) override;
382
383 // Helper methods.
384
393 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
394
395 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
396 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
397
398 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
399 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
400
403 virtual void InsertQuadInHash(
404 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
405 virtual void InsertTriInHash(
406 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
407 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
410
415
418 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
419
420 class vtkEdgeInterpolationMap;
421
422 vtkEdgeInterpolationMap* EdgeMap;
424 vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
425 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
426 double* weights, vtkPoints* outPts, vtkPointData* outPD);
428
429 // Better memory allocation for faces (hash)
433 // -----
436 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
437 // These indexes allow us to find the next available face.
440
442
444 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
445 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
448
450 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
453
459
460private:
461 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
462 int UnstructuredGridExecuteInternal(
463 vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
464
465 int StructuredExecuteNoBlanking(
466 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
467
468 vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
469 double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
470
472 void operator=(const vtkDataSetSurfaceFilter&) = delete;
473};
474
475VTK_ABI_NAMESPACE_END
476#endif
abstract class to specify cell behavior
Definition vtkCell.h:130
Extracts outer surface (as vtkPolyData) of any dataset.
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.
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)
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...
vtkEdgeInterpolationMap * EdgeMap
virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad)
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:165
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
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
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
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
int vtkIdType
Definition vtkType.h:315