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:
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);
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:
173 
175 
177 
180 
181  // Helper methods.
182 
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);
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);
211 
216 
219  vtkIdType inPtId, vtkDataSet* input, vtkPoints* outPts, vtkPointData* outPD);
220 
221  class vtkEdgeInterpolationMap;
222 
223  vtkEdgeInterpolationMap* EdgeMap;
225  vtkCell* cell, double pcoords[3], vtkPoints* outPts, vtkPointData* outPD);
226 
228 
229  // Better memory allocation for faces (hash)
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkFastGeomQuadStruct::ptArray
vtkIdType * ptArray
Definition: vtkDataSetSurfaceFilter.h:45
vtkFastGeomQuadStruct::SourceId
vtkIdType SourceId
Definition: vtkDataSetSurfaceFilter.h:43
vtkDataSetSurfaceFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkFastGeomQuadStruct::numPts
int numPts
Definition: vtkDataSetSurfaceFilter.h:44
vtkDataSetSurfaceFilter::DataSetExecute
virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output)
vtkDataSetSurfaceFilter::NextArrayIndex
vtkIdType NextArrayIndex
Definition: vtkDataSetSurfaceFilter.h:238
vtkDataSetSurfaceFilter::NewFastGeomQuad
vtkFastGeomQuad * NewFastGeomQuad(int numPts)
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:32
vtkFastGeomQuadStruct::Next
struct vtkFastGeomQuadStruct * Next
Definition: vtkDataSetSurfaceFilter.h:42
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkDataSetSurfaceFilter::FastGeomQuadArrays
unsigned char ** FastGeomQuadArrays
Definition: vtkDataSetSurfaceFilter.h:236
vtkDataSetSurfaceFilter::FastGeomQuadArrayLength
vtkIdType FastGeomQuadArrayLength
Definition: vtkDataSetSurfaceFilter.h:234
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkDataSetSurfaceFilter::QuadHashLength
vtkIdType QuadHashLength
Definition: vtkDataSetSurfaceFilter.h:213
vtkDataSetSurfaceFilter::QuadHashTraversal
vtkFastGeomQuad * QuadHashTraversal
Definition: vtkDataSetSurfaceFilter.h:214
vtkStructuredGrid
topologically regular array of data
Definition: vtkStructuredGrid.h:58
vtkDataSetSurfaceFilter::GetOriginalCellIdsName
virtual const char * GetOriginalCellIdsName()
Definition: vtkDataSetSurfaceFilter.h:102
vtkDataSetSurfaceFilter::QuadHashTraversalIndex
vtkIdType QuadHashTraversalIndex
Definition: vtkDataSetSurfaceFilter.h:215
vtkDataSetSurfaceFilter::OriginalCellIds
vtkIdTypeArray * OriginalCellIds
Definition: vtkDataSetSurfaceFilter.h:246
vtkDataSetSurfaceFilter::PointMap
vtkIdType * PointMap
Definition: vtkDataSetSurfaceFilter.h:217
vtkDataSetSurfaceFilter::GetNextVisibleQuadFromHash
vtkFastGeomQuad * GetNextVisibleQuadFromHash()
vtkDataSetSurfaceFilter::InsertTriInHash
virtual void InsertTriInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType sourceId, vtkIdType faceId=-1)
vtkDataSetSurfaceFilter::PassThroughCellIds
vtkTypeBool PassThroughCellIds
Definition: vtkDataSetSurfaceFilter.h:243
vtkDataSetSurfaceFilter::InsertPolygonInHash
virtual void InsertPolygonInHash(const vtkIdType *ids, int numpts, vtkIdType sourceId)
vtkDataSetSurfaceFilter::vtkDataSetSurfaceFilter
vtkDataSetSurfaceFilter()
vtkPolyDataAlgorithm.h
vtkDataSetSurfaceFilter
Extracts outer (polygonal) surface.
Definition: vtkDataSetSurfaceFilter.h:50
vtkDataSetSurfaceFilter::ExecuteFaceQuads
void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output, int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis, vtkIdType *wholeExt)
vtkDataSetSurfaceFilter::InsertQuadInHash
virtual void InsertQuadInHash(vtkIdType a, vtkIdType b, vtkIdType c, vtkIdType d, vtkIdType sourceId)
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkDataSetSurfaceFilter::OriginalCellIdsName
char * OriginalCellIdsName
Definition: vtkDataSetSurfaceFilter.h:247
vtkDataSetSurfaceFilter::New
static vtkDataSetSurfaceFilter * New()
vtkDataSetSurfaceFilter::InitFastGeomQuadAllocation
void InitFastGeomQuadAllocation(vtkIdType numberOfCells)
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:57
vtkDataSetSurfaceFilter::OriginalPointIdsName
char * OriginalPointIdsName
Definition: vtkDataSetSurfaceFilter.h:252
vtkDataSetSurfaceFilter::GetOutputPointId
vtkIdType GetOutputPointId(vtkIdType inPtId, vtkDataSet *input, vtkPoints *outPts, vtkPointData *outPD)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkDataSetSurfaceFilter::ExecuteFaceQuads
void ExecuteFaceQuads(vtkDataSet *input, vtkPolyData *output, int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis, vtkIdType *wholeExt, bool checkVisibility)
vtkDataSetSurfaceFilter::DeleteQuadHash
void DeleteQuadHash()
vtkDataSetSurfaceFilter::InitializeQuadHash
void InitializeQuadHash(vtkIdType numPoints)
vtkDataSetSurfaceFilter::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkDataSetSurfaceFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataSetSurfaceFilter::~vtkDataSetSurfaceFilter
~vtkDataSetSurfaceFilter() override
vtkDataSetSurfaceFilter::NumberOfFastGeomQuadArrays
vtkIdType NumberOfFastGeomQuadArrays
Definition: vtkDataSetSurfaceFilter.h:235
vtkDataSetSurfaceFilter::PieceInvariant
int PieceInvariant
Definition: vtkDataSetSurfaceFilter.h:241
vtkDataSetSurfaceFilter::RecordOrigPointId
void RecordOrigPointId(vtkIdType newIndex, vtkIdType origId)
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkDataSetSurfaceFilter::StructuredExecute
virtual int StructuredExecute(vtkDataSet *input, vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt)
Direct access methods that can be used to use the this class as an algorithm without using it as a fi...
vtkDataSetSurfaceFilter::DeleteAllFastGeomQuads
void DeleteAllFastGeomQuads()
vtkDataSetSurfaceFilter::StructuredWithBlankingExecute
virtual int StructuredWithBlankingExecute(vtkStructuredGrid *input, vtkPolyData *output)
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:36
vtkDataSetSurfaceFilter::NumberOfNewCells
vtkIdType NumberOfNewCells
Definition: vtkDataSetSurfaceFilter.h:227
vtkDataSetSurfaceFilter::NextQuadIndex
vtkIdType NextQuadIndex
Definition: vtkDataSetSurfaceFilter.h:239
vtkDataSetSurfaceFilter::OriginalPointIds
vtkIdTypeArray * OriginalPointIds
Definition: vtkDataSetSurfaceFilter.h:251
vtkDataSetSurfaceFilter::GetOriginalPointIdsName
virtual const char * GetOriginalPointIdsName()
Definition: vtkDataSetSurfaceFilter.h:107
vtkDataSetSurfaceFilter::UniformGridExecute
virtual int UniformGridExecute(vtkDataSet *input, vtkPolyData *output, vtkIdType *ext, vtkIdType *wholeExt, bool extractface[6])
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkDataSetSurfaceFilter::EdgeMap
vtkEdgeInterpolationMap * EdgeMap
Definition: vtkDataSetSurfaceFilter.h:221
vtkDataSetSurfaceFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkFastGeomQuadStruct
Definition: vtkDataSetSurfaceFilter.h:41
vtkDataSetSurfaceFilter::UseStrips
vtkTypeBool UseStrips
Definition: vtkDataSetSurfaceFilter.h:174
vtkDataSetSurfaceFilter::GetInterpolatedPointId
vtkIdType GetInterpolatedPointId(vtkIdType edgePtA, vtkIdType edgePtB, vtkDataSet *input, vtkCell *cell, double pcoords[3], vtkPoints *outPts, vtkPointData *outPD)
vtkDataSetSurfaceFilter::UnstructuredGridExecute
virtual int UnstructuredGridExecute(vtkDataSet *input, vtkPolyData *output)
vtkDataSetSurfaceFilter::InitQuadHashTraversal
void InitQuadHashTraversal()
vtkDataSetSurfaceFilter::EstimateStructuredDataArraySizes
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...
vtkDataSetSurfaceFilter::QuadHash
vtkFastGeomQuad ** QuadHash
Definition: vtkDataSetSurfaceFilter.h:212
vtkDataSetSurfaceFilter::PassThroughPointIds
vtkTypeBool PassThroughPointIds
Definition: vtkDataSetSurfaceFilter.h:249
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkDataSetSurfaceFilter::ExecuteFaceStrips
void ExecuteFaceStrips(vtkDataSet *input, vtkPolyData *output, int maxFlag, vtkIdType *ext, int aAxis, int bAxis, int cAxis, vtkIdType *wholeExt)
vtkDataSetSurfaceFilter::NonlinearSubdivisionLevel
int NonlinearSubdivisionLevel
Definition: vtkDataSetSurfaceFilter.h:254
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:42