VTK  9.6.1
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
81
82#ifndef vtkDataSetSurfaceFilter_h
83#define vtkDataSetSurfaceFilter_h
84
85#include "vtkFiltersGeometryModule.h" // For export macro
86#include "vtkGeometryFilter.h" // To facilitate delegation
88
89VTK_ABI_NAMESPACE_BEGIN
90template <typename ArrayType>
91class vtkSmartPointer;
92
93class vtkPointData;
94class vtkPoints;
95class vtkIdTypeArray;
96class vtkImageData;
100
101// Helper structure for hashing faces.
110
111class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
112{
113public:
115
120 void PrintSelf(ostream& os, vtkIndent indent) override;
121
123
128 vtkSetMacro(PieceInvariant, int);
129 vtkGetMacro(PieceInvariant, int);
131
133
146
148
154 vtkSetMacro(FastMode, bool);
155 vtkGetMacro(FastMode, bool);
156 vtkBooleanMacro(FastMode, bool);
158
160
166 vtkSetStringMacro(OriginalCellIdsName);
167 virtual const char* GetOriginalCellIdsName()
168 {
169 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
170 }
171 vtkSetStringMacro(OriginalPointIdsName);
172 virtual const char* GetOriginalPointIdsName()
173 {
174 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
175 }
176
177
179
190 vtkSetMacro(NonlinearSubdivisionLevel, int);
191 vtkGetMacro(NonlinearSubdivisionLevel, int);
193
195
204
206
213
215
220 vtkSetMacro(Delegation, vtkTypeBool);
221 vtkGetMacro(Delegation, vtkTypeBool);
222 vtkBooleanMacro(Delegation, vtkTypeBool);
224
226
230 virtual int StructuredExecute(
231 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
232#ifdef VTK_USE_64BIT_IDS
233 virtual int StructuredExecute(
234 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
235 {
236 vtkIdType ext[6];
237 vtkIdType wholeExt[6];
238 for (int cc = 0; cc < 6; cc++)
239 {
240 ext[cc] = ext32[cc];
241 wholeExt[cc] = wholeExt32[cc];
242 }
243 return this->StructuredExecute(input, output, ext, wholeExt);
244 }
245#endif
246
255 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
257
261 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
262 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
263 vtkIdType* wholeExt, bool extractface[6]);
265
271 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
272#ifdef VTK_USE_64BIT_IDS
273 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
274 const int* wholeExt32, bool extractface[6])
275 {
276 vtkIdType ext[6];
277 vtkIdType wholeExt[6];
278 for (int cc = 0; cc < 6; cc++)
279 {
280 ext[cc] = ext32[cc];
281 wholeExt[cc] = wholeExt32[cc];
282 }
283 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
284 }
285#endif
287
288protected:
291
293
295 int FillInputPortInformation(int port, vtkInformation* info) override;
296
297 // Helper methods.
298
307 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
308
309 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
310 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
311
312 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
313 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
314
317 virtual void InsertQuadInHash(
318 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
319 virtual void InsertTriInHash(
320 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
321 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
324
329
332 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
333
334 class vtkEdgeInterpolationMap;
335
336 vtkEdgeInterpolationMap* EdgeMap;
338 vtkCell* cell, double* pcoords, double* weights, vtkPoints* outPts, vtkPointData* outPD);
339 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
340 double* weights, vtkPoints* outPts, vtkPointData* outPD);
342
343 // Better memory allocation for faces (hash)
347 // -----
350 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
351 // These indexes allow us to find the next available face.
354
356
358 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
359 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
362
364 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
367
373
374private:
375 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
376 int UnstructuredGridExecuteInternal(
377 vtkUnstructuredGridBase* input, vtkPolyData* output, bool handleSubdivision);
378
379 int StructuredExecuteNoBlanking(
380 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
381
382 vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
383 double* pc, double* weights, vtkPoints* outPts, vtkPointData* outPD);
384
386 void operator=(const vtkDataSetSurfaceFilter&) = delete;
387};
388
389VTK_ABI_NAMESPACE_END
390#endif
abstract class to specify cell behavior
Definition vtkCell.h:50
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: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
int vtkIdType
Definition vtkType.h:368