ContentAccumulator<_T>& operator += ( const Content<_T> & content ) { contentVector.push_back( content ); return *this; }
bool Use(const Content<_T> &content) { const Size &size = content.size; const Coord &coord = content.coord; topLefts.push_front ( Coord( coord.x + size.w, coord.y ) ); topLefts.push_back ( Coord( coord.x , coord.y + size.h ) ); contentVector.push_back( content ); needToSort = true; return true; }
bool Place(const typename Content<_T>::Vector &contentVector, typename Content<_T>::Vector &remainder) { bool placedAll = true; for( typename Content<_T>::Vector::const_iterator itor = contentVector.begin(); itor != contentVector.end(); itor++ ) { const Content<_T> & content = *itor; if( Place( content ) == false ) { placedAll = false; remainder.push_back( content ); } } return placedAll; }
bool CollectContent( typename Content<_T>::Vector &contentVector ) const { int z = 0; for(typename Canvas<_T>::Vector::const_iterator itor = canvasArray.begin(); itor != canvasArray.end(); itor++) { const typename Content<_T>::Vector &contents = itor->GetContents(); for(typename Content<_T>::Vector::const_iterator itor = contents.begin(); itor != contents.end(); itor++) { Content<_T> content = *itor; content.coord.z = z; contentVector.push_back( content ); } z++; } return true; }