本文整理汇总了C++中QuadTree::getBoundary方法的典型用法代码示例。如果您正苦于以下问题:C++ QuadTree::getBoundary方法的具体用法?C++ QuadTree::getBoundary怎么用?C++ QuadTree::getBoundary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuadTree
的用法示例。
在下文中一共展示了QuadTree::getBoundary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vertices
vector<Vector2> GDIQuadTree::getVertices(const QuadTree& quadTree) const
{
if (quadTree.getChildren().empty())
{
vector<Vector2> vertices(5, Vector2());
vertices.at(0).X() = quadTree.getBoundary().center.X() - quadTree.getBoundary().halfDimension;
vertices.at(0).Y() = quadTree.getBoundary().center.Y() + quadTree.getBoundary().halfDimension;
vertices.at(1).X() = quadTree.getBoundary().center.X() + quadTree.getBoundary().halfDimension;
vertices.at(1).Y() = quadTree.getBoundary().center.Y() + quadTree.getBoundary().halfDimension;
vertices.at(2).X() = quadTree.getBoundary().center.X() + quadTree.getBoundary().halfDimension;
vertices.at(2).Y() = quadTree.getBoundary().center.Y() - quadTree.getBoundary().halfDimension;
vertices.at(3).X() = quadTree.getBoundary().center.X() - quadTree.getBoundary().halfDimension;
vertices.at(3).Y() = quadTree.getBoundary().center.Y() - quadTree.getBoundary().halfDimension;
vertices.at(4).X() = quadTree.getBoundary().center.X() - quadTree.getBoundary().halfDimension;
vertices.at(4).Y() = quadTree.getBoundary().center.Y() + quadTree.getBoundary().halfDimension;
return vertices;
}
vector<Vector2> vertices;
for (unsigned int index = 0; index < quadTree.getChildren().size(); index++)
{
vector<Vector2> childVertices = getVertices(*quadTree.getChildren().at(index));
vertices.insert(vertices.end(), childVertices.begin(), childVertices.end());
}
return vertices;
}