Пример #1
0
 ContentAccumulator<_T>& operator += ( const Content<_T> & content ) {
  
   contentVector.push_back( content );
  
   
   return *this;
 }
Пример #2
0
 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;
 }
Пример #3
0
  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;
  }
Пример #4
0
        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;
        }