40 #ifndef __vtkCellArray_h
41 #define __vtkCellArray_h
43 #include "vtkCommonDataModelModule.h"
44 #include "vtkObject.h"
46 #include "vtkIdTypeArray.h"
53 void PrintSelf(ostream& os, vtkIndent indent);
60 int Allocate(
const vtkIdType sz,
const int ext=1000)
61 {
return this->Ia->Allocate(sz,ext);}
69 vtkGetMacro(NumberOfCells, vtkIdType);
75 vtkSetMacro(NumberOfCells, vtkIdType);
86 {
return numCells*(1+maxPtsPerCell);}
98 int GetNextCell(vtkIdType& npts, vtkIdType* &pts);
103 int GetNextCell(vtkIdList *pts);
108 {
return this->Ia->GetSize();}
116 {
return this->Ia->GetMaxId()+1;}
121 void GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType* &pts);
125 void GetCell(vtkIdType loc, vtkIdList* pts);
128 vtkIdType InsertNextCell(vtkCell *cell);
132 vtkIdType InsertNextCell(vtkIdType npts,
const vtkIdType* pts);
136 vtkIdType InsertNextCell(vtkIdList *pts);
142 vtkIdType InsertNextCell(
int npts);
146 void InsertCellPoint(vtkIdType
id);
150 void UpdateCellCount(
int npts);
156 {
return (this->InsertLocation - npts - 1);};
162 {
return this->TraversalLocation;}
164 {this->TraversalLocation = loc;}
171 {
return(this->TraversalLocation-npts-1);}
176 void ReverseCell(vtkIdType loc);
179 void ReplaceCell(vtkIdType loc,
int npts,
const vtkIdType *pts);
183 int GetMaxCellSize();
188 {
return this->Ia->GetPointer(0);}
194 vtkIdType *WritePointer(
const vtkIdType ncells,
const vtkIdType size);
203 void SetCells(vtkIdType ncells, vtkIdTypeArray *cells);
220 {this->Ia->Squeeze();}
229 unsigned long GetActualMemorySize();
248 const vtkIdType* pts)
250 vtkIdType i = this->
Ia->GetMaxId() + 1;
251 vtkIdType *ptr = this->
Ia->WritePointer(i, npts+1);
253 for ( *ptr++ = npts, i = 0; i < npts; i++)
288 return this->
InsertNextCell(pts->GetNumberOfIds(), pts->GetPointer(0));
295 cell->PointIds->GetPointer(0));
310 if ( this->
Ia->GetMaxId() >= 0 &&
327 npts = this->
Ia->GetValue(loc++);
328 pts = this->
Ia->GetPointer(loc);
336 vtkIdType npts=this->
Ia->GetValue(loc);
337 vtkIdType *pts=this->
Ia->GetPointer(loc+1);
338 for (i=0; i < (npts/2); i++)
341 pts[i] = pts[npts-i-1];
348 const vtkIdType *pts)
350 vtkIdType *oldPts=this->
Ia->GetPointer(loc+1);
351 for (
int i=0; i < npts; i++)
359 const vtkIdType size)
364 return this->
Ia->WritePointer(0,size);
vtkIdType GetInsertLocation(int npts)
void InsertCellPoint(vtkIdType id)
void ReplaceCell(vtkIdType loc, int npts, const vtkIdType *pts)
void SetTraversalLocation(vtkIdType loc)
vtkIdType GetTraversalLocation(vtkIdType npts)
vtkIdType GetNumberOfConnectivityEntries()
vtkIdType EstimateSize(vtkIdType numCells, int maxPtsPerCell)
void ReverseCell(vtkIdType loc)
void UpdateCellCount(int npts)
vtkIdType TraversalLocation
vtkIdType InsertNextCell(vtkCell *cell)
vtkIdType * WritePointer(const vtkIdType ncells, const vtkIdType size)
object to represent cell connectivity
vtkIdTypeArray * GetData()
int GetNextCell(vtkIdType &npts, vtkIdType *&pts)
vtkIdType GetTraversalLocation()
int Allocate(const vtkIdType sz, const int ext=1000)
void GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)