devel/CSGLib/src/Solid.cpp
/**
 * Sets the solid data. An exception may occur in the case of abnormal arrays 
 * (indices making references to inexistent vertices, there are less colors 
 * than vertices...)
 * 
 * @param vertices array of points defining the solid vertices
 * @param indices array of indices for a array of vertices
 * @param colors array of colors defining the vertices colors 
 */
Sets the solid data. An exception may occur in the case of abnormal arrays
(indices making references to inexistent vertices, there are less colors
than vertices...)

@param vertices array of points defining the solid vertices
@param indices array of indices for a array of vertices
@param colors array of colors defining the vertices colors
Sets the solid data . An exception may occur in the case of abnormal arrays ( indices making references to inexistent vertices there are less colors than vertices ... ) @param vertices array of points defining the solid vertices @param indices array of indices for a array of vertices @param colors array of colors defining the vertices colors
void Solid::setData(VectorSet & vertices, IntSet & indices, ColorSet & colors)
{
	if(indices.length > 0)
	{
		for(int i=0; i<vertices.length; i++)
		{
			this->vertices.AddVector(vertices[i]);
			this->colors.AddColor(colors[i]);
		}
		for(int i=0; i<indices.length; i++)
		{
			this->indices.AddInt(indices[i]);
		}
		defineGeometry();
	}
}
void Solid :: setData ( VectorSet & vertices , IntSet & indices , ColorSet & colors ) { if ( indices . length > 0 ) { for ( int i = 0 ; i < vertices . length ; i ++ ) { this -> vertices . AddVector ( vertices [ i ] ) ; this -> colors . AddColor ( colors [ i ] ) ; } for ( int i = 0 ; i < indices . length ; i ++ ) { this -> indices . AddInt ( indices [ i ] ) ; } defineGeometry ( ) ; } }
Sets the solid data.
Sets the solid data .
// Clear them... //this->vertices = new VectorSet(); //this->colors = new ColorSet(); //this->indices = new IntSet(); //this->vertices.Clear(); //this->colors.Clear(); //this->indices.Clear(); // Should add cloning to vectorset, and other 2 sets //this->indices.AddInt(indices[i]);