VTK  9.2.6
vtkDataSetSurfaceFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDataSetSurfaceFilter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
87
88#ifndef vtkDataSetSurfaceFilter_h
89#define vtkDataSetSurfaceFilter_h
90
91#include "vtkFiltersGeometryModule.h" // For export macro
92#include "vtkGeometryFilter.h" // To facilitate delegation
94
95template <typename ArrayType>
96class vtkSmartPointer;
97
98class vtkCellIterator;
99class vtkPointData;
100class vtkPoints;
101class vtkIdTypeArray;
102class vtkImageData;
106
107// Helper structure for hashing faces.
116
117class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
118{
119public:
121
126 void PrintSelf(ostream& os, vtkIndent indent) override;
127
129
133 VTK_DEPRECATED_IN_9_1_0("no longer supported")
135
136 VTK_DEPRECATED_IN_9_1_0("no longer supported")
138
139 VTK_DEPRECATED_IN_9_1_0("no longer supported")
141
142 VTK_DEPRECATED_IN_9_1_0("no longer supported")
145
147
152 vtkSetMacro(PieceInvariant, int);
153 vtkGetMacro(PieceInvariant, int);
155
157
170
172
178 vtkSetMacro(FastMode, bool);
179 vtkGetMacro(FastMode, bool);
180 vtkBooleanMacro(FastMode, bool);
182
184
190 vtkSetStringMacro(OriginalCellIdsName);
191 virtual const char* GetOriginalCellIdsName()
192 {
193 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
194 }
195 vtkSetStringMacro(OriginalPointIdsName);
196 virtual const char* GetOriginalPointIdsName()
197 {
198 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
199 }
200
201
203
214 vtkSetMacro(NonlinearSubdivisionLevel, int);
215 vtkGetMacro(NonlinearSubdivisionLevel, int);
217
219
224 vtkSetMacro(Delegation, vtkTypeBool);
225 vtkGetMacro(Delegation, vtkTypeBool);
226 vtkBooleanMacro(Delegation, vtkTypeBool);
228
230
234 virtual int StructuredExecute(
235 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
236#ifdef VTK_USE_64BIT_IDS
237 virtual int StructuredExecute(
238 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
239 {
240 vtkIdType ext[6];
241 vtkIdType wholeExt[6];
242 for (int cc = 0; cc < 6; cc++)
243 {
244 ext[cc] = ext32[cc];
245 wholeExt[cc] = wholeExt32[cc];
246 }
247 return this->StructuredExecute(input, output, ext, wholeExt);
248 }
249#endif
250
259 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
261
265 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
266 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
267 vtkIdType* wholeExt, bool extractface[6]);
269
275 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
276#ifdef VTK_USE_64BIT_IDS
277 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
278 const int* wholeExt32, bool extractface[6])
279 {
280 vtkIdType ext[6];
281 vtkIdType wholeExt[6];
282 for (int cc = 0; cc < 6; cc++)
283 {
284 ext[cc] = ext32[cc];
285 wholeExt[cc] = wholeExt32[cc];
286 }
287 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
288 }
289#endif
291
292protected:
295
297
299 int FillInputPortInformation(int port, vtkInformation* info) override;
300
301 // Helper methods.
302
311 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
312
313 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
314 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
315
316 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
317 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
318
321 virtual void InsertQuadInHash(
322 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
323 virtual void InsertTriInHash(
324 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
325 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
328
333
336 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
338 double* weights, vtkPoints* outPts, vtkPointData* outPD);
339
340 class vtkEdgeInterpolationMap;
341
342 vtkEdgeInterpolationMap* EdgeMap;
344 "Use GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input, vtkCell* "
345 "cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD) instead")
347 vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
349 vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
350 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
351 double* weights, vtkPoints* outPts, vtkPointData* outPD);
353
354 // Better memory allocation for faces (hash)
358 // -----
361 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
362 // These indexes allow us to find the next available face.
365
367
369 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
370 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
373
375 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
378
382
383private:
384 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
385 int UnstructuredGridExecuteInternal(vtkUnstructuredGridBase* input, vtkPolyData* output,
386 bool handleSubdivision, vtkSmartPointer<vtkCellIterator> cellIter);
387
388 int StructuredExecuteNoBlanking(
389 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
390
392 void operator=(const vtkDataSetSurfaceFilter&) = delete;
393};
394
395#endif
Efficient cell iterator for vtkDataSet topologies.
abstract class to specify cell behavior
Definition vtkCell.h:58
void UseStripsOn()
Statndard methods for object instantiation, type information, and printing.
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.
vtkTypeBool GetUseStrips()
Triangle strip support was dropped in 9.1.
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...
void UseStripsOff()
Statndard methods for object instantiation, type information, and printing.
vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet *input, vtkCell *cell, double *weights, vtkPoints *outPts, vtkPointData *outPD)
void SetUseStrips(vtkTypeBool)
Statndard methods for object instantiation, type information, and printing.
vtkEdgeInterpolationMap * EdgeMap
void InitFastGeomQuadAllocation(vtkIdType numberOfCells)
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId)
void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId)
vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet *input, vtkCell *cell, double pcoords[3], vtkPoints *outPts, vtkPointData *outPD)
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:57
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
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:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
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:69
struct vtkFastGeomQuadStruct vtkFastGeomQuad
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition vtkType.h:332