void * STRAbstractNode::computeBounds() { Envelope* bounds=NULL; vector<Boundable*> *b=getChildBoundables(); size_t bsize=b->size(); if ( bsize ) bounds=new Envelope(*(Envelope*)(*b)[0]->getBounds()); for(size_t i=1; i<bsize; i++) { Boundable* childBoundable=(*b)[i]; bounds->expandToInclude((Envelope*)childBoundable->getBounds()); } return bounds; }
void* computeBounds() const { Interval* bounds=NULL; const BoundableList& b = *getChildBoundables(); for(unsigned int i=0; i<b.size(); ++i) { const Boundable* childBoundable=b[i]; if (bounds==NULL) { bounds=new Interval((Interval*)childBoundable->getBounds()); } else { bounds->expandToInclude((Interval*)childBoundable->getBounds()); } } return bounds; }
void* computeBounds() const override { Interval* p_bounds=nullptr; const BoundableList& b = *getChildBoundables(); for(unsigned int i=0; i<b.size(); ++i) { const Boundable* childBoundable=b[i]; if (p_bounds==nullptr) { p_bounds=new Interval(*((Interval*)childBoundable->getBounds())); } else { p_bounds->expandToInclude((Interval*)childBoundable->getBounds()); } } return p_bounds; }
void* computeBounds() const { Envelope* bounds=NULL; const BoundableList& b = *getChildBoundables(); if ( b.empty() ) return NULL; BoundableList::const_iterator i=b.begin(); BoundableList::const_iterator e=b.end(); bounds=new Envelope(* static_cast<const Envelope*>((*i)->getBounds()) ); for(; i!=e; ++i) { const Boundable* childBoundable=*i; bounds->expandToInclude((Envelope*)childBoundable->getBounds()); } return bounds; }