63 #ifndef __vtkPolyData_h
64 #define __vtkPolyData_h
66 #include "vtkCommonDataModelModule.h"
67 #include "vtkPointSet.h"
69 #include "vtkCellTypes.h"
79 class vtkTriangleStrip;
82 class VTKCOMMONDATAMODEL_EXPORT
vtkPolyData :
public vtkPointSet
88 void PrintSelf(ostream& os, vtkIndent indent);
95 void CopyStructure(vtkDataSet *ds);
99 vtkIdType GetNumberOfCells();
100 vtkCell *GetCell(vtkIdType cellId);
102 int GetCellType(vtkIdType cellId);
103 void GetCellBounds(vtkIdType cellId,
double bounds[6]);
104 void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
114 vtkPointLocator *locator = NULL);
118 void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
122 void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
125 void ComputeBounds();
134 int GetMaxCellSize();
167 vtkIdType GetNumberOfVerts();
168 vtkIdType GetNumberOfLines();
169 vtkIdType GetNumberOfPolys();
170 vtkIdType GetNumberOfStrips();
179 void Allocate(vtkIdType numCells=1000,
int extSize=1000);
191 void Allocate(
vtkPolyData *inPolyData, vtkIdType numCells=1000,
201 int InsertNextCell(
int type,
int npts, vtkIdType *pts);
209 int InsertNextCell(
int type, vtkIdList *pts);
223 void BuildLinks(
int initialSize=0);
235 void GetPointCells(vtkIdType ptId,
unsigned short& ncells,
243 void GetCellEdgeNeighbors(vtkIdType cellId, vtkIdType p1, vtkIdType p2,
249 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType* &pts);
253 int IsTriangle(
int v1,
int v2,
int v3);
260 int IsEdge(vtkIdType p1, vtkIdType p2);
264 int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
271 void ReplaceCell(vtkIdType cellId,
int npts, vtkIdType *pts);
275 void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId,
280 void ReverseCell(vtkIdType cellId);
284 void DeletePoint(vtkIdType ptId);
285 void DeleteCell(vtkIdType cellId);
293 void RemoveDeletedCells();
302 int InsertNextLinkedPoint(
int numLinks);
303 int InsertNextLinkedPoint(
double x[3],
int numLinks);
309 int InsertNextLinkedCell(
int type,
int npts, vtkIdType *pts);
317 void ReplaceLinkedCell(vtkIdType cellId,
int npts, vtkIdType *pts);
324 void RemoveCellReference(vtkIdType cellId);
331 void AddCellReference(vtkIdType cellId);
338 void RemoveReferenceToCell(vtkIdType ptId, vtkIdType cellId);
344 void AddReferenceToCell(vtkIdType ptId, vtkIdType cellId);
348 void ResizeCellList(vtkIdType ptId,
int size);
351 virtual void Initialize();
355 virtual int GetPiece();
356 virtual int GetNumberOfPieces();
360 virtual int GetGhostLevel();
367 unsigned long GetActualMemorySize();
377 void RemoveGhostCells(
int level);
383 static vtkPolyData* GetData(vtkInformationVector* v,
int i=0);
405 ERR_NO_SUCH_FIELD = -4,
406 ERR_INCORRECT_FIELD = -3,
407 ERR_NON_MANIFOLD_STAR = -2,
414 int GetScalarFieldCriticalIndex (vtkIdType pointId,
415 vtkDataArray *scalarField);
416 int GetScalarFieldCriticalIndex (vtkIdType pointId,
int fieldId);
417 int GetScalarFieldCriticalIndex (vtkIdType pointId,
const char* fieldName);
455 void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
456 {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
475 unsigned short int n1;
477 vtkIdType *cells, *tVerts2, n2;
489 if ( (tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] ||
490 tVerts[0] == tVerts2[2]) &&
491 (tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] ||
492 tVerts[1] == tVerts2[2]) &&
493 (tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] ||
494 tVerts[2] == tVerts2[2]) )
505 vtkIdType *pts, npts;
508 for (vtkIdType i=0; i < npts; i++)
510 if ( pts[i] == ptId )
526 this->
Cells->DeleteCell(cellId);
531 vtkIdType *pts, npts;
534 for (vtkIdType i=0; i<npts; i++)
542 vtkIdType *pts, npts;
545 for (vtkIdType i=0; i<npts; i++)
560 vtkIdType *verts, nverts;
563 for ( i=0; i < nverts; i++ )
565 if ( verts[i] == oldPtId )
static vtkCellArray * Dummy
void ResizeCellList(vtkIdType ptId, int size)
void AddCellReference(vtkIdType cellId, vtkIdType ptId)
object represents upward pointers from points to list of cells using each point
void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
a cell that represents a 3D point
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
void AddCellReference(vtkIdType cellId)
unsigned short GetNcells(vtkIdType ptId)
an empty cell used as a place-holder during processing
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkIdType * GetCells(vtkIdType ptId)
void RemoveCellReference(vtkIdType cellId)
void DeletePoint(vtkIdType ptId)
provides thread-safe access to cells
vtkPolyVertex * PolyVertex
int IsTriangle(int v1, int v2, int v3)
void ResizeCellList(vtkIdType ptId, int size)
int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId)
object to represent cell connectivity
a cell that represents a triangle
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
void DeleteCell(vtkIdType cellId)
void DeletePoint(vtkIdType ptId)
general representation of visualization data
cell represents a set of 1D lines
void RemoveCellReference(vtkIdType cellId, vtkIdType ptId)
vtkTriangleStrip * TriangleStrip