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 =========================================================================*/
88 #ifndef vtkDataSetSurfaceFilter_h
89 #define vtkDataSetSurfaceFilter_h
90 
91 #include "vtkFiltersGeometryModule.h" // For export macro
92 #include "vtkGeometryFilter.h" // To facilitate delegation
93 #include "vtkPolyDataAlgorithm.h"
94 
95 template <typename ArrayType>
96 class vtkSmartPointer;
97 
98 class vtkCellIterator;
99 class vtkPointData;
100 class vtkPoints;
101 class vtkIdTypeArray;
102 class vtkImageData;
103 class vtkRectilinearGrid;
104 class vtkStructuredGrid;
106 
107 // Helper structure for hashing faces.
109 {
112  int numPts;
114 };
116 
117 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
118 {
119 public:
121 
126  void PrintSelf(ostream& os, vtkIndent indent) override;
127 
129 
133  VTK_DEPRECATED_IN_9_1_0("no longer supported")
134  vtkTypeBool GetUseStrips();
135 
136  VTK_DEPRECATED_IN_9_1_0("no longer supported")
137  void SetUseStrips(vtkTypeBool);
138 
139  VTK_DEPRECATED_IN_9_1_0("no longer supported")
140  void UseStripsOn();
141 
142  VTK_DEPRECATED_IN_9_1_0("no longer supported")
143  void UseStripsOff();
145 
147 
152  vtkSetMacro(PieceInvariant, int);
153  vtkGetMacro(PieceInvariant, int);
155 
157 
163  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
164  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
165  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
166  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
167  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
168  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
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  }
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 
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 
292 protected:
295 
297 
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 
319  void InitializeQuadHash(vtkIdType numPoints);
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")
346  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
347  vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
348  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
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);
352  vtkIdType NumberOfNewCells;
353 
354  // Better memory allocation for faces (hash)
355  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
356  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
357  void DeleteAllFastGeomQuads();
358  // -----
359  vtkIdType FastGeomQuadArrayLength;
360  vtkIdType NumberOfFastGeomQuadArrays;
361  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
362  // These indexes allow us to find the next available face.
363  vtkIdType NextArrayIndex;
364  vtkIdType NextQuadIndex;
365 
366  int PieceInvariant;
367 
368  vtkTypeBool PassThroughCellIds;
369  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
370  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
371  vtkIdTypeArray* OriginalCellIds;
372  char* OriginalCellIdsName;
373 
374  vtkTypeBool PassThroughPointIds;
375  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
376  vtkIdTypeArray* OriginalPointIds;
377  char* OriginalPointIdsName;
378 
379  int NonlinearSubdivisionLevel;
380  vtkTypeBool Delegation;
381  bool FastMode;
382 
383 private:
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
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:57
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:48
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
Definition: vtkPointData.h:33
represent and manipulate 3D points
Definition: vtkPoints.h:34
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
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