Debian Codegraph @

include/ivolumetest.h

raw
1 /*
2 Copyright (C) 2001-2006, William Joseph.
3 All Rights Reserved.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #if !defined(INCLUDED_CULLABLE_H)
23 #define INCLUDED_CULLABLE_H
24
25 #include "VolumeIntersectionValue.h"
26
27 template<typename Element> class BasicVector3;
28 typedef BasicVector3<double> Vector3;
29 class Plane3;
30 class Matrix4;
31 class AABB;
32 class Segment;
33
34 class VolumeTest
35 {
36 public:
37 /// \brief destructor
38 virtual ~VolumeTest() {}
39
40 /// \brief Returns true if \p point intersects volume.
41 virtual bool TestPoint(const Vector3& point) const = 0;
42 /// \brief Returns true if \p segment intersects volume.
43 virtual bool TestLine(const Segment& segment) const = 0;
44 /// \brief Returns true if \p plane faces towards volume.
45 virtual bool TestPlane(const Plane3& plane) const = 0;
46 /// \brief Returns true if \p plane transformed by \p localToWorld faces the viewer.
47 virtual bool TestPlane(const Plane3& plane, const Matrix4& localToWorld) const = 0;
48 /// \brief Returns the intersection of \p aabb and volume.
49 virtual VolumeIntersectionValue TestAABB(const AABB& aabb) const = 0;
50 /// \brief Returns the intersection of \p aabb transformed by \p localToWorld and volume.
51 virtual VolumeIntersectionValue TestAABB(const AABB& aabb, const Matrix4& localToWorld) const = 0;
52
53 virtual bool fill() const = 0;
54
55 virtual const Matrix4& GetViewProjection() const = 0;
56 virtual const Matrix4& GetViewport() const = 0;
57 virtual const Matrix4& GetProjection() const = 0;
58 virtual const Matrix4& GetModelview() const = 0;
59 };
60
61 #endif