]> git.mxchange.org Git - simgear.git/blob - simgear/bvh/BVHStaticGeometry.hxx
Fix HTTP unit-test
[simgear.git] / simgear / bvh / BVHStaticGeometry.hxx
1 // Copyright (C) 2008 - 2009  Mathias Froehlich - Mathias.Froehlich@web.de
2 //
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.
7 //
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.
12 //
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.
16 //
17
18 #ifndef BVHStaticGeometry_hxx
19 #define BVHStaticGeometry_hxx
20
21 #include <simgear/math/SGGeometry.hxx>
22 #include <simgear/structure/SGSharedPtr.hxx>
23
24 #include "BVHVisitor.hxx"
25 #include "BVHNode.hxx"
26 #include "BVHStaticData.hxx"
27 #include "BVHStaticNode.hxx"
28
29 namespace simgear {
30
31 class BVHStaticGeometry : public BVHNode {
32 public:
33     BVHStaticGeometry(const BVHStaticNode* staticNode,
34                       const BVHStaticData* staticData);
35     virtual ~BVHStaticGeometry();
36     
37     virtual void accept(BVHVisitor& visitor);
38     
39     void traverse(BVHVisitor& visitor) const
40     { _staticNode->accept(visitor, *_staticData); }
41     
42     const BVHStaticData* getStaticData() const
43     { return _staticData; }
44     const BVHStaticNode* getStaticNode() const
45     { return _staticNode; }
46     
47     virtual SGSphered computeBoundingSphere() const;
48     
49 private:
50     SGSharedPtr<const BVHStaticNode> _staticNode;
51     SGSharedPtr<const BVHStaticData> _staticData;
52 };
53
54 }
55
56 #endif