VTK  9.6.20260320
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
170
171#ifndef vtkDataSetSurfaceFilter_h
172#define vtkDataSetSurfaceFilter_h
173
174#include "vtkFiltersGeometryModule.h" // For export macro
175#include "vtkGeometryFilter.h" // To facilitate delegation
176#include "vtkPolyDataAlgorithm.h"
177
178VTK_ABI_NAMESPACE_BEGIN
179template <typename ArrayType>
180class vtkSmartPointer;
181
182class vtkPointData;
183class vtkPoints;
184class vtkIdTypeArray;
185class vtkImageData;
189
190// Helper structure for hashing faces.
199
200class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
201{
202public:
204
209 void PrintSelf(ostream& os, vtkIndent indent) override;
210
212
217 vtkSetMacro(PieceInvariant, int);
218 vtkGetMacro(PieceInvariant, int);
220
222
235
237
243 vtkSetMacro(FastMode, bool);
244 vtkGetMacro(FastMode, bool);
245 vtkBooleanMacro(FastMode, bool);
247
249
255 vtkSetStringMacro(OriginalCellIdsName);
256 virtual const char* GetOriginalCellIdsName()
257 {
258 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
259 }
260 vtkSetStringMacro(OriginalPointIdsName);
261 virtual const char* GetOriginalPointIdsName()
262 {
263 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
264 }
265
266
268
279 vtkSetMacro(NonlinearSubdivisionLevel, int);
280 vtkGetMacro(NonlinearSubdivisionLevel, int);
282
284
293
295
302
304
309 vtkSetMacro(Delegation, vtkTypeBool);
310 vtkGetMacro(Delegation, vtkTypeBool);
311 vtkBooleanMacro(Delegation, vtkTypeBool);
313
315
319 virtual int StructuredExecute(
320 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
321#ifdef VTK_USE_64BIT_IDS
322 virtual int StructuredExecute(
323 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
324 {
325 vtkIdType ext[6];
326 vtkIdType wholeExt[6];
327 for (int cc = 0; cc < 6; cc++)
328 {
329 ext[cc] = ext32[cc];
330 wholeExt[cc] = wholeExt32[cc];
331 }
332 return this->StructuredExecute(input, output, ext, wholeExt);
333 }
334#endif
335
344 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
346
350 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
351 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
352 vtkIdType* wholeExt, bool extractface[6]);
354
360 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
361#ifdef VTK_USE_64BIT_IDS
362 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
363 const int* wholeExt32, bool extractface[6])
364 {
365 vtkIdType ext[6];
366 vtkIdType wholeExt[6];
367 for (int cc = 0; cc < 6; cc++)
368 {
369 ext[cc] = ext32[cc];
370 wholeExt[cc] = wholeExt32[cc];
371 }
372 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
373 }
374#endif
376
377protected:
380
382
384 int FillInputPortInformation(int port, vtkInformation* info) override;
385
386 // Helper methods.
387
396 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
397
398 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
399 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
400
401 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
402 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
403
406 virtual void InsertQuadInHash(
407 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
408 virtual void InsertTriInHash(
409 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
410 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
413
418
421 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
422
423 class vtkEdgeInterpolationMap;
424
425 vtkEdgeInterpolationMap* EdgeMap;
427 vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
428 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
429 double* weights, vtkPoints* outPts, vtkPointData* outPD);
431
432 // Better memory allocation for faces (hash)
436 // -----
439 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
440 // These indexes allow us to find the next available face.
443
445
447 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
448 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
451
453 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
456
462
463private:
464 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
465 int UnstructuredGridExecuteInternal(
466 vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
467
468 int StructuredExecuteNoBlanking(
469 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
470
471 vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
472 double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
473
475 void operator=(const vtkDataSetSurfaceFilter&) = delete;
476};
477
478VTK_ABI_NAMESPACE_END
479#endif
abstract class to specify cell behavior
Definition vtkCell.h:129
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:166
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:140
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
struct vtkFastGeomQuadStruct vtkFastGeomQuad
int vtkIdType
Definition vtkType.h:363