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 =========================================================================*/
30 #ifndef __vtkDataSetSurfaceFilter_h
31 #define __vtkDataSetSurfaceFilter_h
32 
33 #include "vtkPolyDataAlgorithm.h"
34 
35 
36 class vtkPointData;
37 class vtkPoints;
38 class vtkIdTypeArray;
39 
40 //BTX
41 // Helper structure for hashing faces.
43 {
46  int numPts;
47  vtkIdType ptArray[4]; // actually a variable length array. MUST be last
48 };
50 //ETX
51 
53 {
54 public:
55  static vtkDataSetSurfaceFilter *New();
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
60 
63  vtkSetMacro(UseStrips, int);
64  vtkGetMacro(UseStrips, int);
65  vtkBooleanMacro(UseStrips, int);
67 
69 
72  vtkSetMacro(PieceInvariant, int);
73  vtkGetMacro(PieceInvariant, int);
75 
77 
83  vtkSetMacro(PassThroughCellIds,int);
84  vtkGetMacro(PassThroughCellIds,int);
85  vtkBooleanMacro(PassThroughCellIds,int);
86  vtkSetMacro(PassThroughPointIds,int);
87  vtkGetMacro(PassThroughPointIds,int);
88  vtkBooleanMacro(PassThroughPointIds,int);
90 
92 
96  vtkSetStringMacro(OriginalCellIdsName);
97  virtual const char *GetOriginalCellIdsName() {
98  return ( this->OriginalCellIdsName
99  ? this->OriginalCellIdsName : "vtkOriginalCellIds");
100  }
101  vtkSetStringMacro(OriginalPointIdsName);
102  virtual const char *GetOriginalPointIdsName() {
103  return ( this->OriginalPointIdsName
104  ? this->OriginalPointIdsName : "vtkOriginalPointIds");
105  }
107 
109 
119  vtkSetMacro(NonlinearSubdivisionLevel, int);
120  vtkGetMacro(NonlinearSubdivisionLevel, int);
122 
124 
126  virtual int StructuredExecute(vtkDataSet *input,
127  vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt);
128 #ifdef VTK_USE_64BIT_IDS
129  virtual int StructuredExecute(vtkDataSet *input,
130  vtkPolyData *output, int *ext32, int *wholeExt32)
131  {
132  vtkIdType ext[6]; vtkIdType wholeExt[6];
133  for (int cc=0; cc < 6; cc++)
134  {
135  ext[cc] = ext32[cc];
136  wholeExt[cc] = wholeExt32[cc];
137  }
138  return this->StructuredExecute(input, output, ext, wholeExt);
139  }
140 #endif
141  virtual int UnstructuredGridExecute(vtkDataSet *input, vtkPolyData *output);
142  virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output);
144 
145 protected:
148 
150 
152 
155 
156 
157  // Helper methods.
158  void ExecuteFaceStrips(vtkDataSet *input, vtkPolyData *output,
159  int maxFlag, vtkIdType *ext,
160  int aAxis, int bAxis, int cAxis,
161  vtkIdType *wholeExt);
162  void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output,
163  int maxFlag, vtkIdType *ext,
164  int aAxis, int bAxis, int cAxis,
165  vtkIdType *wholeExt);
166 
167  void InitializeQuadHash(vtkIdType numPoints);
168  void DeleteQuadHash();
169  virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d,
170  vtkIdType sourceId);
171  virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c,
172  vtkIdType sourceId, vtkIdType faceId = -1);
173  virtual void InsertPolygonInHash(vtkIdType* ids, int numpts,
174  vtkIdType sourceId);
175  void InitQuadHashTraversal();
176  vtkFastGeomQuad *GetNextVisibleQuadFromHash();
177 
182 
184  vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input,
185  vtkPoints *outPts, vtkPointData *outPD);
186 //BTX
187  class vtkEdgeInterpolationMap;
188 //ETX
189  vtkEdgeInterpolationMap *EdgeMap;
190  vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB,
191  vtkDataSet *input, vtkCell *cell,
192  double pcoords[3], vtkPoints *outPts,
193  vtkPointData *outPD);
194 
196 
197  // Better memory allocation for faces (hash)
198  void InitFastGeomQuadAllocation(vtkIdType numberOfCells);
199  vtkFastGeomQuad* NewFastGeomQuad(int numPts);
200  void DeleteAllFastGeomQuads();
201  // -----
204  unsigned char** FastGeomQuadArrays; // store this data as an array of bytes
205  // These indexes allow us to find the next available face.
208 
210 
212  void RecordOrigCellId(vtkIdType newIndex, vtkIdType origId);
213  virtual void RecordOrigCellId(vtkIdType newIndex, vtkFastGeomQuad *quad);
216 
218  void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId);
221 
223 
224 private:
225  vtkDataSetSurfaceFilter(const vtkDataSetSurfaceFilter&); // Not implemented.
226  void operator=(const vtkDataSetSurfaceFilter&); // Not implemented.
227 };
228 
229 #endif
#define VTK_GRAPHICS_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
represent and manipulate point attribute data
Definition: vtkPointData.h:35
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual const char * GetOriginalCellIdsName()
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
abstract class to specify cell behavior
Definition: vtkCell.h:57
Superclass for algorithms that produce only polydata as output.
struct vtkFastGeomQuadStruct * Next
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual const char * GetOriginalPointIdsName()
Store zero or more vtkInformation instances.
Extracts outer (polygonal) surface.
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkEdgeInterpolationMap * EdgeMap