1 #/*
2 Copyright (C) 2010-2014 Kristian Duske
3
4 This file is part of TrenchBroom.
5
6 TrenchBroom is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 TrenchBroom is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef TrenchBroom_TrenchBroom_h
21 #define TrenchBroom_TrenchBroom_h
22
23 #include "VecMath.h"
24 #include "Polyhedron_DefaultPayload.h"
25
26 typedef double FloatType;
27 typedef BBox<FloatType, 2> BBox2;
28 typedef BBox<FloatType, 3> BBox3;
29 typedef Vec<FloatType, 3> Vec3;
30 typedef Vec<FloatType, 2> Vec2;
31 typedef Plane<FloatType, 3> Plane3;
32 typedef Quat<FloatType> Quat3;
33 typedef Mat<FloatType, 4, 4> Mat4x4;
34 typedef Mat<FloatType, 3, 3> Mat3x3;
35 typedef Mat<FloatType, 2, 2> Mat2x2;
36 typedef Line<FloatType, 3> Line3;
37 typedef Ray<FloatType, 3> Ray3;
38 typedef CoordinatePlane<FloatType, 3> CoordinatePlane3;
39
40 template<typename T, typename FP, typename VB> class Polyhedron;
41 typedef Polyhedron<FloatType, DefaultPolyhedronPayload, DefaultPolyhedronPayload> Polyhedron3;
42
43 namespace TrenchBroom {
44 typedef Edge<FloatType, 3> Edge3;
45 typedef Polygon<FloatType, 3> Polygon3;
46 }
47
48 namespace Math {
49 typedef Constants<FloatType> C;
50 }
51
52 template <typename T>
safeDelete(T * & p)53 void safeDelete(T*& p) {
54 delete p;
55 p = NULL;
56 }
57
58 #endif
59