VTK  9.4.2
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
176VTK_ABI_NAMESPACE_BEGIN
177template <typename ArrayType>
178class vtkSmartPointer;
179
180class vtkPointData;
181class vtkPoints;
182class vtkIdTypeArray;
183class vtkImageData;
187
188// Helper structure for hashing faces.
190{
195};
197
198class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
199{
200public:
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
296 vtkSetMacro(AllowInterpolation, vtkTypeBool);
297 vtkGetMacro(AllowInterpolation, vtkTypeBool);
298 vtkBooleanMacro(AllowInterpolation, vtkTypeBool);
300
302
307 vtkSetMacro(Delegation, vtkTypeBool);
308 vtkGetMacro(Delegation, vtkTypeBool);
309 vtkBooleanMacro(Delegation, vtkTypeBool);
311
313
317 virtual int StructuredExecute(
318 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
319#ifdef VTK_USE_64BIT_IDS
320 virtual int StructuredExecute(
321 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
322 {
323 vtkIdType ext[6];
324 vtkIdType wholeExt[6];
325 for (int cc = 0; cc < 6; cc++)
326 {
327 ext[cc] = ext32[cc];
328 wholeExt[cc] = wholeExt32[cc];
329 }
330 return this->StructuredExecute(input, output, ext, wholeExt);
331 }
332#endif
333
342 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
344
348 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
349 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
350 vtkIdType* wholeExt, bool extractface[6]);
352
358 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
359#ifdef VTK_USE_64BIT_IDS
360 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
361 const int* wholeExt32, bool extractface[6])
362 {
363 vtkIdType ext[6];
364 vtkIdType wholeExt[6];
365 for (int cc = 0; cc < 6; cc++)
366 {
367 ext[cc] = ext32[cc];
368 wholeExt[cc] = wholeExt32[cc];
369 }
370 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
371 }
372#endif
374
375protected:
378
380
382 int FillInputPortInformation(int port, vtkInformation* info) override;
383
384 // Helper methods.
385
394 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
395
396 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
397 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
398
399 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
400 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
401
404 virtual void InsertQuadInHash(
405 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
406 virtual void InsertTriInHash(
407 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
408 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
411
416
419 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
420
421 VTK_DEPRECATED_IN_9_3_0("This function is deprecated since reserved for private usage.")
422 vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
423 double* weights, vtkPoints* outPts, vtkPointData* outPD);
424
425 class vtkEdgeInterpolationMap;
426
427 vtkEdgeInterpolationMap* EdgeMap;
428 vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
429 vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
430 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
431 double* weights, vtkPoints* outPts, vtkPointData* outPD);
432 vtkIdType NumberOfNewCells;
433
434 // Better memory allocation for faces (hash)
435 void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
436 vtkFastGeomQuad* NewFastGeomQuad(int numPts);
437 void DeleteAllFastGeomQuads();
438 // -----
439 vtkIdType FastGeomQuadArrayLength;
440 vtkIdType NumberOfFastGeomQuadArrays;
441 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
442 // These indexes allow us to find the next available face.
443 vtkIdType NextArrayIndex;
444 vtkIdType NextQuadIndex;
445
446 int PieceInvariant;
447
448 vtkTypeBool PassThroughCellIds;
449 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
450 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
451 vtkIdTypeArray* OriginalCellIds;
452 char* OriginalCellIdsName;
453
454 vtkTypeBool PassThroughPointIds;
455 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
456 vtkIdTypeArray* OriginalPointIds;
457 char* OriginalPointIdsName;
458
459 int NonlinearSubdivisionLevel;
460 int MatchBoundariesIgnoringCellOrder;
461 vtkTypeBool AllowInterpolation;
462 vtkTypeBool Delegation;
463 bool FastMode;
464
465private:
466 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
467 int UnstructuredGridExecuteInternal(
468 vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
469
470 int StructuredExecuteNoBlanking(
471 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
472
473 vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
474 double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
475
477 void operator=(const vtkDataSetSurfaceFilter&) = delete;
478};
479
480VTK_ABI_NAMESPACE_END
481#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.
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)
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...
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
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: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
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition vtkType.h:315