1 // Copyright (C) 2008 - 2009 Mathias Froehlich - Mathias.Froehlich@web.de
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # include <simgear_config.h>
22 #include "BVHGroup.hxx"
34 ChildList::iterator i;
35 for (i = _children.begin(); i != _children.end(); ++i) {
36 (*i)->removeParent(this);
42 BVHGroup::accept(BVHVisitor& visitor)
55 BVHGroup::addChild(BVHNode* child)
59 ChildList::iterator i;
60 i = std::find(_children.begin(), _children.end(), child);
61 if (i != _children.end())
64 child->addParent(this);
65 _children.push_back(child);
69 BVHGroup::removeChild(BVHNode* child)
73 ChildList::iterator i;
74 i = std::find(_children.begin(), _children.end(), child);
75 if (i == _children.end())
78 child->removeParent(this);
83 BVHGroup::computeBoundingSphere() const
86 ChildList::const_iterator i;
87 for (i = _children.begin(); i != _children.end(); ++i)
88 sphere.expandBy((*i)->getBoundingSphere());