VTK
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
105  ? this->OriginalCellIdsName : "vtkOriginalCellIds");
106  }
107  vtkSetStringMacro(OriginalPointIdsName);
108  virtual const char *GetOriginalPointIdsName()
109  {
110  return ( this->OriginalPointIdsName
111  ? this->OriginalPointIdsName : "vtkOriginalPointIds");
112  }
114 
116 
127  vtkSetMacro(NonlinearSubdivisionLevel, int);
128  vtkGetMacro(NonlinearSubdivisionLevel, int);
130 
132 
136  virtual int StructuredExecute(vtkDataSet *input,
137  vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt);
138 #ifdef VTK_USE_64BIT_IDS
139  virtual int StructuredExecute(vtkDataSet *input,
140  vtkPolyData *output, int *ext32, int *wholeExt32)
141  {
142  vtkIdType ext[6]; vtkIdType wholeExt[6];
143  for (int cc=0; cc < 6; cc++)
144  {
145  ext[cc] = ext32[cc];
146  wholeExt[cc] = wholeExt32[cc];
147  }
148  return this->StructuredExecute(input, output, ext, wholeExt);
149  }
150 #endif
151  virtual int UnstructuredGridExecute(vtkDataSet *input,
152  vtkPolyData *output);
153  virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output);
154  virtual int StructuredWithBlankingExecute(vtkStructuredGrid *input, vtkPolyData *output);
155  virtual int UniformGridExecute(
156  vtkDataSet *input, vtkPolyData *output,
157  vtkIdType *ext, vtkIdType *wholeExt, bool extractface[6] );
158 #ifdef VTK_USE_64BIT_IDS
159  virtual int UniformGridExecute(vtkDataSet *input,
160  vtkPolyData *output, int *ext32, int *wholeExt32, bool extractface[6] )
161  {
162  vtkIdType ext[6]; vtkIdType wholeExt[6];
163  for (int cc=0; cc < 6; cc++)
164  {
165  ext[cc] = ext32[cc];
166  wholeExt[cc] = wholeExt32[cc];
167  }
168  return this->UniformGridExecute(input, output, ext, wholeExt, extractface);
169  }
170 #endif
171 
172 
173 protected:
175  ~vtkDataSetSurfaceFilter() override;
176 
178 
180 
182  int FillInputPortInformation(int port, vtkInformation *info) override;
183 
184 
185  // Helper methods.
186 
194  void EstimateStructuredDataArraySizes(
195  vtkIdType *ext, vtkIdType *wholeExt,
196  vtkIdType &numPoints, vtkIdType &numCells );
197 
198  void ExecuteFaceStrips(vtkDataSet *input, vtkPolyData *output,
199  int maxFlag, vtkIdType *ext,
200  int aAxis, int bAxis, int cAxis,
201  vtkIdType *wholeExt);
202 
203  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
204  int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis,
205  vtkIdType *wholeExt, bool checkVisibility );
206 
207  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
208  int maxFlag, vtkIdType *ext,
209  int aAxis, int bAxis, int cAxis,
210  vtkIdType *wholeExt);
211 
212  void InitializeQuadHash(vtkIdType numPoints);
213  void DeleteQuadHash();
214  virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d,
215  vtkIdType sourceId);
216  virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c,
217  vtkIdType sourceId, vtkIdType faceId = -1);
218  virtual void InsertPolygonInHash(vtkIdType* ids, int numpts,
219  vtkIdType sourceId);
220  void InitQuadHashTraversal();
221  vtkFastGeomQuad *GetNextVisibleQuadFromHash();
222 
227 
229  vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input,
230  vtkPoints *outPts, vtkPointData *outPD);
231 
232  class vtkEdgeInterpolationMap;
233 
234  vtkEdgeInterpolationMap *EdgeMap;
235  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB,
236  vtkDataSet *input, vtkCell *cell,
237  double pcoords[3], vtkPoints *outPts,
238  vtkPointData *outPD);
239 
241 
242  // Better memory allocation for faces (hash)
243  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
244  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
245  void DeleteAllFastGeomQuads();
246  // -----
249  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
250  // These indexes allow us to find the next available face.
253 
255 
257  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
258  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad);
261 
263  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
266 
268 
269 private:
271  void operator=(const vtkDataSetSurfaceFilter&) = delete;
272 };
273 
274 #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:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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.