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 =========================================================================*/
197 #ifndef vtkDataSetSurfaceFilter_h
198 #define vtkDataSetSurfaceFilter_h
199 
200 #include "vtkFiltersGeometryModule.h" // For export macro
201 #include "vtkGeometryFilter.h" // To facilitate delegation
202 #include "vtkPolyDataAlgorithm.h"
203 
204 template <typename ArrayType>
205 class vtkSmartPointer;
206 
207 class vtkCellIterator;
208 class vtkPointData;
209 class vtkPoints;
210 class vtkIdTypeArray;
211 class vtkImageData;
212 class vtkRectilinearGrid;
213 class vtkStructuredGrid;
215 
216 // Helper structure for hashing faces.
218 {
221  int numPts;
223 };
225 
226 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
227 {
228 public:
230 
235  void PrintSelf(ostream& os, vtkIndent indent) override;
236 
238 
242  VTK_DEPRECATED_IN_9_1_0("no longer supported")
243  vtkTypeBool GetUseStrips();
244 
245  VTK_DEPRECATED_IN_9_1_0("no longer supported")
246  void SetUseStrips(vtkTypeBool);
247 
248  VTK_DEPRECATED_IN_9_1_0("no longer supported")
249  void UseStripsOn();
250 
251  VTK_DEPRECATED_IN_9_1_0("no longer supported")
252  void UseStripsOff();
254 
256 
261  vtkSetMacro(PieceInvariant, int);
262  vtkGetMacro(PieceInvariant, int);
264 
266 
272  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
273  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
274  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
275  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
276  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
277  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
279 
281 
287  vtkSetMacro(FastMode, bool);
288  vtkGetMacro(FastMode, bool);
289  vtkBooleanMacro(FastMode, bool);
291 
293 
299  vtkSetStringMacro(OriginalCellIdsName);
300  virtual const char* GetOriginalCellIdsName()
301  {
302  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
303  }
304  vtkSetStringMacro(OriginalPointIdsName);
305  virtual const char* GetOriginalPointIdsName()
306  {
307  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
308  }
310 
312 
323  vtkSetMacro(NonlinearSubdivisionLevel, int);
324  vtkGetMacro(NonlinearSubdivisionLevel, int);
326 
328 
333  vtkSetMacro(Delegation, vtkTypeBool);
334  vtkGetMacro(Delegation, vtkTypeBool);
335  vtkBooleanMacro(Delegation, vtkTypeBool);
337 
339 
343  virtual int StructuredExecute(
344  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
345 #ifdef VTK_USE_64BIT_IDS
346  virtual int StructuredExecute(
347  vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
348  {
349  vtkIdType ext[6];
350  vtkIdType wholeExt[6];
351  for (int cc = 0; cc < 6; cc++)
352  {
353  ext[cc] = ext32[cc];
354  wholeExt[cc] = wholeExt32[cc];
355  }
356  return this->StructuredExecute(input, output, ext, wholeExt);
357  }
358 #endif
359 
368  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
370 
374  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
375  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
376  vtkIdType* wholeExt, bool extractface[6]);
378 
385 #ifdef VTK_USE_64BIT_IDS
386  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
387  const int* wholeExt32, bool extractface[6])
388  {
389  vtkIdType ext[6];
390  vtkIdType wholeExt[6];
391  for (int cc = 0; cc < 6; cc++)
392  {
393  ext[cc] = ext32[cc];
394  wholeExt[cc] = wholeExt32[cc];
395  }
396  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
397  }
398 #endif
400 
401 protected:
404 
406 
409 
410  // Helper methods.
411 
420  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
421 
422  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
423  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
424 
425  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
426  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
427 
428  void InitializeQuadHash(vtkIdType numPoints);
430  virtual void InsertQuadInHash(
431  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
432  virtual void InsertTriInHash(
433  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
434  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
437 
442 
445  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
447  double* weights, vtkPoints* outPts, vtkPointData* outPD);
448 
449  class vtkEdgeInterpolationMap;
450 
451  vtkEdgeInterpolationMap* EdgeMap;
453  "Use GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input, vtkCell* "
454  "cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD) instead")
455  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
456  vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
457  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
458  vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
459  vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
460  double* weights, vtkPoints* outPts, vtkPointData* outPD);
461  vtkIdType NumberOfNewCells;
462 
463  // Better memory allocation for faces (hash)
464  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
465  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
466  void DeleteAllFastGeomQuads();
467  // -----
468  vtkIdType FastGeomQuadArrayLength;
469  vtkIdType NumberOfFastGeomQuadArrays;
470  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
471  // These indexes allow us to find the next available face.
472  vtkIdType NextArrayIndex;
473  vtkIdType NextQuadIndex;
474 
475  int PieceInvariant;
476 
477  vtkTypeBool PassThroughCellIds;
478  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
479  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
480  vtkIdTypeArray* OriginalCellIds;
481  char* OriginalCellIdsName;
482 
483  vtkTypeBool PassThroughPointIds;
484  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
485  vtkIdTypeArray* OriginalPointIds;
486  char* OriginalPointIdsName;
487 
488  int NonlinearSubdivisionLevel;
489  vtkTypeBool Delegation;
490  bool FastMode;
491 
492 private:
493  int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
494  int UnstructuredGridExecuteInternal(vtkUnstructuredGridBase* input, vtkPolyData* output,
495  bool handleSubdivision, vtkSmartPointer<vtkCellIterator> cellIter);
496 
497  int StructuredExecuteNoBlanking(
498  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
499 
501  void operator=(const vtkDataSetSurfaceFilter&) = delete;
502 };
503 
504 #endif
Efficient cell iterator for vtkDataSet topologies.
abstract class to specify cell behavior
Definition: vtkCell.h:147
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:166
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:142
represent and manipulate 3D points
Definition: vtkPoints.h:143
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
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