/******************************************************************************
/                              Copyright
/------------------------------------------------------------------------------
/    Copyright © 2020 SAIC MOTOR Z-ONE SOFTWARE COMPANY.  All rights reserved.
/
/    This software is furnished under a license and may be used and copied
/    only in accordance with the terms of such license and with the inclusion
/    of the above copyright notice. This software or any other copies thereof
/    may not be provided or otherwise made available to any other person.
/    No title to and ownership of the software is hereby transferred.
/
/    The information in this software is subject to change without notice
/    and should not be constructed as a commitment by
/    SAIC MOTOR Z-ONE SOFTWARE COMPANY.
/
/    SAIC MOTOR Z-ONE SOFTWARE COMPANY assumes no responsibility for the use
/    or reliability of its Software on equipment which is not supported by
/    SAIC MOTOR Z-ONE SOFTWARE COMPANY.

/    Date: 2021-3-21
/    Author: zhang fang
/------------------------------------------------------------------------------
*******************************************************************************/
#ifndef _HD_MAP_COMMON_DEFINE_H_
#define _HD_MAP_COMMON_DEFINE_H_

////////////////////////////////////////////////////////////////////////////////
// @file : hd_map_common_define.h
// @brief : Define struct of hd map project
////////////////////////////////////////////////////////////////////////////////

// C & C++ library
#include <string>
#include <vector>

// other library
#include "basic_type.h"
#include "jf_shared_data.h"

// project library

