]> git.mxchange.org Git - simgear.git/blob - simgear/route/routetest.cxx
Display a warning message for Irix users.
[simgear.git] / simgear / route / routetest.cxx
1 #include <simgear/compiler.h>
2 #include <simgear/constants.h>
3
4 #include STL_IOSTREAM
5
6 #include "route.hxx"
7 #include "waypoint.hxx"
8
9 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
10 SG_USING_STD(cout);
11 SG_USING_STD(endl);
12 #endif
13  
14 int main() {
15     SGRoute route;
16
17     route.add_waypoint( SGWayPoint(0, 0, 0, SGWayPoint::CARTESIAN, "Start") );
18     route.add_waypoint( SGWayPoint(1, 0, 0, SGWayPoint::CARTESIAN, "1") );
19     route.add_waypoint( SGWayPoint(2, 0, 0, SGWayPoint::CARTESIAN, "2") );
20     route.add_waypoint( SGWayPoint(2, 2, 0, SGWayPoint::CARTESIAN, "3") );
21     route.add_waypoint( SGWayPoint(4, 2, 0, SGWayPoint::CARTESIAN, "4") );
22    
23     route.set_current( 1 );
24
25     cout << "( 0.5, 0 ) = " << route.distance_off_route( 0.5, 0 ) << endl;
26     cout << "( 0.5, 1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
27     cout << "( 0.5, -1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
28
29     route.set_current( 3 );
30
31     cout << "( 2, 4 ) = " << route.distance_off_route( 2, 4 ) << endl;
32     cout << "( 2.5, 4 ) = " << route.distance_off_route( 2.5, 4 ) << endl;
33
34     return 0;
35 }