VTK  9.0.1
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 =========================================================================*/
28 #ifndef vtkDataSetSurfaceFilter_h
29 #define vtkDataSetSurfaceFilter_h
30 
31 #include "vtkFiltersGeometryModule.h" // For export macro
32 #include "vtkPolyDataAlgorithm.h"
33 
34 class vtkPointData;
35 class vtkPoints;
36 class vtkIdTypeArray;
37 class vtkStructuredGrid;
38 
39 // Helper structure for hashing faces.
41 {
44  int numPts;
46 };
48 
49 class VTKFILTERSGEOMETRY_EXPORT vtkDataSetSurfaceFilter : public vtkPolyDataAlgorithm
50 {
51 public:
52  static vtkDataSetSurfaceFilter* New();
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
62  vtkSetMacro(UseStrips, vtkTypeBool);
63  vtkGetMacro(UseStrips, vtkTypeBool);
64  vtkBooleanMacro(UseStrips, vtkTypeBool);
66 
68 
73  vtkSetMacro(PieceInvariant, int);
74  vtkGetMacro(PieceInvariant, int);
76 
78 
86  vtkSetMacro(PassThroughCellIds, vtkTypeBool);
87  vtkGetMacro(PassThroughCellIds, vtkTypeBool);
88  vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
89  vtkSetMacro(PassThroughPointIds, vtkTypeBool);
90  vtkGetMacro(PassThroughPointIds, vtkTypeBool);
91  vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
93 
95 
101  vtkSetStringMacro(OriginalCellIdsName);
102  virtual const char* GetOriginalCellIdsName()
103  {
104  return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
105  }
106  vtkSetStringMacro(OriginalPointIdsName);
107  virtual const char* GetOriginalPointIdsName()
108  {
109  return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
110  }
112 
114 
125  vtkSetMacro(NonlinearSubdivisionLevel, int);
126  vtkGetMacro(NonlinearSubdivisionLevel, int);
128 
130 
134  virtual int StructuredExecute(
135  vtkDataSet* input, vtkPolyData* output, vtkIdType* ext, vtkIdType* wholeExt);
136 #ifdef VTK_USE_64BIT_IDS
137  virtual int StructuredExecute(vtkDataSet* input, vtkPolyData* output, int* ext32, int* wholeExt32)
138  {
139  vtkIdType ext[6];
140  vtkIdType wholeExt[6];
141  for (int cc = 0; cc < 6; cc++)
142  {
143  ext[cc] = ext32[cc];
144  wholeExt[cc] = wholeExt32[cc];
145  }
146  return this->StructuredExecute(input, output, ext, wholeExt);
147  }
148 #endif
149  virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
150  virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
151  virtual int StructuredWithBlankingExecute(vtkStructuredGrid* input, vtkPolyData* output);
152  virtual int UniformGridExecute(vtkDataSet* input, vtkPolyData* output, vtkIdType* ext,
153  vtkIdType* wholeExt, bool extractface[6]);
154 #ifdef VTK_USE_64BIT_IDS
155  virtual int UniformGridExecute(
156  vtkDataSet* input, vtkPolyData* output, int* ext32, int* wholeExt32, bool extractface[6])
157  {
158  vtkIdType ext[6];
159  vtkIdType wholeExt[6];
160  for (int cc = 0; cc < 6; cc++)
161  {
162  ext[cc] = ext32[cc];
163  wholeExt[cc] = wholeExt32[cc];
164  }
165  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
166  }
167 #endif
168 
169 
170 protected:
172  ~vtkDataSetSurfaceFilter() override;
173 
175 
177 
179  int FillInputPortInformation(int port, vtkInformation* info) override;
180 
181  // Helper methods.
182 
190  void EstimateStructuredDataArraySizes(
191  vtkIdType* ext, vtkIdType* wholeExt, vtkIdType& numPoints, vtkIdType& numCells);
192 
193  void ExecuteFaceStrips(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
194  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
195 
196  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
197  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt, bool checkVisibility);
198 
199  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, vtkIdType* ext,
200  int aAxis, int bAxis, int cAxis, vtkIdType* wholeExt);
201 
202  void InitializeQuadHash(vtkIdType numPoints);
203  void DeleteQuadHash();
204  virtual void InsertQuadInHash(
205  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId);
206  virtual void InsertTriInHash(
207  vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId = -1);
208  virtual void InsertPolygonInHash(const vtkIdType* ids, int numpts, vtkIdType sourceId);
209  void InitQuadHashTraversal();
210  vtkFastGeomQuad* GetNextVisibleQuadFromHash();
211 
216 
218  vtkIdType GetOutputPointId(
219  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
220 
221  class vtkEdgeInterpolationMap;
222 
223  vtkEdgeInterpolationMap* EdgeMap;
224  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet* input,
225  vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
226 
228 
229  // Better memory allocation for faces (hash)
230  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
231  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
232  void DeleteAllFastGeomQuads();
233  // -----
236  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
237  // These indexes allow us to find the next available face.
240 
242 
244  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
245  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad* quad);
248 
250  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
253 
255 
256 private:
258  void operator=(const vtkDataSetSurfaceFilter&) = delete;
259 };
260 
261 #endif
represent and manipulate point attribute data
Definition: vtkPointData.h:31
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
virtual const char * GetOriginalCellIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:338
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
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:56
Superclass for algorithms that produce only polydata as output.
struct vtkFastGeomQuadStruct * Next
a simple class to control print indentation
Definition: vtkIndent.h:33
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.
Extracts outer (polygonal) surface.
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkEdgeInterpolationMap * EdgeMap
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.