Commit 416e29e7 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added GetMaxCellSize() method.

parent 28779263
......@@ -64,6 +64,8 @@ public:
void ReverseCell(int loc);
void ReplaceCell(int loc, int npts, int *pts);
int GetMaxCellSize();
// miscellaneous pointer type operations (for fast read/write operations)
int *GetPtr();
int *WritePtr(const int ncells, const int size);
......
......@@ -21,3 +21,18 @@ vlCellArray::vlCellArray (const vlCellArray& ca)
this->Location = 0;
this->Ia = ca.Ia;
}
// Description:
// Returns the size of the largest cell. The size is the number of points
// defining the cell.
int vlCellArray::GetMaxCellSize()
{
int i, npts, maxSize=0;
for (i=0; i<this->Ia.GetMaxId(); i+=npts+1)
{
if ( (npts=this->Ia.GetValue(i)) > maxSize )
maxSize = npts;
}
return maxSize;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment