コード例 #1
0
ファイル: STRtree.cpp プロジェクト: kanbang/Colt
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;
}
コード例 #2
0
ファイル: SIRtree.cpp プロジェクト: BlueEyes-Lin/sunmap
	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;
	}
コード例 #3
0
ファイル: SIRtree.cpp プロジェクト: mwtoews/libgeos
	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;
	}
コード例 #4
0
ファイル: STRtree.cpp プロジェクト: lozpeng/applesales
	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;
	}