VTK  9.1.20220528
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 =========================================================================*/
200 #ifndef vtkDataSetSurfaceFilter_h
201 #define vtkDataSetSurfaceFilter_h
202 
203 #include "vtkFiltersGeometryModule.h" // For export macro
204 #include "vtkGeometryFilter.h" // To facilitate delegation
205 #include "vtkPolyDataAlgorithm.h"
206 
207 template <typename ArrayType>
208 class vtkSmartPointer;
209 
210 class vtkCellIterator;
211 class vtkPointData;
212 class vtkPoints;
213 class vtkIdTypeArray;
214 class vtkImageData;
215 class vtkRectilinearGrid;
216 class vtkStructuredGrid;
218 
219 // Helper structure for hashing faces.
221 {
224  int numPts;
226 };
228 
229 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
230 {
231 public:
233 
238  void PrintSelf(ostream& os, vtkIndent indent) override;
239 
241 
245  VTK_DEPRECATED_IN_9_1_0("no longer supported")
246  vtkTypeBool GetUseStrips();
247 
248  VTK_DEPRECATED_IN_9_1_0("no longer supported")
249  void SetUseStrips(vtkTypeBool);
250 
251  VTK_DEPRECATED_IN_9_1_0("no longer supported")
252  void UseStripsOn();
253 
254  VTK_DEPRECATED_IN_9_1_0("no longer supported")
255  void UseStripsOff();
257 
259 
264  vtkSetMacro(PieceInvariant, int);
265  vtkGetMacro(PieceInvariant, int);
267 
269 
275  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
276  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
277  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
278  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
279  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
280  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
282 
284 
290  vtkSetMacro(FastMode, bool);
291  vtkGetMacro(FastMode, bool);
292  vtkBooleanMacro(FastMode, bool);
294 
296 
302  vtkSetStringMacro(OriginalCellIdsName);
303  virtual const char* GetOriginalCellIdsName()
304  {
305  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
306  }
307  vtkSetStringMacro(OriginalPointIdsName);
308  virtual const char* GetOriginalPointIdsName()
309  {
310  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
311  }
313 
315 
326  vtkSetMacro(NonlinearSubdivisionLevel, int);
327  vtkGetMacro(NonlinearSubdivisionLevel, int);
329 
331 
336  vtkSetMacro(Delegation, vtkTypeBool);
337  vtkGetMacro(Delegation, vtkTypeBool);
338  vtkBooleanMacro(Delegation, vtkTypeBool);
340 
342 
346  virtual int StructuredExecute(
347  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
348 #ifdef VTK_USE_64BIT_IDS
349  virtual int StructuredExecute(
350  vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
351  {
352  vtkIdType ext[6];
353  vtkIdType wholeExt[6];
354  for (int cc = 0; cc < 6; cc++)
355  {
356  ext[cc] = ext32[cc];
357  wholeExt[cc] = wholeExt32[cc];
358  }
359  return this->StructuredExecute(input, output, ext, wholeExt);
360  }
361 #endif
362 
371  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
373 
377  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
378  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
379  vtkIdType* wholeExt, bool extractface[6]);
381 
388 #ifdef VTK_USE_64BIT_IDS
389  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
390  const int* wholeExt32, bool extractface[6])
391  {
392  vtkIdType ext[6];
393  vtkIdType wholeExt[6];
394  for (int cc = 0; cc < 6; cc++)
395  {
396  ext[cc] = ext32[cc];
397  wholeExt[cc] = wholeExt32[cc];
398  }
399  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
400  }
401 #endif
403 
404 protected:
407 
409 
412 
413  // Helper methods.
414 
423  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
424 
425  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
426  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
427 
428  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
429  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
430 
431  void InitializeQuadHash(vtkIdType numPoints);
433  virtual void InsertQuadInHash(
434  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
435  virtual void InsertTriInHash(
436  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
437  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
440 
445 
448  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
450  double* weights, vtkPoints* outPts, vtkPointData* outPD);
451 
452  class vtkEdgeInterpolationMap;
453 
454  vtkEdgeInterpolationMap* EdgeMap;
456  "Use GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input, vtkCell* "
457  "cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD) instead")
458  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
459  vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
460  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
461  vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
462  vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
463  double* weights, vtkPoints* outPts, vtkPointData* outPD);
464  vtkIdType NumberOfNewCells;
465 
466  // Better memory allocation for faces (hash)
467  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
468  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
469  void DeleteAllFastGeomQuads();
470  // -----
471  vtkIdType FastGeomQuadArrayLength;
472  vtkIdType NumberOfFastGeomQuadArrays;
473  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
474  // These indexes allow us to find the next available face.
475  vtkIdType NextArrayIndex;
476  vtkIdType NextQuadIndex;
477 
478  int PieceInvariant;
479 
480  vtkTypeBool PassThroughCellIds;
481  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
482  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
483  vtkIdTypeArray* OriginalCellIds;
484  char* OriginalCellIdsName;
485 
486  vtkTypeBool PassThroughPointIds;
487  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
488  vtkIdTypeArray* OriginalPointIds;
489  char* OriginalPointIdsName;
490 
491  int NonlinearSubdivisionLevel;
492  vtkTypeBool Delegation;
493  bool FastMode;
494 
495 private:
496  int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
497  int UnstructuredGridExecuteInternal(vtkUnstructuredGridBase* input, vtkPolyData* output,
498  bool handleSubdivision, vtkSmartPointer<vtkCellIterator> cellIter);
499 
500  int StructuredExecuteNoBlanking(
501  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
502 
504  void operator=(const vtkDataSetSurfaceFilter&) = delete;
505 };
506 
507 #endif
Efficient cell iterator for vtkDataSet topologies.
abstract class to specify cell behavior
Definition: vtkCell.h:150
Extracts outer surface (as vtkPolyData) of any dataset.
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)
static vtkDataSetSurfaceFilter * New()
Statndard methods for object instantiation, type information, and printing.
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.
vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet *input, vtkCell *cell, double *weights, vtkPoints *outPts, vtkPointData *outPD)
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
vtkEdgeInterpolationMap * EdgeMap
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual const char * GetOriginalPointIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
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:172
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
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