head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.39; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.56; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.03; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.59; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# routetest.cxx

    00001 #include <simgear/compiler.h>
    00002 #include <simgear/constants.h>
    00003
    00004 #include STL_IOSTREAM
    00005
    00006 #include "route.hxx"
    00007 #include "waypoint.hxx"
    00008
    00009 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
    00010 SG_USING_STD(cout);
    00011 SG_USING_STD(endl);
    00012 #endif
    00013
    00014 int main() {
    00015     SGRoute route;
    00016
    00017     route.add_waypoint( SGWayPoint(0, 0, 0, SGWayPoint::CARTESIAN, "Start") );
    00018     route.add_waypoint( SGWayPoint(1, 0, 0, SGWayPoint::CARTESIAN, "1") );
    00019     route.add_waypoint( SGWayPoint(2, 0, 0, SGWayPoint::CARTESIAN, "2") );
    00020     route.add_waypoint( SGWayPoint(2, 2, 0, SGWayPoint::CARTESIAN, "3") );
    00021     route.add_waypoint( SGWayPoint(4, 2, 0, SGWayPoint::CARTESIAN, "4") );
    00022
    00023     route.set_current( 1 );
    00024
    00025     cout << "( 0.5, 0 ) = " << route.distance_off_route( 0.5, 0 ) << endl;
    00026     cout << "( 0.5, 1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
    00027     cout << "( 0.5, -1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
    00028
    00029     route.set_current( 3 );
    00030
    00031     cout << "( 2, 4 ) = " << route.distance_off_route( 2, 4 ) << endl;
    00032     cout << "( 2.5, 4 ) = " << route.distance_off_route( 2.5, 4 ) << endl;
    00033
    00034     return 0;
    00035 }

@ 1.3 log @Oops, try again. @ text @d44 1 a44 1