]> git.mxchange.org Git - simgear.git/blob - simgear/math/sg_types.hxx
Ignore generated binaries.
[simgear.git] / simgear / math / sg_types.hxx
1 /**
2  * \file sg_types.hxx
3  * Commonly used types I don't want to have to keep redefining.
4  */
5
6 // Written by Curtis Olson, started March 1999.
7 //
8 // Copyright (C) 1999  Curtis L. Olson  - http://www.flightgear.org/~curt
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Library General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 // Library General Public License for more details.
19 //
20 // You should have received a copy of the GNU Library General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA  02111-1307, USA.
24 //
25 // $Id$
26
27
28 #ifndef _SG_TYPES_HXX
29 #define _SG_TYPES_HXX
30
31
32 #ifndef __cplusplus                                                          
33 # error This library requires C++
34 #endif                                   
35
36
37 #include <simgear/compiler.h>
38
39 #include STL_STRING
40 #include <vector>
41
42 #include <simgear/math/point3d.hxx>
43
44 SG_USING_STD(vector);
45 SG_USING_STD(string);
46
47 /** STL vector list of ints */
48 typedef vector < int > int_list;
49 typedef int_list::iterator int_list_iterator;
50 typedef int_list::const_iterator const_int_list_iterator;
51
52 /** STL vector list of doubles */
53 typedef vector < double > double_list;
54 typedef double_list::iterator double_list_iterator;
55 typedef double_list::const_iterator const_double_list_iterator;
56
57 /** STL vector list of Point3D */
58 typedef vector < Point3D > point_list;
59 typedef point_list::iterator point_list_iterator;
60 typedef point_list::const_iterator const_point_list_iterator;
61
62 /** STL vector list of strings */
63 typedef vector < string > string_list;
64 typedef string_list::iterator string_list_iterator;
65 typedef string_list::const_iterator const_string_list_iterator;
66
67
68 /**
69  * Simple 2d point class where members can be accessed as x, dist, or lon
70  * and y, theta, or lat
71  */
72 class point2d {
73 public:
74     union {
75         double x;
76         double dist;
77         double lon;
78     };
79     union {
80         double y;
81         double theta;
82         double lat;
83     };
84 };
85
86
87 #endif // _SG_TYPES_HXX
88