本文整理汇总了C++中AbstractNode::addChildBoundable方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractNode::addChildBoundable方法的具体用法?C++ AbstractNode::addChildBoundable怎么用?C++ AbstractNode::addChildBoundable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractNode
的用法示例。
在下文中一共展示了AbstractNode::addChildBoundable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parentBoundables
/*protected*/
std::auto_ptr<BoundableList>
SIRtree::createParentBoundables(BoundableList *childBoundables,int newLevel)
{
assert(!childBoundables->empty());
std::auto_ptr<BoundableList> parentBoundables ( new BoundableList() );
parentBoundables->push_back(createNode(newLevel));
std::auto_ptr<BoundableList> sortedChildBoundables ( sortBoundables(childBoundables) );
//for(unsigned int i=0;i<sortedChildBoundables->size();i++)
for (BoundableList::iterator i=sortedChildBoundables->begin(),
e=sortedChildBoundables->end();
i!=e; ++i)
{
//Boundable *childBoundable=(AbstractNode*)(*sortedChildBoundables)[i];
Boundable *childBoundable=*i;
AbstractNode* lNode = lastNode(parentBoundables.get());
if (lNode->getChildBoundables()->size() == nodeCapacity)
{
parentBoundables->push_back(createNode(newLevel));
}
lNode->addChildBoundable(childBoundable);
}
return parentBoundables;
}
示例2: parentBoundables
/*protected*/
std::auto_ptr<BoundableList>
AbstractSTRtree::createParentBoundables(BoundableList* childBoundables,
int newLevel)
{
assert(!childBoundables->empty());
std::auto_ptr< BoundableList > parentBoundables ( new BoundableList() );
parentBoundables->push_back(createNode(newLevel));
std::auto_ptr< BoundableList > sortedChildBoundables ( sortBoundables(childBoundables) );
for (BoundableList::iterator i=sortedChildBoundables->begin(),
e=sortedChildBoundables->end();
i!=e; i++)
//for(std::size_t i=0, scbsize=sortedChildBoundables->size(); i<scbsize; ++i)
{
Boundable *childBoundable=*i; // (*sortedChildBoundables)[i];
AbstractNode *last = lastNode(parentBoundables.get());
if (last->getChildBoundables()->size() == nodeCapacity)
{
last=createNode(newLevel);
parentBoundables->push_back(last);
}
last->addChildBoundable(childBoundable);
}
return parentBoundables;
}