namespace jf {
namespace hd_map_common {
///////////////////////////////////////////////////////////////////////
// enum define
enum class LinkType : uint8_t {
    HDM_LINK_TYPE_NO_SPECIAL = 0,     // normal link
    HDM_LINK_TYPE_RAMP = 1,           // ramp connect highway
    HDM_LINK_TYPE_ENTRANCE_RAMP = 2,  // Entrance Ramp
    HDM_LINK_TYPE_EXIT_RAMP = 3,      // Exit Ramp
    HDM_LINK_TYPE_JCT = 4,            // JCT(Motorway Junction)
    HDM_LINK_TYPE_TOLL_BOOTH = 5,     // toll booth on the road
    HDM_LINK_TYPE_BROKEN_HEAD = 6,    // broken head road
};

enum class LinkTransitionType : uint8_t {
    HDM_LINK_TRANSITION_TYPE_NO_TRANSITION_ZONE = UINT8_MAX,  // No transition zone
    HDM_LINK_TRANSITION_TYPE_EXIT_OR_ENTRANCE = 1,            // Lane(s) opening/closing on one side- i.e. Exit, Entrance
    HDM_LINK_TRANSITION_TYPE_SPLIT_OR_MERGE = 2,              // Lane(s) opening/closing in the middle– i.e. road split, road merge
    HDM_LINK_TRANSITION_TYPE_TOLL_BOOTH = 3,                  // Only for Toll Booth area. Toll booth entrance and toll booth exit are both transition road.
                                                              // For this section of road, Lane number or Lane Width is not applicable
    HDM_LINK_TRANSITION_TYPE_CHANGE_SIMULTANEOUSLY = 4,       // Road width widening or narrowing or no change, but all lanes change simultaneously.
};

enum class LinkClass : uint8_t {
    HDM_LINK_CLASS_EXPRESSWAY = 0,        // highway
    HDM_LINK_CLASS_URBAN_EXPRESSWAY = 1,  // urban expressway
    HDM_LINK_CLASS_NORMAL_LINK = 2        // normal link
};

enum class LaneType : uint8_t {
    HDM_LANE_TYPE_REGULAR_LANE = 0,                // Regular Lane
    HDM_LANE_TYPE_ACCELERATION_LANE = 1,           // Acceleration Lane
    HDM_LANE_TYPE_DECELERATION_LANE = 2,           // Deceleration Lane
    HDM_LANE_TYPE_COMPOUND_LANE = 3,               // Compound lane
    HDM_LANE_TYPE_HOV_LANE = 4,                    // HOV Lane
    HDM_LANE_TYPE_SLOW_LANE = 5,                   // Slow lane
    HDM_LANE_TYPE_PASSING_OR_OVERTAKING_LANE = 6,  // Passing/Overtaking lane
    HDM_LANE_TYPE_HARD_SHOULDER_LANE = 7,          // Hard shoulder lane
    HDM_LANE_TYPE_TRUCK_PARKING_LANE = 8,          // Truck parking lane
    HDM_LANE_TYPE_REGULATED_ACCESS_LANE = 9,       // Regulated access lane
    HDM_LANE_TYPE_SOFT_SHOULDER_LANE = 10,         // Soft shoulder lane
    HDM_LANE_TYPE_ENERGENCY_PARKING_LANE = 11,     // Emergency parking strip
    HDM_LANE_TYPE_BUS_LANE = 12,                   // Bus lane
    HDM_LANE_TYPE_BICYCLE_LANE = 13,               // Bicycle lane
    HDM_LANE_TYPE_TURN_LANE = 14,                  // Turn Lane
    HDM_LANE_TYPE_REVESIBLE_LANE = 15,             // Reversible lane
    HDM_LANE_TYPE_CENTRE_TURN_LANE = 16,           // Centre turn lane
    HDM_LANE_TYPE_TRUCK_ESCAPE_LANE = 17,          // Truck escape ramp
    HDM_LANE_TYPE_ENTRY_LANE = 18,                 // Entry lane
    HDM_LANE_TYPE_EXIT_LANE = 19,                  // Exit lane
    HDM_LANE_TYPE_ON_RAMP_LANE = 20,               // On ramp lane
    HDM_LANE_TYPE_OFF_RAMP_LANE = 21,              // Off ramp lane
    HDM_LANE_TYPE_CONNECT_RAMP_LANE = 22,          // Connect ramp lane
    HDM_LANE_TYPE_IN_BULIT_LANE = 23,              // In bulit lane
    HDM_LANE_TYPE_DIVERSION_LANE = 24,             // diversion lane

};

enum class LaneArrowType : uint8_t {
    HDM_LANE_ARROW_TYPE_NONE = UINT8_MAX,       // none
    HDM_LANE_ARROW_TYPE_FORWARD = 1,            // Forward
    HDM_LANE_ARROW_TYPE_RIGHT = 2,              // Right
    HDM_LANE_ARROW_TYPE_RIGHT_AND_FORWARD = 3,  // Right and forward
    HDM_LANE_ARROW_TYPE_LEFT = 4,               // Left
    HDM_LANE_ARROW_TYPE_LEFT_AND_FORWARD = 5,   // Left and forward

};

enum class LaneMarkingType : uint8_t {
    HDM_LANE_MARKING_TYPE_NONE = UINT8_MAX,             // None
    HDM_LANE_MARKING_TYPE_NOT_INVESTIGATED = 1,         // Not investigated
    HDM_LANE_MARKING_TYPE_SINGLE_DASHED = 2,            // Single Dashed
    HDM_LANE_MARKING_TYPE_SHORT_THICK_DASHED = 3,       // Short Thick Dashed
    HDM_LANE_MARKING_TYPE_DOUBLE_DASHED = 4,            // Double Dashed
    HDM_LANE_MARKING_TYPE_SINGLE_SOLID = 5,             // Single Solid
    HDM_LANE_MARKING_TYPE_SINGLE_THICK_SOLID = 6,       // Single thick Solid
    HDM_LANE_MARKING_TYPE_DOUBLE_SOLID = 7,             // Double Solid
    HDM_LANE_MARKING_TYPE_RIGHT_SOLID_LEFT_DASHED = 8,  // Left Dashed/Right Solid
    HDM_LANE_MARKING_TYPE_LEFT_SOLID_RIGHT_DASHED = 9,  // Left Solid/Right Dashed
    HDM_LANE_MARKING_TYPE_LEFT_TURN_VARIABLE = 10,      // Turn variable lane marking
    HDM_LANE_MARKING_TYPE_VIRTUAL = 11,                 // Virtual Marking
    // @todo, Verify where the navinfo data is stored
    HDM_LANE_MARKING_TYPE_CURB = 12,                 // Curb
    HDM_LANE_MARKING_TYPE_GUARDRAIL = 13,            // Guardrail
    HDM_LANE_MARKING_TYPE_MIXED_SINGLE_SOLID = 14,   // Mixed Single Solid
    HDM_LANE_MARKING_TYPE_MIXED_DOUBLE_SOLID = 15,   // Mixed Double Solid
    HDM_LANE_MARKING_TYPE_MIXED_SINGLE_DASHED = 16,  // Mixed Single Dashed
    HDM_LANE_MARKING_TYPE_MIXED_DOUBLE_DASHED = 17,  // Mixed Double Dashed
};

enum class LaneMarkingColor : uint8_t {
    HDM_LANE_MARKING_COLOR_WHITE = 0,                    // White
    HDM_LANE_MARKING_COLOR_YELLOW = 1,                   // Yellow
    HDM_LANE_MARKING_COLOR_BLUE = 2,                     // blue
    HDM_LANE_MARKING_COLOR_ORANGE = 3,                   // orange
    HDM_LANE_MARKING_COLOR_LEFT_YELLOW_RIGHE_WHITE = 4,  // Left yellow/right white
    HDM_LANE_MARKING_COLOR_LEFT_WHITE_RIGHT_YELLOW = 5,  // Left white/right yellow
    HDM_LANE_MARKING_COLOR_OTHERS = 6,                   // Others
    HDM_LANE_MARKING_COLOR_UNKNOWN_NOW = 7,              // not know now
    HDM_LANE_MARKING_COLOR_RAD = 8,                      // rad
    HDM_LANE_MARKING_COLOR_BLUE_GREEN = 9,               // blue green
    HDM_LANE_MARKING_COLOR_GREEN = 10,                   // green
};

enum class LaneMarkingMaterial : uint8_t {
    HDM_LANE_MARKING_MATREIAL_UNKNOWN = UINT8_MAX,                 // not know now
    HDM_LANE_MARKING_MATREIAL_METAL = 1,                           // Metal
    HDM_LANE_MARKING_MATREIAL_CONCRETE = 2,                        // Consrete
    HDM_LANE_MARKING_MATREIAL_STONE = 3,                           // Stone
    HDM_LANE_MARKING_MATREIAL_WOOD = 4,                            // Wood
    HDM_LANE_MARKING_MATREIAL_PLASTIC = 5,                         // Plastic
    HDM_LANE_MARKING_MATREIAL_TRANSPARENT = 6,                     // Transparent
    HDM_LANE_MARKING_MATREIAL_PAINTED = 7,                         // Painted
    HDM_LANE_MARKING_MATREIAL_RAISED_PAVEMENT_MARKER = 8,          // Raised pavement marker / vibration markings
    HDM_LANE_MARKING_MATREIAL_PAINTED_RAISED_PAVEMENT_MARKER = 9,  // Painted Raised pavement marker / Painted vibration markings

};

enum class RhombusDecelerationMarking : uint8_t {
    HDM_RHOMBUS_DECELERATION_MARKING_NOT_APPLICABLE = 0,  // means Not applicable, means that this lane marking has no rhombus deceleration marking
    HDM_RHOMBUS_DECELERATION_MARKING_ON_RIGHE_SIDE = 1,   // This lane marking has rhombus deceleration marking on right side along the driving direction
    HDM_RHOMBUS_DECELERATION_MARKING_ON_LEFT_SIDE = 2,    // This lane marking has rhombus deceleration marking on left side along the driving direction
    HDM_RHOMBUS_DECELERATION_MARKING_ON_BOTH_SIDE = 3,    // This lane marking has rhombus deceleration marking on both sides along the driving direction
};

enum class GuidancePointType : uint8_t {
    HDM_GUIDANCE_POINT_TYPE_NONE = UINT8_MAX,               // None
    HDM_GUIDANCE_POINT_TYPE_ENTRY_JCT = 1,                  // link level entry jct
    HDM_GUIDANCE_POINT_TYPE_EXIT_JCT = 2,                   // link level exit jct
    HDM_GUIDANCE_POINT_TYPE_ENTRY_RAMP = 3,                 // link level entry ramp
    HDM_GUIDANCE_POINT_TYPE_EXIT_RAMP = 4,                  // link level exit ramp
    HDM_GUIDANCE_POINT_TYPE_ENTRY_MAIN_ROAD = 5,            // road entry into the main road
    HDM_GUIDANCE_POINT_TYPE_EXIT_MAIN_ROAD = 6,             // exit the main road to other road
    HDM_GUIDANCE_POINT_TYPE_RAMP_IMPORT = 7,                // link level crossroads
    HDM_GUIDANCE_POINT_TYPE_ENTRY_CURVE = 8,                // link level entry curve
                                                            // Along the road traffic direction,
                                                            // take the average value of road curvature radius within 0-50m ahead.
                                                            // When the value is less than 650m, it is defined as a curve
    HDM_GUIDANCE_POINT_TYPE_EXIT_CURVE = 9,                 // link level out curve
    HDM_GUIDANCE_POINT_TYPE_LANE_MERGE = 10,                // one lane merge into other lane
    HDM_GUIDANCE_POINT_TYPE_LANE_SPLIT = 11,                // new lane forming
    HDM_GUIDANCE_POINT_TYPE_CONSTRUCT_ENTRANCE = 12,        // construct entrance
    HDM_GUIDANCE_POINT_TYPE_CONSTRUCT_EXPORT = 13,          // construct export
    HDM_GUIDANCE_POINT_TYPE_TUNNEL_ENTRANCE = 14,           // tunnel entrance
    HDM_GUIDANCE_POINT_TYPE_END_POINT = 15,                 // end point
    HDM_GUIDANCE_POINT_TYPE_OVERPASS = 16,                  // overpass
    HDM_GUIDANCE_POINT_TYPE_ACCELERATION_LANE = 17,         // lane level acceleration lane
    HDM_GUIDANCE_POINT_TYPE_DECELERATION_LANE = 18,         // lane level deceleation lane
    HDM_GUIDANCE_POINT_TYPE_DISTANCE_ALONE_ROAD_TIPS = 19,  // driving distance along the road
    HDM_GUIDANCE_POINT_TYPE_LEFT_NARROWED = 20,             // left narrowed
    HDM_GUIDANCE_POINT_TYPE_RIGHT_NARROWED = 21,            // right narrowed
    HDM_GUIDANCE_POINT_TYPE_BOTH_SIDE_NARROWED = 22,        // both side narrowed
    HDM_GUIDANCE_POINT_TYPE_NARROWED_BRIDGE = 23,           // narrowed bridge
    HDM_GUIDANCE_POINT_TYPE_COMPLEX_INTERSECTION = 24,      // complex intersection
    HDM_GUIDANCE_POINT_TYPE_NO_GUIDE_LINE = 25,             // no guide line
    HDM_GUIDANCE_POINT_TYPE_TUNNEL_EXPORT = 26,             // tunnel export
    HDM_GUIDANCE_POINT_TYPE_TOOL_STATION = 27,              // link toll station
    HDM_GUIDANCE_POINT_TYPE_SERVICE_AREA = 28,              // service area
    HDM_GUIDANCE_POINT_TYPE_ALLOW_OVERTAKING = 29,          // allow overtaking
    HDM_GUIDANCE_POINT_TYPE_WAY_POINT = 30,                 // Passing through point

};

enum class ObjectType : uint8_t {
    HDM_OBJECT_TYPE_NONE = UINT8_MAX,   //
    HDM_OBJECT_TYPE_POLE = 1,           // pole
    HDM_OBJECT_TYPE_ROADMARK = 2,       // road mark
    HDM_OBJECT_TYPE_SIGN = 3,           // sign
    HDM_OBJECT_TYPE_TRAFFIC_LIGHT = 4,  // traffic light
};

enum class ObjectSubType : uint8_t {
    HDM_OBJECT_SUBTYPE_NONE = UINT8_MAX,                       //
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW = 1,                     // when object type = 2 is vaild, arrow
    HDM_OBJECT_SUBTYPE_ROADMARK_STOP_LINE = 2,                 // when object tyoe = 2 is vaild, stop line
    HDM_OBJECT_SUBTYPE_ROADMARK_ZEBRA = 3,                     // when object tyoe = 2 is vaild, zebra
    HDM_OBJECT_SUBTYPE_ROADMARK_SPEED_LIMIT = 4,               // when object tyoe = 2,3 is vaild,
                                                               // group speed limit or speed limit sign
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW_STRAIGHT = 5,            // when object type = 2 is vaild, arrow
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW_LEFT = 6,                // when object type = 2 is vaild, arrow
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW_RIGHT = 7,               // when object type = 2 is vaild, arrow
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW_STRAIGHT_AND_LEFT = 8,   // when object type = 2 is vaild, arrow
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW_STRAIGHT_AND_RIGHT = 9,  // when object type = 2 is vaild, arrow
    HDM_OBJECT_SUBTYPE_ROADMARK_ARROW_LEFT_AND_RIGHT = 10,     // when object type = 2 is vaild, arrow

};

enum class Direction : uint8_t {
    HDM_POSITIVE_DIRECTION = 0,         // The passing direction is consistent with the arrangement direction of the shape points...
    HDM_NEGATIVE_DIRECTION = 1,         // The passage direction is opposite to the arrangement direction of the shape points
    HDM_BOTH_DIRECTIONS = 2,            // Passable in both directions
    HDM_UNKOWN_DIRECTIONS = UINT8_MAX,  //
};

enum class SpeedLimit : uint8_t {
    HDM_MIN_SPEED_LIMIT = 0,  // unit:m/s
    HDM_MAX_SPEED_LIMIT = 1,
};

enum class LocalizationStatus : uint8_t {
    HDM_LOCALIZATION_STATUS_ALL_GOOD = 0,         // All sensors are operating normally
    HDM_LOCALIZATION_STATUS_GNSS_LOST = 1,        // gps signal kZoneReturnErr(Single signal)
    HDM_LOCALIZATION_STATUS_PERCEPTION_LOST = 2,  // Single signal kZoneReturnErr(Single signal)
    HDM_LOCALIZATION_STATUS_ELSE = 3,             // ELSE...e.g.double kZoneReturnErr
};

enum class LanePosition : uint8_t {
    HDM_LANE_POSITION_LEFT = 0,
    HDM_LANE_POSITION_MIDDLE = 1,
    HDM_LANE_POSITION_RIGHT = 2,
};

enum class LaneMarkingPosition : uint8_t {
    HDM_LANEMARKING_POSITION_LEFT = 0,
    HDM_LANEMARKING_POSITION_RIGHT = 1,
};

enum class LaneBorderSelection : uint8_t {
    HDM_LANE_BORDER_SELECTION_RIGHT = 0,
    HDM_LANE_BORDER_SELECTION_LEFT = 1,
    HDM_LANE_BORDER_SELECTION_BOTH = 2,
};

/////////////////////////////////////////////////////////////////////////
// class define

}  // namespace hd_map_common

}  // namespace jf

#endif
