VTK  9.1.0
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=========================================================================*/
97#ifndef vtkDataSetSurfaceFilter_h
98#define vtkDataSetSurfaceFilter_h
99
100#include "vtkFiltersGeometryModule.h" // For export macro
101#include "vtkGeometryFilter.h" // To facilitate delegation
102#include "vtkPolyDataAlgorithm.h"
103
104template <typename ArrayType>
105class vtkSmartPointer;
106
107class vtkCellIterator;
108class vtkPointData;
109class vtkPoints;
110class vtkIdTypeArray;
111class vtkImageData;
115
116// Helper structure for hashing faces.
118{
123};
125
126class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
127{
128public:
130
135 void PrintSelf(ostream& os, vtkIndent indent) override;
136
138
142 VTK_DEPRECATED_IN_9_1_0("no longer supported")
143 vtkTypeBool GetUseStrips();
144
145 VTK_DEPRECATED_IN_9_1_0("no longer supported")
146 void SetUseStrips(vtkTypeBool);
147
148 VTK_DEPRECATED_IN_9_1_0("no longer supported")
149 void UseStripsOn();
150
151 VTK_DEPRECATED_IN_9_1_0("no longer supported")
152 void UseStripsOff();
154
156
161 vtkSetMacro(PieceInvariant, int);
162 vtkGetMacro(PieceInvariant, int);
164
166
172 vtkSetMacro(PassThroughCellIds, vtkTypeBool);
173 vtkGetMacro(PassThroughCellIds, vtkTypeBool);
174 vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
175 vtkSetMacro(PassThroughPointIds, vtkTypeBool);
176 vtkGetMacro(PassThroughPointIds, vtkTypeBool);
177 vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
179
181
187 vtkSetMacro(FastMode, bool);
188 vtkGetMacro(FastMode, bool);
189 vtkBooleanMacro(FastMode, bool);
191
193
199 vtkSetStringMacro(OriginalCellIdsName);
200 virtual const char* GetOriginalCellIdsName()
201 {
202 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
203 }
204 vtkSetStringMacro(OriginalPointIdsName);
205 virtual const char* GetOriginalPointIdsName()
206 {
207 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
208 }
210
212
223 vtkSetMacro(NonlinearSubdivisionLevel, int);
224 vtkGetMacro(NonlinearSubdivisionLevel, int);
226
228
233 vtkSetMacro(Delegation, vtkTypeBool);
234 vtkGetMacro(Delegation, vtkTypeBool);
235 vtkBooleanMacro(Delegation, vtkTypeBool);
237
239
243 virtual int StructuredExecute(
244 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
245#ifdef VTK_USE_64BIT_IDS
246 virtual int StructuredExecute(
247 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
248 {
249 vtkIdType ext[6];
250 vtkIdType wholeExt[6];
251 for (int cc = 0; cc < 6; cc++)
252 {
253 ext[cc] = ext32[cc];
254 wholeExt[cc] = wholeExt32[cc];
255 }
256 return this->StructuredExecute(input, output, ext, wholeExt);
257 }
258#endif
259
268 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
270
274 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
275 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
276 vtkIdType* wholeExt, bool extractface[6]);
278
285#ifdef VTK_USE_64BIT_IDS
286 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
287 const int* wholeExt32, bool extractface[6])
288 {
289 vtkIdType ext[6];
290 vtkIdType wholeExt[6];
291 for (int cc = 0; cc < 6; cc++)
292 {
293 ext[cc] = ext32[cc];
294 wholeExt[cc] = wholeExt32[cc];
295 }
296 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
297 }
298#endif
300
301protected:
304
306
309
310 // Helper methods.
311
320 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
321
322 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
323 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
324
325 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
326 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
327
330 virtual void InsertQuadInHash(
331 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
332 virtual void InsertTriInHash(
333 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
334 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
337
342
345 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
347 double* weights, vtkPoints* outPts, vtkPointData* outPD);
348
349 class vtkEdgeInterpolationMap;
350
351 vtkEdgeInterpolationMap* EdgeMap;
353 "Use GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input, vtkCell* "
354 "cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD) instead")
355 vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
356 vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
357 vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
358 vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
359 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
360 double* weights, vtkPoints* outPts, vtkPointData* outPD);
361 vtkIdType NumberOfNewCells;
362
363 // Better memory allocation for faces (hash)
364 void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
365 vtkFastGeomQuad* NewFastGeomQuad(int numPts);
366 void DeleteAllFastGeomQuads();
367 // -----
368 vtkIdType FastGeomQuadArrayLength;
369 vtkIdType NumberOfFastGeomQuadArrays;
370 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
371 // These indexes allow us to find the next available face.
372 vtkIdType NextArrayIndex;
373 vtkIdType NextQuadIndex;
374
375 int PieceInvariant;
376
377 vtkTypeBool PassThroughCellIds;
378 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
379 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
380 vtkIdTypeArray* OriginalCellIds;
381 char* OriginalCellIdsName;
382
383 vtkTypeBool PassThroughPointIds;
384 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
385 vtkIdTypeArray* OriginalPointIds;
386 char* OriginalPointIdsName;
387
388 int NonlinearSubdivisionLevel;
389 vtkTypeBool Delegation;
390 bool FastMode;
391
392private:
393 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
394 int UnstructuredGridExecuteInternal(vtkUnstructuredGridBase* input, vtkPolyData* output,
395 bool handleSubdivision, vtkSmartPointer<vtkCellIterator> cellIter);
396
397 int StructuredExecuteNoBlanking(
398 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
399
401 void operator=(const vtkDataSetSurfaceFilter&) = delete;
402};
403
404#endif
Efficient cell iterator for vtkDataSet topologies.
abstract class to specify cell behavior
Definition: vtkCell.h:67
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 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...
vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet *input, vtkCell *cell, double *weights, vtkPoints *outPts, vtkPointData *outPD)
vtkEdgeInterpolationMap * EdgeMap
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:66
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:42
represent and manipulate 3D points
Definition: vtkPoints.h:43
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
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.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
struct vtkFastGeomQuadStruct * Next
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition: vtkType.h:332