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=========================================================================*/
100#ifndef vtkDataSetSurfaceFilter_h
101#define vtkDataSetSurfaceFilter_h
102
103#include "vtkFiltersGeometryModule.h" // For export macro
104#include "vtkGeometryFilter.h" // To facilitate delegation
105#include "vtkPolyDataAlgorithm.h"
106
107template <typename ArrayType>
108class vtkSmartPointer;
109
110class vtkCellIterator;
111class vtkPointData;
112class vtkPoints;
113class vtkIdTypeArray;
114class vtkImageData;
118
119// Helper structure for hashing faces.
121{
126};
128
129class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
130{
131public:
133
138 void PrintSelf(ostream& os, vtkIndent indent) override;
139
141
145 VTK_DEPRECATED_IN_9_1_0("no longer supported")
146 vtkTypeBool GetUseStrips();
147
148 VTK_DEPRECATED_IN_9_1_0("no longer supported")
149 void SetUseStrips(vtkTypeBool);
150
151 VTK_DEPRECATED_IN_9_1_0("no longer supported")
152 void UseStripsOn();
153
154 VTK_DEPRECATED_IN_9_1_0("no longer supported")
155 void UseStripsOff();
157
159
164 vtkSetMacro(PieceInvariant, int);
165 vtkGetMacro(PieceInvariant, int);
167
169
175 vtkSetMacro(PassThroughCellIds, vtkTypeBool);
176 vtkGetMacro(PassThroughCellIds, vtkTypeBool);
177 vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
178 vtkSetMacro(PassThroughPointIds, vtkTypeBool);
179 vtkGetMacro(PassThroughPointIds, vtkTypeBool);
180 vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
182
184
190 vtkSetMacro(FastMode, bool);
191 vtkGetMacro(FastMode, bool);
192 vtkBooleanMacro(FastMode, bool);
194
196
202 vtkSetStringMacro(OriginalCellIdsName);
203 virtual const char* GetOriginalCellIdsName()
204 {
205 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
206 }
207 vtkSetStringMacro(OriginalPointIdsName);
208 virtual const char* GetOriginalPointIdsName()
209 {
210 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
211 }
213
215
226 vtkSetMacro(NonlinearSubdivisionLevel, int);
227 vtkGetMacro(NonlinearSubdivisionLevel, int);
229
231
236 vtkSetMacro(Delegation, vtkTypeBool);
237 vtkGetMacro(Delegation, vtkTypeBool);
238 vtkBooleanMacro(Delegation, vtkTypeBool);
240
242
246 virtual int StructuredExecute(
247 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
248#ifdef VTK_USE_64BIT_IDS
249 virtual int StructuredExecute(
250 vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
251 {
252 vtkIdType ext[6];
253 vtkIdType wholeExt[6];
254 for (int cc = 0; cc < 6; cc++)
255 {
256 ext[cc] = ext32[cc];
257 wholeExt[cc] = wholeExt32[cc];
258 }
259 return this->StructuredExecute(input, output, ext, wholeExt);
260 }
261#endif
262
271 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
273
277 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
278 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
279 vtkIdType* wholeExt, bool extractface[6]);
281
287 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info);
288#ifdef VTK_USE_64BIT_IDS
289 virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
290 const int* wholeExt32, bool extractface[6])
291 {
292 vtkIdType ext[6];
293 vtkIdType wholeExt[6];
294 for (int cc = 0; cc < 6; cc++)
295 {
296 ext[cc] = ext32[cc];
297 wholeExt[cc] = wholeExt32[cc];
298 }
299 return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
300 }
301#endif
303
304protected:
307
309
311 int FillInputPortInformation(int port, vtkInformation* info) override;
312
313 // Helper methods.
314
323 vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
324
325 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
326 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
327
328 void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
329 int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
330
333 virtual void InsertQuadInHash(
334 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
335 virtual void InsertTriInHash(
336 vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
337 virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
340
345
348 vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
350 double* weights, vtkPoints* outPts, vtkPointData* outPD);
351
352 class vtkEdgeInterpolationMap;
353
354 vtkEdgeInterpolationMap* EdgeMap;
356 "Use GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input, vtkCell* "
357 "cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD) instead")
358 vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
359 vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
360 vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
361 vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
362 vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
363 double* weights, vtkPoints* outPts, vtkPointData* outPD);
364 vtkIdType NumberOfNewCells;
365
366 // Better memory allocation for faces (hash)
367 void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
368 vtkFastGeomQuad* NewFastGeomQuad(int numPts);
369 void DeleteAllFastGeomQuads();
370 // -----
371 vtkIdType FastGeomQuadArrayLength;
372 vtkIdType NumberOfFastGeomQuadArrays;
373 unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
374 // These indexes allow us to find the next available face.
375 vtkIdType NextArrayIndex;
376 vtkIdType NextQuadIndex;
377
378 int PieceInvariant;
379
380 vtkTypeBool PassThroughCellIds;
381 void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
382 virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
383 vtkIdTypeArray* OriginalCellIds;
384 char* OriginalCellIdsName;
385
386 vtkTypeBool PassThroughPointIds;
387 void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
388 vtkIdTypeArray* OriginalPointIds;
389 char* OriginalPointIdsName;
390
391 int NonlinearSubdivisionLevel;
392 vtkTypeBool Delegation;
393 bool FastMode;
394
395private:
396 int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
397 int UnstructuredGridExecuteInternal(vtkUnstructuredGridBase* input, vtkPolyData* output,
398 bool handleSubdivision, vtkSmartPointer<vtkCellIterator> cellIter);
399
400 int StructuredExecuteNoBlanking(
401 vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
402
404 void operator=(const vtkDataSetSurfaceFilter&) = delete;
405};
406
407#endif
Efficient cell iterator for vtkDataSet topologies.
abstract class to specify cell behavior
Definition vtkCell.h:70
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:72
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:49
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:49
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:69
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition vtkType.h:332