public void Assign( QueuedGeometry qgeom )
{
// Look up any current geometry
string formatString = GetGeometryFormatString( qgeom.geometry );
bool newBucket = true;
if ( currentGeometryMap.ContainsKey( formatString ) )
{
GeometryBucket gbucket = currentGeometryMap[ formatString ];
// Found existing geometry, try to assign
newBucket = !gbucket.Assign( qgeom );
// Note that this bucket will be replaced as the 'current'
// for this format string below since it's out of space
}
// Do we need to create a new one?
if ( newBucket )
{
GeometryBucket gbucket = new GeometryBucket( this, formatString, qgeom.geometry.vertexData, qgeom.geometry.indexData );
// Add to main list
geometryBucketList.Add( gbucket );
// Also index in 'current' list
currentGeometryMap[ formatString ] = gbucket;
if ( !gbucket.Assign( qgeom ) )
{
throw new AxiomException( "Somehow we couldn't fit the requested geometry even in a " +
"brand new GeometryBucket!! Must be a bug, please report." );
}
}
}