VTK  9.5.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
78
79#ifndef vtkDataSetSurfaceFilter_h
80#define vtkDataSetSurfaceFilter_h
81
82#include "vtkFiltersGeometryModule.h" // For export macro
83#include "vtkGeometryFilter.h" // To facilitate delegation
85
86VTK_ABI_NAMESPACE_BEGIN
87template <typename ArrayType>
88class vtkSmartPointer;
89
90class vtkPointData;
91class vtkPoints;
92class vtkIdTypeArray;
93class vtkImageData;
97
98// Helper structure for hashing faces.
107
108class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
109{
110public:
112
117 void PrintSelf(ostream& os, vtkIndent indent) override;
118
120
125 vtkSetMacro(PieceInvariant, int);
126 vtkGetMacro(PieceInvariant, int);
128
130
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 }
173
174
176
187 vtkSetMacro(NonlinearSubdivisionLevel, int);
188 vtkGetMacro(NonlinearSubdivisionLevel, int);
190
192
201
203
210
212
217 vtkSetMacro(Delegation, vtkTypeBool);
218 vtkGetMacro(Delegation, vtkTypeBool);
219 vtkBooleanMacro(Delegation, vtkTypeBool);
221
223
227 virtual int StructuredExecute(
228 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
229#ifdef VTK_USE_64BIT_IDS
230 virtual int StructuredExecute(
231 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
232 {
233 vtkIdType ext[6];
234 vtkIdType wholeExt[6];
235 for (int cc = 0; cc < 6; cc++)
236 {
237 ext[cc] = ext32[cc];
238 wholeExt[cc] = wholeExt32[cc];
239 }
240 return this->StructuredExecute(input, output, ext, wholeExt);
241 }
242#endif
243
252 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
254
258 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
259 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
260 vtkIdType* wholeExt, bool extractface[6]);
262
268 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
269#ifdef VTK_USE_64BIT_IDS
270 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
271 const int* wholeExt32, bool extractface[6])
272 {
273 vtkIdType ext[6];
274 vtkIdType wholeExt[6];
275 for (int cc = 0; cc < 6; cc++)
276 {
277 ext[cc] = ext32[cc];
278 wholeExt[cc] = wholeExt32[cc];
279 }
280 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
281 }
282#endif
284
285protected:
288
290
292 int FillInputPortInformation(int port, vtkInformation* info) override;
293
294 // Helper methods.
295
304 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
305
306 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
307 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
308
309 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
310 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
311
314 virtual void InsertQuadInHash(
315 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
316 virtual void InsertTriInHash(
317 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
318 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
321
326
329 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
330
331 class vtkEdgeInterpolationMap;
332
333 vtkEdgeInterpolationMap* EdgeMap;
335 vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
336 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
337 double* weights, vtkPoints* outPts, vtkPointData* outPD);
339
340 // Better memory allocation for faces (hash)
344 // -----
347 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
348 // These indexes allow us to find the next available face.
351
353
355 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
356 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
359
361 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
364
370
371private:
372 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
373 int UnstructuredGridExecuteInternal(
374 vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
375
376 int StructuredExecuteNoBlanking(
377 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
378
379 vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
380 double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
381
383 void operator=(const vtkDataSetSurfaceFilter&) = delete;
384};
385
386VTK_ABI_NAMESPACE_END
387#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.
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
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:56
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
int vtkIdType
Definition vtkType.h:332