Added new TurnInstruction that indicates when to go against oneway
streets. It's important for cycling.
This commit is contained in:
		
							parent
							
								
									7f311551dd
								
							
						
					
					
						commit
						fc24dbf9b7
					
				@ -21,12 +21,12 @@
 | 
			
		||||
#ifndef TURNINSTRUCTIONS_H_
 | 
			
		||||
#define TURNINSTRUCTIONS_H_
 | 
			
		||||
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <boost/noncopyable.hpp>
 | 
			
		||||
 | 
			
		||||
typedef unsigned char TurnInstruction;
 | 
			
		||||
 | 
			
		||||
//This is a hack until c++0x is available enough to use scoped enums
 | 
			
		||||
struct TurnInstructionsClass {
 | 
			
		||||
struct TurnInstructionsClass : boost::noncopyable {
 | 
			
		||||
 | 
			
		||||
    const static TurnInstruction NoTurn = 0;          //Give no instruction at all
 | 
			
		||||
    const static TurnInstruction GoStraight = 1;      //Tell user to go straight!
 | 
			
		||||
@ -44,48 +44,13 @@ struct TurnInstructionsClass {
 | 
			
		||||
    const static TurnInstruction StayOnRoundAbout = 13;
 | 
			
		||||
    const static TurnInstruction StartAtEndOfStreet = 14;
 | 
			
		||||
    const static TurnInstruction ReachedYourDestination = 15;
 | 
			
		||||
    const static TurnInstruction GoAgainstAllowedDirection = 32;
 | 
			
		||||
 | 
			
		||||
    const static TurnInstruction AccessRestrictionFlag = 128;
 | 
			
		||||
    const static TurnInstruction InverseAccessRestrictionFlag = 0x7f; // ~128 does not work without a warning.
 | 
			
		||||
 | 
			
		||||
    const static int AccessRestrictionPenalty = 1 << 15; //unrelated to the bit set in the restriction flag
 | 
			
		||||
 | 
			
		||||
//    std::string TurnStrings[16];
 | 
			
		||||
//    std::string Ordinals[12];
 | 
			
		||||
 | 
			
		||||
    //This is a hack until c++0x is available enough to use initializer lists.
 | 
			
		||||
//    TurnInstructionsClass(){
 | 
			
		||||
//        TurnStrings [0] = "";
 | 
			
		||||
//        TurnStrings [1] = "Continue";
 | 
			
		||||
//        TurnStrings [2] = "Turn slight right";
 | 
			
		||||
//        TurnStrings [3] = "Turn right";
 | 
			
		||||
//        TurnStrings [4] = "Turn sharp right";
 | 
			
		||||
//        TurnStrings [5] = "U-Turn";
 | 
			
		||||
//        TurnStrings [6] = "Turn sharp left";
 | 
			
		||||
//        TurnStrings [7] = "Turn left";
 | 
			
		||||
//        TurnStrings [8] = "Turn slight left";
 | 
			
		||||
//        TurnStrings [9] = "Reach via point";
 | 
			
		||||
//        TurnStrings[10] = "Head";
 | 
			
		||||
//        TurnStrings[11] = "Enter roundabout";
 | 
			
		||||
//        TurnStrings[12] = "Leave roundabout";
 | 
			
		||||
//        TurnStrings[13] = "Stay on roundabout";
 | 
			
		||||
//        TurnStrings[14] = "Start";
 | 
			
		||||
//        TurnStrings[15] = "You have reached your destination";
 | 
			
		||||
//
 | 
			
		||||
//        Ordinals[0]     = "zeroth";
 | 
			
		||||
//        Ordinals[1]     = "first";
 | 
			
		||||
//        Ordinals[2]     = "second";
 | 
			
		||||
//        Ordinals[3]     = "third";
 | 
			
		||||
//        Ordinals[4]     = "fourth";
 | 
			
		||||
//        Ordinals[5]     = "fifth";
 | 
			
		||||
//        Ordinals[6]     = "sixth";
 | 
			
		||||
//        Ordinals[7]     = "seventh";
 | 
			
		||||
//        Ordinals[8]     = "eighth";
 | 
			
		||||
//        Ordinals[9]     = "nineth";
 | 
			
		||||
//        Ordinals[10]    = "tenth";
 | 
			
		||||
//        Ordinals[11]    = "one of the too many";
 | 
			
		||||
//    };
 | 
			
		||||
 | 
			
		||||
    static inline TurnInstruction GetTurnDirectionOfInstruction( const double angle ) {
 | 
			
		||||
        if(angle >= 23 && angle < 67) {
 | 
			
		||||
            return TurnSharpRight;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user