Ejemplo n.º 1
0
int
ShapeList::maxDepth() const
{
    int res = std::numeric_limits<int>::min();
    int d;
    ShapeList * sl;
    std::vector< Shape* >::const_iterator i = _shapes.begin();
    std::vector< Shape* >::const_iterator end = _shapes.end();
    while ( i != end ) {
        sl = dynamic_cast<ShapeList*>( *i );
        if ( sl ) {
            d = sl->maxDepth();
        } else {
            d = (*i)->depth();
        }
        if ( d > res ) res = d;
        ++i;
    }
    return res;
}
Ejemplo n.º 2
0
void
TransformFIG::setDepthRange( const ShapeList & shapes )
{
  _maxDepth = shapes.maxDepth();
  _minDepth = shapes.minDepth();
}