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 =========================================================================*/
91 #ifndef vtkDataSetSurfaceFilter_h
92 #define vtkDataSetSurfaceFilter_h
93 
94 #include "vtkFiltersGeometryModule.h" // For export macro
95 #include "vtkGeometryFilter.h" // To facilitate delegation
96 #include "vtkPolyDataAlgorithm.h"
97 
98 template <typename ArrayType>
99 class vtkSmartPointer;
100 
101 class vtkCellIterator;
102 class vtkPointData;
103 class vtkPoints;
104 class vtkIdTypeArray;
105 class vtkImageData;
106 class vtkRectilinearGrid;
107 class vtkStructuredGrid;
109 
110 // Helper structure for hashing faces.
112 {
115  int numPts;
117 };
119 
120 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
121 {
122 public:
124 
127  static vtkDataSetSurfaceFilter* New();
129  void PrintSelf(ostream& os, vtkIndent indent) override;
130 
132 
136  VTK_DEPRECATED_IN_9_1_0("no longer supported")
137  vtkTypeBool GetUseStrips();
138 
139  VTK_DEPRECATED_IN_9_1_0("no longer supported")
140  void SetUseStrips(vtkTypeBool);
141 
142  VTK_DEPRECATED_IN_9_1_0("no longer supported")
143  void UseStripsOn();
144 
145  VTK_DEPRECATED_IN_9_1_0("no longer supported")
146  void UseStripsOff();
148 
150 
155  vtkSetMacro(PieceInvariant, int);
156  vtkGetMacro(PieceInvariant, int);
158 
160 
166  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
167  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
168  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
169  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
170  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
171  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
173 
175 
181  vtkSetMacro(FastMode, bool);
182  vtkGetMacro(FastMode, bool);
183  vtkBooleanMacro(FastMode, bool);
185 
187 
193  vtkSetStringMacro(OriginalCellIdsName);
194  virtual const char* GetOriginalCellIdsName()
195  {
196  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
197  }
198  vtkSetStringMacro(OriginalPointIdsName);
199  virtual const char* GetOriginalPointIdsName()
200  {
201  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
202  }
204 
206 
217  vtkSetMacro(NonlinearSubdivisionLevel, int);
218  vtkGetMacro(NonlinearSubdivisionLevel, int);
220 
222 
227  vtkSetMacro(Delegation, vtkTypeBool);
228  vtkGetMacro(Delegation, vtkTypeBool);
229  vtkBooleanMacro(Delegation, vtkTypeBool);
231 
233 
237  virtual int StructuredExecute(
238  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
239 #ifdef VTK_USE_64BIT_IDS
240  virtual int StructuredExecute(
241  vtkDataSet* input, vtkPolyData* output, const int* ext32, const int* wholeExt32)
242  {
243  vtkIdType ext[6];
244  vtkIdType wholeExt[6];
245  for (int cc = 0; cc < 6; cc++)
246  {
247  ext[cc] = ext32[cc];
248  wholeExt[cc] = wholeExt32[cc];
249  }
250  return this->StructuredExecute(input, output, ext, wholeExt);
251  }
252 #endif
253 
262  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
264 
268  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
269  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
270  vtkIdType* wholeExt, bool extractface[6]);
272 
277  int UnstructuredGridExecute(
279 #ifdef VTK_USE_64BIT_IDS
280  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, const int* ext32,
281  const int* wholeExt32, bool extractface[6])
282  {
283  vtkIdType ext[6];
284  vtkIdType wholeExt[6];
285  for (int cc = 0; cc < 6; cc++)
286  {
287  ext[cc] = ext32[cc];
288  wholeExt[cc] = wholeExt32[cc];
289  }
290  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
291  }
292 #endif
293 
295 protected:
297  ~vtkDataSetSurfaceFilter() override;
298 
300 
302  int FillInputPortInformation(int port, vtkInformation* info) override;
303 
304  // Helper methods.
305 
313  void EstimateStructuredDataArraySizes(
314  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
315 
316  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
317  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
318 
319  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
320  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
321 
322  void InitializeQuadHash(vtkIdType numPoints);
323  void DeleteQuadHash();
324  virtual void InsertQuadInHash(
325  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
326  virtual void InsertTriInHash(
327  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
328  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
329  void InitQuadHashTraversal();
330  vtkFastGeomQuad* GetNextVisibleQuadFromHash();
331 
336 
338  vtkIdType GetOutputPointId(
339  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
340  vtkIdType GetOutputPointIdAndInterpolate(vtkIdType inPtId, vtkDataSet* input, vtkCell* cell,
341  double* weights, vtkPoints* outPts, vtkPointData* outPD);
342 
343  class vtkEdgeInterpolationMap;
344 
345  vtkEdgeInterpolationMap* EdgeMap;
347  "Use GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input, vtkCell* "
348  "cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD) instead")
349  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
350  vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
351  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
352  vtkCell* cell, double pcoords[3], double* weights, vtkPoints* outPts, vtkPointData* outPD);
353  vtkIdType GetInterpolatedPointId(vtkDataSet* input, vtkCell* cell, double pcoords[3],
354  double* weights, vtkPoints* outPts, vtkPointData* outPD);
355  vtkIdType NumberOfNewCells;
356 
357  // Better memory allocation for faces (hash)
358  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
359  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
360  void DeleteAllFastGeomQuads();
361  // -----
362  vtkIdType FastGeomQuadArrayLength;
363  vtkIdType NumberOfFastGeomQuadArrays;
364  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
365  // These indexes allow us to find the next available face.
366  vtkIdType NextArrayIndex;
367  vtkIdType NextQuadIndex;
368 
369  int PieceInvariant;
370 
371  vtkTypeBool PassThroughCellIds;
372  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
373  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
374  vtkIdTypeArray* OriginalCellIds;
375  char* OriginalCellIdsName;
376 
377  vtkTypeBool PassThroughPointIds;
378  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
379  vtkIdTypeArray* OriginalPointIds;
380  char* OriginalPointIdsName;
381 
382  int NonlinearSubdivisionLevel;
383  vtkTypeBool Delegation;
384  bool FastMode;
385 
386 private:
387  int UnstructuredGridBaseExecute(vtkDataSet* input, vtkPolyData* output);
388  int UnstructuredGridExecuteInternal(vtkUnstructuredGridBase* input, vtkPolyData* output,
389  bool handleSubdivision, vtkSmartPointer<vtkCellIterator> cellIter);
390 
391  int StructuredExecuteNoBlanking(
392  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
393 
395  void operator=(const vtkDataSetSurfaceFilter&) = delete;
396 };
397 
398 #endif
#define VTK_DEPRECATED_IN_9_1_0(reason)
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
represent and manipulate point attribute data
Definition: vtkPointData.h:41
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
dynamic, self-adjusting array of vtkIdType
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:32
int vtkIdType
Definition: vtkType.h:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
abstract class to specify cell behavior
Definition: vtkCell.h:60
Superclass for algorithms that produce only polydata as output.
struct vtkFastGeomQuadStruct * Next
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
topologically regular array of data
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...
Store zero or more vtkInformation instances.
Efficient cell iterator for vtkDataSet topologies.
Extracts outer surface (as vtkPolyData) of any dataset.
dataset represents arbitrary combinations of all possible cell types.
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkEdgeInterpolationMap * EdgeMap
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.