Commit fd0a0f3c authored by Ken Martin's avatar Ken Martin
Browse files

compiler fix

parent fafa668c
......@@ -45,10 +45,10 @@ public:
char *GetClassName() {return "vlCellArray";};
int GetNumberOfCells();
void InsertNextCell(int npts, int* pts);
void InsertNextCell(int npts);
int InsertNextCell(int npts, int* pts);
int InsertNextCell(int npts);
void InsertCellPoint(int id);
void InsertNextCell(vlCell *cell);
int InsertNextCell(vlCell *cell);
int EstimateSize(int numCells, int maxPtsPerCell);
void Squeeze();
......@@ -76,7 +76,7 @@ inline int vlCellArray::GetNumberOfCells() {return this->NumberOfCells;};
// Description:
// Create a cell by specifying the number of pts and an array of point id's
inline void vlCellArray::InsertNextCell(int npts, int* pts)
inline int vlCellArray::InsertNextCell(int npts, int* pts)
{
int id = this->Ia.GetMaxId() + npts + 1;
this->Ia.InsertValue(id,pts[npts-1]);
......@@ -84,16 +84,20 @@ inline void vlCellArray::InsertNextCell(int npts, int* pts)
for (int i=0; i<npts-1; i++) this->Ia[id-npts+i+1] = pts[i];
this->NumberOfCells++;
this->Location += npts + 1;
return this->NumberOfCells;
}
// Description:
// Create cells by specifying count, and then adding points one at a time using
// method InsertCellPoint(). WARNING: it is the user's responsibility not to
// exceed the maximum allowable points per cell (MAX_CELL_SIZE).
inline void vlCellArray::InsertNextCell(int npts)
inline int vlCellArray::InsertNextCell(int npts)
{
this->Location = this->Ia.InsertNextValue(npts) + 1;
this->NumberOfCells++;
return this->NumberOfCells;
}
// Description:
......@@ -106,7 +110,7 @@ inline void vlCellArray::InsertCellPoint(int id)
// Description:
// Insert a cell object.
inline void vlCellArray::InsertNextCell(vlCell *cell)
inline int vlCellArray::InsertNextCell(vlCell *cell)
{
int npts = cell->GetNumberOfPoints();
int id = this->Ia.GetMaxId() + npts + 1;
......@@ -115,6 +119,8 @@ inline void vlCellArray::InsertNextCell(vlCell *cell)
for (int i=0; i<npts-1; i++) this->Ia[id-npts+i+1] = cell->PointIds.GetId(i);
this->NumberOfCells++;
this->Location += npts + 1;
return this->NumberOfCells;
}
// Description:
......
......@@ -74,7 +74,7 @@ public:
// Allocate storage for cells when using the following InsertNextCell method
void Allocate(int numCells=1000, int extSize=1000);
// create verts, lines, polys, tmeshes from cell object
void InsertNextCell(int type, int npts, int pts[MAX_CELL_SIZE]);
int InsertNextCell(int type, int npts, int pts[MAX_CELL_SIZE]);
// Use this method to reclaim memory when using InsertNextCell()
void Squeeze();
......
......@@ -461,29 +461,32 @@ void vlPolyData::Allocate(int numCells, int extSize)
// the PolyData::Allocate() function has been called first or that vertex,
// line, polygon, and triangle strip arrays have been supplied.
void vlPolyData::InsertNextCell(int type, int npts, int pts[MAX_CELL_SIZE])
int vlPolyData::InsertNextCell(int type, int npts, int pts[MAX_CELL_SIZE])
{
int id = 0;
switch (type)
{
case vlPOINT: case vlPOLY_POINTS:
this->Verts->InsertNextCell(npts,pts);
id = this->Verts->InsertNextCell(npts,pts);
break;
case vlLINE: case vlPOLY_LINE:
this->Lines->InsertNextCell(npts,pts);
id = this->Lines->InsertNextCell(npts,pts);
break;
case vlTRIANGLE: case vlQUAD: case vlPOLYGON:
this->Polys->InsertNextCell(npts,pts);
id = this->Polys->InsertNextCell(npts,pts);
break;
case vlTRIANGLE_STRIP:
this->Strips->InsertNextCell(npts,pts);
id = this->Strips->InsertNextCell(npts,pts);
break;
default:
vlErrorMacro(<<"Bad cell type! Can't insert!");
}
return id;
}
// Description:
......
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