Commit 67cb1b4e authored by oscar's avatar oscar

提交arm的sdk库

parent e1196aa9
#pragma once
#include"cstring"
#include"string"
#include"unordered_map"
using namespace std;
namespace OpenDrive
{
class Connection
{
public:
Connection();
Connection& operator= (const Connection &conn);
Connection(const Connection &conn);
void SetID(const char* id);
const char* GetID() const;
void SetIncomingRoad(const char* incomingRoad);
const char* GetIncomingRoad() const;
void SetConnectingRoad(const char* incomingRoad);
const char* GetConnectingRoad() const;
void SetContactPoint(const char* contactPoint);
const char* GetContactPoint() const;
void SetLaneLinkFromTo(const char* laneLinkFrom, const char* laneLinkTo);
string GetLaneLinkFrom(const char* laneLinkTo) const;
string GetLaneLinkTo(const char* laneLinkFrom) const;
bool IsLinkTo(const char* laneLinkFrom) const;
~Connection();
private:
string _id;
string _incomingRoad;
string _connectingRoad;
string _contactPoint;
unordered_map<string, string> *_laneLinkFromTo;
};
}
#pragma once
#include "vector"
#include"cstring"
#include"string"
#include"glm/glm.hpp"
using namespace std;
namespace OpenDrive
{
enum EnOpcode
{
ODR_OPCODE_NONE = 0,
ODR_OPCODE_HEADER,
ODR_OPCODE_ROAD_HEADER,
ODR_OPCODE_ROAD_LINK,
ODR_OPCODE_ROAD_TYPE,
ODR_OPCODE_GEO_HEADER,
ODR_OPCODE_GEO_LINE,
ODR_OPCODE_GEO_SPIRAL,
ODR_OPCODE_GEO_ARC,
ODR_OPCODE_Elevation,
ODR_OPCODE_LANE_SECTION, // 10
ODR_OPCODE_LANE,
ODR_OPCODE_LANE_LINK,
ODR_OPCODE_LANE_WIDTH,
ODR_OPCODE_LANE_MATERIAL,
ODR_OPCODE_LANE_VISIBILITY,
ODR_OPCODE_SIGNAL,
ODR_OPCODE_LANE_VALIDITY,
ODR_OPCODE_SIGNAL_DEPEND,
ODR_OPCODE_CONTROLLER,
ODR_OPCODE_CONTROL_ENTRY, // 20
ODR_OPCODE_JUNCTION_HEADER,
ODR_OPCODE_JUNCTION_LINK,
ODR_OPCODE_JUNCTION_PRIORITY,
ODR_OPCODE_OBJECT,
ODR_OPCODE_USER_DATA,
ODR_OPCODE_JUNCTION_LANE_LINK,
ODR_OPCODE_CROSSFALL,
ODR_OPCODE_JUNCTION_CONTROL,
ODR_OPCODE_LANE_ROAD_MARK,
ODR_OPCODE_PREDECESSOR, // 30
ODR_OPCODE_SUCCESSOR,
ODR_OPCODE_LANES,
ODR_OPCODE_LANES_LEFT,
ODR_OPCODE_LANES_CENTER,
ODR_OPCODE_LANES_RIGHT,
ODR_OPCODE_PLANVIEW,
ODR_OPCODE_ELEV_PROFILE,
ODR_OPCODE_LATERAL_PROFILE,
ODR_OPCODE_OBJECTS,
ODR_OPCODE_SIGNALS, // 40
ODR_OPCODE_OPENDRIVE,
ODR_OPCODE_SUPERElevation,
ODR_OPCODE_GEO_POLY,
ODR_OPCODE_LANE_SPEED,
ODR_OPCODE_LANE_ACCESS,
ODR_OPCODE_LANE_HEIGHT,
ODR_OPCODE_CORNER_INERTIAL,
ODR_OPCODE_CORNER_ROAD,
ODR_OPCODE_CORNER_RELATIVE,
ODR_OPCODE_TUNNEL, // 50
ODR_OPCODE_BRIDGE,
ODR_OPCODE_SIGNAL_REFERENCE,
ODR_OPCODE_OBJECT_OUTLINE,
ODR_OPCODE_SURFACE,
ODR_OPCODE_SURFACE_CRG,
ODR_OPCODE_LANE_OFFSET,
ODR_OPCODE_GENERIC_NODE,
ODR_OPCODE_CORNER_LOCAL,
ODR_OPCODE_REPEAT,
ODR_OPCODE_GEO_PARAM_POLY, // 60
ODR_OPCODE_LANE_BORDER,
ODR_OPCODE_ROAD_SPEED,
ODR_OPCODE_GEO_REFERENCE,
ODR_OPCODE_LATERAL_SHAPE,
ODR_OPCODE_JUNCTION_GROUP,
ODR_OPCODE_JUNCTION_REFERENCE,
ODR_OPCODE_ROAD_MARK_TYPE,
ODR_OPCODE_ROAD_MARK_LINE,
ODR_OPCODE_PARKING_SPACE,
ODR_OPCODE_PARKING_SPACE_MARKING,
ODR_OPCODE_NEIGHBOR,
ODR_OPCODE_TRAFFIC_OBJECT = 2000,
ODR_OPCODE_RAILROAD_SWITCH
};
// GEOMETRY TYPE
enum EnGeometryType {
ODR_GEO_TYPE_LINE = 0,
ODR_GEO_TYPE_SPIRAL,
ODR_GEO_TYPE_ARC,
ODR_GEO_TYPE_POLY3
};
// ROAD MARK
enum EnRoadMark {
ODR_ROAD_MARK_NONE = 0,
ODR_ROAD_MARK_SOLID,
ODR_ROAD_MARK_SOLID_BOLD,
ODR_ROAD_MARK_BROKEN,
ODR_ROAD_MARK_SOLID_DOUBLE,
ODR_ROAD_MARK_BROKEN_BOLD,
ODR_ROAD_MARK_SOLID_YELLOW,
ODR_ROAD_MARK_SOLID_DOUBLE_YELLOW
};
enum EnRoadMarkType {
ODR_ROAD_MARK_TYPE_NONE = 0,
ODR_ROAD_MARK_TYPE_SOLID,
ODR_ROAD_MARK_TYPE_BROKEN,
ODR_ROAD_MARK_TYPE_SOLID_SOLID,
ODR_ROAD_MARK_TYPE_SOLID_BROKEN,
ODR_ROAD_MARK_TYPE_BROKEN_SOLID,
ODR_ROAD_MARK_TYPE_CURB
};
enum EnRoadMarkWeight {
ODR_ROAD_MARK_WEIGHT_NONE = 0,
ODR_ROAD_MARK_WEIGHT_STANDARD,
ODR_ROAD_MARK_WEIGHT_BOLD
};
enum EnRoadMarkColor {
ODR_ROAD_MARK_COLOR_NONE = 0,
ODR_ROAD_MARK_COLOR_STANDARD,
ODR_ROAD_MARK_COLOR_YELLOW,
ODR_ROAD_MARK_COLOR_RED,
ODR_ROAD_MARK_COLOR_WHITE
};
// LANE TYPE
enum EnLaneType {
ODR_LANE_TYPE_NONE = 0,
ODR_LANE_TYPE_DRIVING,
ODR_LANE_TYPE_STOP,
ODR_LANE_TYPE_SHOULDER,
ODR_LANE_TYPE_BIKING,
ODR_LANE_TYPE_SIDEWALK,
ODR_LANE_TYPE_BORDER,
ODR_LANE_TYPE_RESTRICTED,
ODR_LANE_TYPE_PARKING,
ODR_LANE_TYPE_MWY_ENTRY,
ODR_LANE_TYPE_MWY_EXIT,
ODR_LANE_TYPE_SPECIAL1,
ODR_LANE_TYPE_SPECIAL2,
ODR_LANE_TYPE_SPECIAL3,
ODR_LANE_TYPE_SPECIAL4,
ODR_LANE_TYPE_DRIVING_ROADWORKS,
ODR_LANE_TYPE_TRAM,
ODR_LANE_TYPE_RAIL
};
struct OdrInfo
{
char* _roadID = NULL;
char* _sectionID = NULL;
char* _laneID = NULL;
double _s = -1.0;
double _t = -1.0;
double _curvature = 0.0;
};
struct Position
{
double _s = 0.0;
double _x = 0.0;
double _y = 0.0;
double _direction = 0.0;
double _Elevation = 0.0;
double _crossfall = 0.0;
};
struct RoadWidth
{
double _s = 0.0;
double _roadWith = 0.0;
};
struct TurningAttr
{
double _s = 0.0;
double _turnRad = 0.0;
};
struct NearestDistance
{
double _leftLaneDistance = 0.0;
double _rightLaneDistance = 0.0;
double _leftRoadDistance = 0.0;
double _rightRoadDistance = 0.0;
};
//roadMark
struct LaneMark
{
EnRoadMarkColor _color;
EnRoadMarkType _type;
EnRoadMarkWeight _weight;
double _sOffset;
};
struct NearestRoadMark
{
LaneMark *_leftRoadMark = NULL;
LaneMark *_rightRoadMark = NULL;
};
struct LanePostion
{
double _s = 0.0;
double _x = 0.0;
double _y = 0.0;
};
struct PosXY
{
double _x = 0.0;
double _y = 0.0;
double _z = 0.0;
};
struct RoadProperty
{
bool _bRight = true;
vector<int> _vecLaneID;
EnLaneType _laneType = ODR_LANE_TYPE_NONE;
};
struct GeoCoordinatePoint
{
double _s = 0.0;
double _x = 0.0;
double _y = 0.0;
double _z = 0.0;
double _hdg = 0.0;
};
struct RoadPolygon
{
vector<Position> _vecPos;
};
struct SignalPos
{
string _id = "";
double _s = 0.0;
double _t = 0.0;
double _zOFF = 0.0;
double _x = 0.0;//����ڳ���x����;
double _y = 0.0;//����ڳ���y����;
};
struct LaneRelation
{
char* _roadID = NULL;
char* _sectionID = NULL;
char* _laneID = NULL;
};
// LANE TYPE
enum RoadDrivingAttr {
ODR_ROAD_TYPE_NONE =0,
ODR_ROAD_TYPE_STraightLine,
ODR_ROAD_TYPE_UTurning,
ODR_ROAD_TYPE_LTurning,
ODR_ROAD_TYPE_RTurning
};
struct LaneGeoCoordinage
{
int indx = 0;
vector<GeoCoordinatePoint> vecGeoLane;
};
/////////////////////////////////////////////////////
///////////////////�����滮;
/////////////////////////////////////////////////////
//·���滮�д���չ��·�ڵ��ID���ܾ���_length��·��������_roadSeq������
struct RoadNode
{
char * _id = NULL;
double _length = 0.0;
double searchlength = 0.0;
std::vector <char *> _roadSeq;
double _duration = 0;
};
//·���滮��_lengthΪ����չ��·�ڵ㵽�����ܾ��룬ͨ�������ԶԴ���չ��·�ڵ��������
struct compare
{
bool operator()(const RoadNode& a, const RoadNode& b) const
{
return a._length > b._length;
}
};
//�����ڵ�
struct LaneNode
{
char * _id = NULL;
char * _lane = NULL;
char * _section = NULL;
double _x = 0.0;
double _y = 0.0;
double _z = 0.0;
};
//�������滮�е������ڵ�
struct SearchNode
{
char * _id = NULL;
char * _section = NULL;
char * _lane = NULL;
double _length = 0.0;
double _x = 0.0;
double _y = 0.0;
double _z = 0.0;
int _count = 0;
int _sectionnum = 0;
int _roadnum = 0;
vector<LaneNode> _laneseq;
};
struct cmp_road {
bool operator ()(SearchNode x, SearchNode y)
{
if (x._roadnum == y._roadnum)
{
return x._count > y._count;
}
else return x._roadnum < y._roadnum;
}
};
struct cmp_section {
bool operator ()(SearchNode x, SearchNode y)
{
if (x._sectionnum == y._sectionnum)
{
return x._count > y._count;
}
else return x._sectionnum < y._sectionnum;
}
};
struct EventPos
{
double x = 0.0;
double y = 0.0;
};
struct Pathpoint
{
double x = 0.0;
double y = 0.0;
double z = 0.0;
double pitch = 0.0;
double roll = 0.0;
double yaw = 0.0;
};
enum ObjType
{
trafficlinemarking,
mark,
pole,
tree,
arrow,
};
enum ObjSubType
{
none,
leftTurn,
straight,
rightTurn,
Uturn,
leftMerge,
rightMerge,
straightleftTurn,//12
leftrightTurn,//13
leftTurnUturn,//14
straightrightTurn,//23
straightUturn,//24
straightleftrightTurn,//123
straightleftTurnUturn,//124
straightrightTurnUturn,//234
straightleftrightTurnUturn,//1234
waitingzoneline,//5.待转区线
Intersectionguideline, //6.路口导向线
//7.导向车道线
//8.禁止停车
//9.渐变段标线
//10.接近障碍物标线
//11.铁路平交道口标线
zebracrossing, //12.人行横道线
//13.车距确认线
stopline, //14.停止线
yeildline, //15.让行线
decelerationline, //16.减速标线
horizontal2Light,
vertical2Light,
horizontal3Light,
vertical3Light,
oneLight,
noneSign,
warningSign,
prohibitionSign,
indicationSign,
guideSign,
tourismAreaSign,
roadOperationSign,
noticeSign,
auxiliarySign,
noneRoad_Side,
curb,
ditch,
ditchWall,
naturalBoundary,
cementPier,
protectiveScreening,
soundproofWall,
hillSide,
wall,
GeneralNewJerseySafetyBarrier,
singleTubeNewJerseySafetyBarrier,
multiTubeNewJerseySafetyBarrier,
corrugatedBarrier,
soxhletBarrier,
beamColumnBarrier,
meshBarrier,
tubularMovableBarrier,
};
}
#pragma once
namespace OpenDrive
{
class Elevation
{
public:
Elevation();
void SetAValue(const double & value);
const double GetAValue() const;
void SetBValue(const double & value);
const double GetBBValue() const;
void SetCValue(const double & value);
const double GetCCValue() const;
void SetDValue(const double & value);
const double GetDValue() const;
void SetSValue(const double & value);
const double GetSValue() const;
Elevation& operator=(const Elevation &elev);
Elevation(const Elevation &elev);
~Elevation();
private:
double _a = 0.0;
double _b = 0;
double _c = 0;
double _d = 0;
double _s = 0;
};
}
#pragma once
#include"vector"
#include"cstring"
#include"string"
#include <sstream>
#include <iostream>
#include <limits>
#include <locale>
#include"string"
#include"DataDefines.h"
#include"Elevation.h"
#include"LaneOffset.h"
using namespace std;
namespace OpenDrive
{
void QuickSort(vector<int> &vecData);
void QuickSort(vector<float> &vecData);
void QuickSort(vector<glm::dvec3> &vecData);//��������;
void QuickSort(vector<int> &vecData, int flag);//flag 0, ��С����1���Ӵ�С��
void QuickSort(vector<int> &vecData, vector<string> &vecLaneID);
void QuickSort(vector<double> &vecData, vector<string> &vecSection);
string DoubleToString(const double &value);
bool GetComClockWise(const glm::dvec2 &p0, const glm::dvec2 &p1, const glm::dvec2 &p2);
//bool GetComClockWise(const glm::dvec3 &p0, const glm::dvec3 &p1, const glm::dvec3 &p2);
double GetLengthFromTwoPoints(const glm::dvec2 &p0, const glm::dvec2 &p1);
string IntToString(const long int &value);
void CalElevation(vector<GeoCoordinatePoint> &vecGeoCoor, const vector<Elevation*> *vecEle);
void CalLaneOffset(vector<GeoCoordinatePoint> &vecGeoCoor, const vector<LaneOffset*> *vecEle);
void CalElevation(GeoCoordinatePoint &geoCoor, const vector<Elevation*> *vecEle);
void CalLaneOffset(GeoCoordinatePoint &geoCoor, const vector<LaneOffset*> *vecEle);
double stringToDouble(string num);
vector<string> split(const string& s, const string& sep);
glm::dvec2 CalJointBetween(const glm::dvec2 &p0, const double &t0, const glm::dvec2 &p1, const double &t1);
double GetDirectionRad(const glm::dvec2 &vline1);
//bool IsInSidePolygon(const glm::vec2 &point, const vector<glm::dvec2> &vecData);
}
#pragma once
#include"DataDefines.h"
#include"vector"
#include"odrSpiral.h"
#include"glm/glm.hpp"
#include <glm/gtc/matrix_transform.hpp>
#include"Function.h"
using namespace std;
namespace OpenDrive
{
class Geometry
{
public:
Geometry();
Geometry(const Geometry &geo);
Geometry & operator = (const Geometry &geo);
double GetLaneDistanceFromLine(const double & longitude, const double &latitude, const double &slen);
double GetLaneDistanceFromArc(const double & longitude, const double &latitude, const double &slen);
double GetLaneDistanceFromSpiral(const double & longitude, const double &latitude, const double &slen);
bool GetNearestInfoFromLine(const double & longitude, const double &latitude,double &distance, glm::dvec2 & vec);
bool GetNearestInfoFromArc(const double & longitude, const double &latitude, double &distance, glm::dvec2 & vec);
bool GetNearestInfoFromSprial(const double & longitude, const double &latitude, double &distance, glm::dvec2 & vec);
bool GetNearestInfoFromPoly3(const double & longitude, const double &latitude, double &distance, glm::dvec2 & vec);
bool IsNearestInfoFromLine(const double &x, const double &y, const double &distance);
bool IsNearestInfoFromArc(const double &x, const double &y, const double &distance);
bool IsNearestInfoFromSprial(const double &x, const double &y, const double &distance);
bool IsNearestInfoFromPoly3(const double &x, const double &y, const double &distance);
const glm::dvec2 GetRoadGeoCoordinateXYFromLine(const double &s, const double &t)const;
const glm::dvec2 GetRoadGeoCoordinateXYFromArc(const double &s, const double &t)const;
const glm::dvec2 GetRoadGeoCoordinateXYFromSpiral(const double &s, const double &t)const;
const glm::dvec2 GetRoadGeoCoordinateXYFromPloy3(const double &s, const double &t)const;
const glm::dvec3 GetRoadGeoCoordinateXYHdgFromLine(const double &s, const double &t)const;
const glm::dvec3 GetRoadGeoCoordinateXYHdgFromArc(const double &s, const double &t)const;
const glm::dvec3 GetRoadGeoCoordinateXYHdgFromSpiral(const double &s, const double &t)const;
const glm::dvec3 GetRoadGeoCoordinateXYHdgFromPloy3(const double &s, const double &t)const;
const bool GetRoadGeoCoordinateSTFromLine(const glm::dvec3 vec, glm::dvec2 &st, double &dis)const;
const bool GetRoadGeoCoordinateSTFromArc(const glm::dvec3 vec, glm::dvec2 &st, double &dis)const;
const bool GetRoadGeoCoordinateSTFromSpiral(const glm::dvec3 vec, glm::dvec2 &st, double &dis)const;
const bool GetRoadGeoCoordinateSTFrompPloy3(const glm::dvec3 vec, glm::dvec2 &st, double &dis)const;
vector<glm::dvec3> GetDataFromLine();
vector<glm::dvec3> GetDataFromArc();
vector<glm::dvec3> GetDataFromSpiral();
//bool GetComClockWise(const glm::dvec2 &p0, const glm::dvec2 &p1, const glm::dvec2 &p2);
const vector<Position> GetLanePosiontAndDircetionsFromLine(const double & initPosition, const double &lastPosition, double &position)const;
const vector<Position> GetLanePosiontAndDircetionsFromArc(const double & initPosition, const double &lastPosition, double &position)const;
const vector<Position> GetLanePosiontAndDircetionsFromSpiral(const double & initPosition, const double &lastPosition, double &position)const;
//const vector<Position> GetLanePosiontAndDircetionsFromPloy3(const double & initPosition, const double &lastPosition, double &position)const;
const vector<TurningAttr> GetLaneTurningAttributesFromLine(const double & initPosition, const double &lastPosition, double &position,const int &flag)const;
const vector<TurningAttr> GetLaneTurningAttributesFromArc(const double & initPosition, const double &lastPosition, double &position, const int &flag)const;
const vector<TurningAttr> GetLaneTurningAttributesFromSpiral(const double & initPosition, const double &lastPosition, double &position, const int &flag)const;
double GetCurvatureFromLine(const double &s);
double GetCurvatureFromArc(const double &s);
double GetCurvatureFromSprial(const double &s);
double GetCurvatureFromPoly3(const double &s);
const double GetRoadGeoCoordinateHdgFromLine(const double &s)const;
const double GetRoadGeoCoordinateHdgFromArc(const double &s)const;
const double GetRoadGeoCoordinateHdgFromSpiral(const double &s)const;
const double GetRoadGeoCoordinateHdgFromPloy3(const double &s)const;
//const vector<TurningAttr> GetLaneTurningAttributesFromPloy3(const double & initPosition, const double &lastPosition, double &position, const int &flag)const;
~Geometry();
public:
double _hdg;
double _length;
double _s;
double _x;
double _y;
EnGeometryType _flag;
double _curvStart;
double _curvEnd;
double _curvature;
double _a = 0.0;
double _b = 0.0;
double _c = 0.0;
double _d = 0.0;
};
}
#pragma once
#include"cstring"
#include"string"
#include"set"
using namespace std;
namespace OpenDrive
{
class Grid
{
public:
Grid();
Grid& operator= (const Grid &grid);
Grid(const Grid &grid);
void SetRoadID(const char* roadID);
set<string> GetRoadID();
~Grid();
private:
set<string> _vecRoad;
};
}
#pragma once
namespace OpenDrive
{
//<height sOffset = "0" inner = "0.2" outer = "0.2" / >
class Height
{
public:
Height();
Height& operator = (const Height &height);
Height(const Height &height);
void SetsOffset(const double &value);
const double GetsOffset() const;
void SetInner(const double &value);
const double GetInner() const;
void SetOuter(const double &value);
const double GetOuter() const;
~Height();
private:
double _sOffset;
double _inner;
double _outer;
};
}
#pragma once
#include"cstring"
#include"string"
#include"Connection.h"
#include"map"
#include"vector"
using namespace std;
namespace OpenDrive
{
class Junction
{
public:
Junction();
Junction(const Junction &junc);
Junction& operator =(const Junction &junc);
void SetID(const char* id);
const char* GetID() const;
void SetName(const char* name);
const char* GetName() const;
void PushbackConnection(Connection *conn);
const vector<Connection*> GetAllConnection() const;
const vector<string> GetConnectingRoad(const char* roadID) const;
~Junction();
private:
string _name;
string _id;
map<string, Connection*> *_mapConn;
};
}
#pragma once
#include"DataDefines.h"
#include"LaneLink.h"
#include"LaneWidth.h"
#include"LaneRoadMark.h"
#include"Speed.h"
#include"Height.h"
#include"Function.h"
#include"UserData.h"
namespace OpenDrive
{
class Lane
{
public:
Lane();
void SetID(const char *id);
void SetSectionID(const char*id);
const char* GetID() const;
void SetLevel(const char* level);
void SetType(const EnLaneType &type);
const EnLaneType GetType() const;
const char* GetTypeString() const;
void SetSpeed(Speed *speed);
const Speed* GetSpeed() const;
void SetHeight(Height *height);
const Height* GetHeight() const;
const LaneLink* GetLink() const;
void SetType(const char* type);
void SetLaneReferenceData(const vector<GeoCoordinatePoint>& vecLaneRefernceData);
void SetLaneBoundaryData(const vector<GeoCoordinatePoint>& vecLaneRefernceData);
const vector<GeoCoordinatePoint>* GetlaneBoundaryData() const;
void SetLaneWidth(LaneWidth *width);
const vector<LaneWidth>* GetLaneWidth() const;
void SetLink(LaneLink* link);
void SetRoadMark(LaneRoadMark *roadMark);
const LaneRoadMark* GetLaneRoadMark() const;
LaneWidth GetLaneWidthFromLane(const double &soff);
//LaneWidth GetFirstLaneWidthFromLane(const double &soff);
void ConstructPolygon();
Lane& operator= (const Lane &lane);
const string GetPreLaneID()const;
const string GetSucLaneID()const;
Lane(const Lane &lane);
void CalBoundaryData();
const double GetLaneSpeed() const;
const vector<GeoCoordinatePoint>* GetLaneRefernceData() const;
const vector<GeoCoordinatePoint>* GetLaneBoundaryData() const;
void SetUserData(UserData *userData);
const UserData* GetUserData() const;
~Lane();
private:
string _id;
double _s = 0.0;
Height *_height;
EnLaneType _type;
LaneLink *_link;
vector<LaneWidth> *_laneWidth;
LaneRoadMark *_roadMark;
UserData *_userData;
Speed *_speed;
//vector<GeoCoordinatePoint> *_laneReference;
vector<GeoCoordinatePoint> *_laneReferenceData;
vector<GeoCoordinatePoint> *_laneBoundaryData;
public:
string _level = "false";
};
}
#pragma once
#include"Lane.h"
#include"DataDefines.h"
#include"LaneLink.h"
#include"LaneWidth.h"
#include"LaneRoadMark.h"
#include"Speed.h"
#include"Function.h"
#include"string"
using namespace std;
namespace OpenDrive
{
class LaneBase
{
public:
LaneBase();
LaneBase(const Lane*lane);
LaneBase& operator= (const LaneBase &lane);
LaneBase(const LaneBase &lane);
const double GetLaneSpeed() const;
//const vector<LaneWidth>& GetLaneWidth() const;
void SetRoadID(const char* roadID);
void SetSectionID(const char* roadID);
~LaneBase();
public:
string _id;
string _RoadID;
string _SectionID;
PosXY _initP;
PosXY _termP;
double _length = 0.0;
EnLaneType _type;
Speed *_speed;
LaneRoadMark *_roadMark;
vector<LaneWidth> *_vecLaneWidth;
string _strMaterial = "";
string _strVisible = "";
string _strAccess = "";
string _strHeight = "";
string _strRule = "";
};
}
#pragma once
#include"string"
using namespace std;
namespace OpenDrive
{
class LaneLink
{
public:
LaneLink();
LaneLink(const LaneLink&link);
void SetPreID(const char* id);
void SetSucID(const char* id);
const string GetPreLaneID()const;
const string GetSucLaneID()const;
LaneLink& operator = (const LaneLink&link);
~LaneLink();
private:
string _preID ;
string _sucID;
//<predecessor id = "-2" / >
// <successor id = "-3" / >
};
}
#pragma once
namespace OpenDrive
{
class LaneOffset
{
public:
LaneOffset();
void SetAValue(const double & value);
const double GetAValue() const;
void SetBValue(const double & value);
const double GetBBValue() const;
void SetCValue(const double & value);
const double GetCCValue() const;
void SetDValue(const double & value);
const double GetDValue() const;
void SetSValue(const double & value);
const double GetSValue() const;
LaneOffset& operator=(const LaneOffset &elev);
LaneOffset(const LaneOffset &elev);
~LaneOffset();
private:
double _a = 0.0;
double _b = 0;
double _c = 0;
double _d = 0;
double _s = 0;
};
}
#pragma once
#include"DataDefines.h"
namespace OpenDrive
{
class LaneRoadMark
{
public:
LaneRoadMark();
void SetColor(const char* color);
const EnRoadMarkColor GetColor() const;
void SetType(const char* type);
const EnRoadMarkType GetType() const;
void SetWeight(const char* weight);
const EnRoadMarkWeight GetWeight() const;
void SetOffSet(const double & offset);
const double GetOffSet()const;
LaneRoadMark(const LaneRoadMark & roadMark);
LaneRoadMark& operator = (const LaneRoadMark & roadMark);
~LaneRoadMark();
private:
EnRoadMarkColor _color;
EnRoadMarkType _type;// = "broken"
EnRoadMarkWeight _weight;// = "standard"
double _sOffset;
};
}
#pragma once
#include"map"
#include"Lane.h"
#include"Polygon.h"
#include"Function.h"
using namespace std;
namespace OpenDrive
{
class LaneSection
{
public:
LaneSection();
LaneSection(const LaneSection &laneSection);
LaneSection & operator = (const LaneSection &laneSection);
void SetLaneSectionID();
void ConstructPolygon(const vector<glm::dvec3> &vecRoadData);
void SetID(const char *id);
void SetWidth(const double &left,const double &right);
void PushLane(Lane *lane);
const char* GetID() const;
const string GetLaneID(const char* sectionID, const double & s, const double &t, const double &distance) const;
const string GetLaneID(const char* sectionID, const double & longitude, const double &latitude, const double & x, const double & y, const double & hdg) const;
vector<Lane*> GetAllLane() const ;
Lane* GetLane(const char* laneID);
const string GetPreLaneID(const char* laneID)const;
const string GetSucLaneID(const char* laneID)const;
const vector<string> GetLeftLaneIDS(const char* laneID)const;
const vector<string> GetRightLaneIDS(const char* laneID)const;
const vector<string> GetAllDrivingLaneIDS() const;
const vector<string> GetAllLaneIDS() const;
bool IsInSideLaneSection(const double & longitude, const double &latitude);
//const vector<LaneWidth>* GetFirstLaneWith(const char* laneID);
const LaneWidth GetLaneWith(const char* laneID, double s);
const vector<RoadWidth> GetSectionWidthofRoad() const;
const NearestDistance GetNeartestRoadandLaneAttributes(const char* laneID, const double &s, const double &t) const;
const NearestRoadMark GetNeartestLaneRoadMark(const char* laneID) const;
void CalBoundaryData(const char* laneID);
const vector<GeoCoordinatePoint>* GetlaneBoundaryData(const char* laneID) const;
const double GetLaneSpeed(const char* laneID) const;
const vector<PosXY>* GetLeftLinePosFromLane(const char* laneID) const;
const vector<PosXY>* GetRightLinePosFromLane(const char* laneID) const;
GeoCoordinatePoint* GetLanePositionBySectionID(const char* laneID) const;
const char* GetLaneTypeString(const char* laneID) const;
~LaneSection();
private:
map<string, Lane*>* _mapLane;
vector<Polygon*> *_vecPlygon;
string _id;
double _s;
double _leftWidth;
double _rightWidth;
};
}
#pragma once
namespace OpenDrive
{
class LaneWidth
{
public:
LaneWidth();
void SetAValue(const double & value);
const double GetAValue() const;
void SetBValue(const double & value);
const double GetBBValue() const;
void SetCValue(const double & value);
const double GetCCValue() const;
void SetDValue(const double & value);
const double GetDValue() const;
void SetOffSetValue(const double & value);
const double GetOffSetValue() const;
LaneWidth& operator=(const LaneWidth &width);
LaneWidth(const LaneWidth &width);
~LaneWidth();
private:
double _a = 0.0;
double _b = 0;
double _c = 0;
double _d = 0;
double _sOffset = 0;
};
}
#pragma once
#include <math.h>
#include"glm/glm.hpp"
#include"map"
#include"string"
using namespace std;
class NavinfoGISCoord
{
public:
static NavinfoGISCoord* GetInstance();
glm::dvec2 LatLonToTM(const double &lon, const double &lat, const char* name);
glm::dvec2 XYToLatLonTM(double x, double y, bool southhemi, const char* name);
//glm::dvec2 XYToLatLonTM(double x, double y, bool southhemi);
double TMCentralMeridian(const double &zone);
glm::dvec2 LatLonToUTM(const double &lon, const double &lat, const char* name);
glm::dvec2 XYToLatLonUTM(double x, double y, bool southhemi, const char* name);
//glm::dvec2 XYToLatLonUTM(double x, double y, bool southhemi);
double UTMCentralMeridian(const double &zone);
glm::dvec2 MapLatLonToXY(const double &phi, const double &lambda, const double &lambda0);
glm::dvec2 MapXYToLatLon(double x, double y, double lambda0);
double ArcLengthOfMeridian(const double &phi);
double FootpointLatitude(double y);
private:
NavinfoGISCoord();
~NavinfoGISCoord();
private:
const double pi = M_PI;
const double sm_a = 6378137.0;
const double sm_b = 6356752.3142;
const double TMScaleFactor = 1.0;
const double UTMScaleFactor = 0.99960000000000000;
map<string, double> *_mapUTMZone;
map<string, double> *_mapTMZone;
map<string, glm::dvec2> *_mapUTMDiff;
map<string, glm::dvec2> *_mapTMDiff;
private:
static NavinfoGISCoord *_instance;
};
#pragma once
#include"vector"
#include"glm/glm.hpp"
#include"DataDefines.h"
#include"Function.h"
#include"RepeatObj.h"
using namespace std;
namespace OpenDrive
{
class Object
{
public:
Object();
Object(const Object & obj3d);
Object& operator =(const Object & obj);
void SetName(const char* name);
const char* GetName() const;
void SetType(const char* type);
const char* GetType() const;
void SetSValue(double &value);
const double GetSValue() const;
void SetTValue(double &value);
const double GetTValue() const;
void PushbackData(glm::dvec3 vec);
vector<glm::dvec3>* GetCoords();
void SetWidthValue(double &value);
const double GetWidthValue() const;
void SetHeightValue(double &value);
const double GetHeightValue() const;
//zOffset
void SetzOffsetValue(double &value);
const double GetzOffsetValue() const;
void SetRepeatObjValue(RepeatObj *repeatObj);
const RepeatObj * GetRepeatObjValue() const;
~Object();
private:
string _name;
string _type;
double _s;
double _t;
double _width;
double _height;
double _zOffset;
vector<glm::dvec3> *_vecCoords;
RepeatObj *_repeatObj;
//<repeat s = "2.73406954883456" length = "79.566455604047" distance = "15" tStart = "-13.3226013033395" tEnd = "-13.3226013033395" widthStart = "5.7990000000000004e+00" widthEnd = "5.7990000000000004e+00" heightStart = "6.6230000000000002e+00" heightEnd = "6.6230000000000002e+00" zOffsetStart = "-3.8850000000000007e-01" zOffsetEnd = "-3.8850000000000007e-01" / >
};
}
#pragma once
#include"Road.h"
#include"Junction.h"
#include"unordered_map"
#include"xml/tinyxml.h"
#include"xml/tinystr.h"
#include"glm/glm.hpp"
#include"DataDefines.h"
#include"Elevation.h"
#include"SignalReference.h"
#include"NavinfoGISCoord.h"
#include"LaneBase.h"
#include"RoadBase.h"
#include"stack"
#include"Grid.h"
#include<fstream>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
namespace OpenDrive
{
class OdrManager
{
public:
explicit OdrManager();
bool LoadFile(const char* name);
const vector<OdrInfo> GetOdrInfo(const double & longitude, const double &latitude) const;
const vector<OdrInfo> GetOdrInfoByXY(const double & x, const double &y) const;
bool GetSucRoadID(const char* roadID, char**&vecRoadID, int &nSize);
bool GetPreRoadID(const char* roadID, char**&vecRoadID, int &nSize);
bool GetPreLaneID(const char* roadID, const char* sectionID, const char* laneID, char**&vecLane, int &nSize);
bool GetSucLaneID(const char* roadID, const char* sectionID, const char* laneID, char**&vecLane, int &nSize);
bool GetPreLaneRelationID(const char* roadID, const char* sectionID, const char* laneID, LaneRelation*&vecLaneRelation, int &nSize);
bool GetSucLaneRelationID(const char* roadID, const char* sectionID, const char* laneID, LaneRelation*&vecLaneRelation, int &nSize);
bool GetLeftLaneIDS(const char* roadID, const char* sectionID, const char* laneID, char**&vecLane, int &nSize);
bool GetRightLaneIDS(const char* roadID, const char* sectionID, const char* laneID, char**&vecLane, int &nSize);
bool GetAllDrivingLaneIDS(const char* roadID, const char* sectionID, char**&vecLane, int &nSize);
bool GetAllSectionIDS(const char* roadID, char**&vecSection, int &nSize);
bool GetAllRoadIDS(char**&vecRoad, int &nSize);
bool GetSectionWidthofRoad(const char* roadID, const char* sectionID, RoadWidth*&vecRoaDWidth, int &nSize);
//const vector<RoadWidth> GetSectionWidthofRoad(const char* roadID, const char* sectionID) const;
bool GetLanePosiontAndDircetions(const char* roadID, const char* sectionID, const char* laneID, const double & longitude, const double &latitude, Position*& pos, int &nSize);
bool GetLanePosiontAndDircetionsByXY(const char* roadID, const char* sectionID, const char* laneID, const double &x, const double &y, Position*& pos, int &nSize);
bool GetLaneTurningAttributes(const char* roadID, const char* sectionID, const char* laneID, const double &headDir, TurningAttr*& turAtt, int &nSize);
NearestDistance* GetNeartestRoadandLaneAttributes(const double & longitude, const double &latitude);
NearestDistance* GetNeartestRoadandLaneAttributesByXY(const double & x, const double &y);
NearestRoadMark GetNeartestLaneRoadMark(const double & longitude, const double &latitude);
NearestRoadMark GetNeartestLaneRoadMarkByXY(const double &x, const double &y);
bool GetEdgePolygon(const double &longitude, const double &latitude, const double &radius, PosXY**& pos, int &nSize, int *&length);
bool GetEdgePolygonByXY(const double &x, const double &y, const double &radius, PosXY**& pos, int &nSize, int *&length);
//const RoadProperty GetLaneProperty(const vector<Position> &vecPosition) const;
bool GetEdgePolygon(const double &longitude, const double &latitude, const double &radius, PosXY*& pos, int &nSize);
bool GetEdgePolygonByXY(const double &x, const double &y, const double &radius, PosXY*& pos, int &nSize);
const double GetLaneSpeed(const char* roadID, const char* sectionID, const char* laneID) const; //m/s;
bool GetLightPos(const double &longitude, const double &latitude, SignalPos*&pos, int &nSize) ;
bool GetLightPosByXY(const double &x, const double &y, SignalPos*&pos, int &nSize) ;
bool GetStopLinePos(const double &longitude, const double &latitude, SignalPos*&pos, int &nSize) ;
bool GetStopLinePosByXY(const double &x, const double &y, SignalPos*&pos, int &nSize) ;
bool GetLeftLinePosFromLane(const char* roadID, const char* sectionID, const char* laneID, const double &longitude, const double &latitude, PosXY*& pos, int &nSize); //������߽���������;
bool GetLeftLinePosFromLaneByXY(const char* roadID, const char* sectionID, const char* laneID, const double &x, const double &y, PosXY*& pos, int &nSize); //������߽���������;
bool GetRightLinePosFromLane(const char* roadID, const char* sectionID, const char* laneID, const double &longitude, const double &latitude, PosXY*& pos, int &nSize);//�����ұ߽���������;
bool GetRightLinePosFromLaneByXY(const char* roadID, const char* sectionID, const char* laneID, const double &x, const double &y, PosXY*& pos, int &nSize);//�����ұ߽���������;
PosXY GetXYFromRoadID(const char* roadID, const double &s, const double &t);
PosXY GetSTFromRoadID(const char* roadID, const double &x, const double &y);
PosXY LatLonToUTM(const double &lon, const double &lat) const;
PosXY XYToLatLonUTM(const double &lon, const double &lat) const;
LaneBase* GetLaneBase(const char* roadID, const char* sectionID, const char* laneID);
RoadBase* GetRoadBase(const char* roadID);
RoadDrivingAttr GetRoadDriveTurningAttr(const char* roadID);
void PreRoadID(const char* roadID, const double &length, const double &dir, stack<string> &stkRoad);
bool GetLaneInfor(const double &longitude, const double &latitude, const double &dir, const double &length, const double &width, bool bRoad_Edge, PosXY**& pos, int &nArraySize, int *&nSize, const double& thresholdDegreeValue);
bool GetLaneInforByXY(const double &x, const double &y, const double &dir, const double &length , const double &width, bool bRoad_Edge, PosXY**& pos, int &nArraySize, int *&nSize, const double& thresholdDegreeValue);
void GetRoadLaneInfor(Road*road, vector<LaneGeoCoordinage> &vecGeo, const set<string> &setTerm, set<string> &hasRoad, const vector<glm::dvec2> &vecData);
/////////////////
/////·���滮;
/////////////////
bool GetRoadPathByXY(const double sx, const double sy, const double ex, const double ey, vector<char *> &path, double &path_length);
bool GetRoadPath(const double &startlongitude, const double &startlatitude, const double &endlongitude, const double &endlatitude, std::vector<char *> &path, double &path_length);
bool GetSigleLanePath(const SearchNode sourcenode, const vector<LaneNode>events, const LaneNode lanenode, SearchNode &searchnode);
bool GetLanePathByXY(const double sx, const double sy, const double ex, const double ey, const vector<EventPos>events, vector<LaneNode> &path, double &path_length);
bool GetLanePath(const double &startlongitude, const double &startlatitude, const double &endlongitude, const double &endlatitude, const vector<EventPos>events, vector<Pathpoint> &path, double &path_length);
const char* GetLaneTypeString(const char* roadID, const char* sectionID, const char* laneID) const;
double GetHeightZvalue(const double &longitude, const double &latitude);
double GetHeightZvalueByXY(const double &x, const double &y);
double GetHdg(const double &longitude, const double &latitude);
double GetHdgByXY(const double &longitude, const double &latitude);
double GetHdg(const double &longitude, const double &latitude,const double &comValue);
double GetHdgByXY(const double &x, const double &y, const double &comValue);
bool bJunctionRoad(const char* roadID);
double GetHdg(const double &longitude, const double &latitude, string &roadID);
double GetHdgByXY(const double &longitude, const double &latitude, string &roadID);
double GetHdg(const double &longitude, const double &latitude, const double &comValue, string &roadID);
double GetHdgByXY(const double &x, const double &y, const double &comValue, string &roadID);
~OdrManager();
private:
vector<vector<glm::dvec3>> GetPrePolygon(const double &s, Road* road);
vector<vector<glm::dvec3>> GetSucPolygon(Road* road, const double &len);
vector<vector<glm::dvec3>> GetPolygon(const double &s, Road* road, const double &length);
private:
unordered_map<string, Road*> *_mapRoad;
unordered_map<string, Junction*> *_mapJunction;
};
}
#pragma once
#include"string"
#include"vector"
#include"glm/glm.hpp"
using namespace std;
namespace OpenDrive
{
class Polygon
{
public:
Polygon();
Polygon(const int &strSID, const int & strLaneID);
Polygon(const Polygon &plygon);
Polygon &operator = (const Polygon &plygon);
void SetData(glm::vec2 value, int indx);
void SetSID(int inSID);
void SetLaneID(int inLaneID);
void CalCenter();
void CalLineCenter();
void CalTriangleCenter();
void CalDirection();
void CalLineDirection();
void CalTriangleDirection();
const glm::vec2 & GetCenter();
const glm::vec2 & GetDirection();
const int &GetSectionID();
const int &GetLaneID();
const bool &GetEnterIsInSideFlag();
const bool &GetExitIsInSideFlag();
bool BEnterIsInSide(const glm::vec2 &intiPoint);
bool BExitIsInSide(const glm::vec2 &termiPoint);
bool BIsInSideLine(const glm::vec2 &point);
bool BIsInSideTriangle(const glm::vec2 &point);
bool BIsLine();
bool BIsTriangle();
void SetbEnterValue(const bool &bValue);
void SetbExitValue(const bool &bValue);
bool IsInSidePolygon(const glm::vec2 &point);
~Polygon();
private:
int _strSID;
int _strLaneID;
bool _bEnter;
bool _bExit;
vector<glm::vec2> _vecData;
glm::vec2 _center;
glm::vec2 _direction;
public:
string _strEnter;
string _strExit;
string _strSectionName;
};
}
#pragma once
#include"vector"
#include"glm/glm.hpp"
#include"DataDefines.h"
#include"Function.h"
using namespace std;
namespace OpenDrive
{
class RepeatObj
{
public:
RepeatObj();
RepeatObj(const RepeatObj & obj);
RepeatObj& operator =(const RepeatObj & obj);
~RepeatObj();
void SetDistanceValue(double &value);
const double GetDistanceValue() const;
void SetLengthValue(double &value);
const double GetLengthValue() const;
void SetWidthValue(double &value);
const double GetWidthValue() const;
void SetHeightValue(double &value);
const double GetHeightValue() const;
private:
double _distance = 0.0;
double _length;
double _width;
double _height;
};
}
#pragma once
#include "Lane.h"
#include "LaneSection.h"
#include"unordered_map"
#include"glm/glm.hpp"
#include <glm/gtc/matrix_transform.hpp>
#include"DataDefines.h"
#include"Geometry.h"
#include"RoadLink.h"
#include"Polygon.h"
#include"Function.h"
#include"Elevation.h"
#include"Signal.h"
#include"LaneOffset.h"
#include "Object.h"
#include <string>
//#include <io.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include<ctype.h>
using namespace std;
namespace OpenDrive
{
//extern void QuickSort(vector<double> &vecData);
//extern string DoubleToString(const double &value);
//extern string IntToString(const long int &value);
class Road
{
public:
Road();
Road(const Road & obj3d);
Road& operator =(const Road & road);
void SetID(const char* id);
void SetName(const char* name);
void SetJunction(const char* junction);
void SetLength(const double &junction);
//double GetLength();
void SetLink(const RoadLink & link, const char* name);
const char* GetSucRoad() const;
const char* GetPreRoad() const;
void PushbackLaneSection(LaneSection *laneSection);
LaneSection* GetSection(const char* sectionID);
void PushbackData(Geometry *geo);
void PushElevation(Elevation *ele);
void PushLaneOffSet(LaneOffset *laneOffset);
void PushSignal(Signal *sigl);
void PushObject(Object *obj);
void ResizeData();
void ResizeLaneSection();
const char* GetID() const;
const double GetLength() const;
const char* GetName() const;
const glm::dvec3 GetInitPosXY() const;
const glm::dvec3 GetTermPosXY() const;
double GetHeightZvalue(const double &s, const double &t);
void ConstructPolygon(glm::dvec2 &max, glm::dvec2 &min);
bool IsInSideRoad(const double & longitude, const double &latitude);
//void GetRefernceData();
const string GetPreLaneID(const char* sectionID, const char* laneID) const;
const string GetSucLaneID(const char* sectionID, const char* laneID) const;
const string GetLaneSectionID(const double &s) const;
const string GetLaneID(const char* sectionID, const double & longitude, const double &latitude, const double &distance) const;
const string GetLaneID(const char* sectionID, const double & longitude, const double &latitude) const;
const vector<string> GetLeftLaneIDS(const char* sectionID, const char* laneID)const;
const vector<string> GetRightLaneIDS(const char* sectionID, const char* laneID)const;
const vector<string> GetAllDrivingLaneIDS(const char* sectionID) const;
const vector<string> GetAllSectionIDS() const;
const vector<RoadWidth> GetSectionWidthofRoad(const char* sectionID) const;
const vector<Position> GetLanePosiontAndDircetions(const char* sectionID, const char* laneID) const;
const vector<TurningAttr> GetLaneTurningAttributes(const char* sectionID, const char* laneID) const;
const NearestDistance GetNeartestRoadandLaneAttributes(const char* sectionID, const char* laneID, const double &s, const double &t) const;
const NearestRoadMark GetNeartestLaneRoadMark(const char* sectionID, const char* laneID) const;
OdrInfo GetNearest(const double & longitude, const double &latitude,double &distance);
bool IsNearestRoad(const double & x, const double &y, const double &distance);
vector<GeoCoordinatePoint> GetDataFromLine(const double &s, const double &sReal, const double &x, const double &y, const double &hdg, const double &length);
vector<GeoCoordinatePoint> GetDataFromArc(const double &s, const double &sReal, const double &x, const double &y, const double &hdg, const double &length, const double &curvature);
vector<GeoCoordinatePoint> GetDataFromSprial(const double &s, const double &sReal, const double &x0, const double &y0, const double &hdg, const double &length, const double &curvEnd, const double &curvStart, double &lastcurv);
vector<GeoCoordinatePoint> GetDataFromPoly3(const double &s, const double &sReal, const double &x, const double &y, const double &hdg, const double &length, const double &a, const double &b, const double &c, const double &d);
const glm::dvec2 GetRoadInitPos() const;
const double GetLaneSpeed(const char* sectionID, const char* laneID) const;
const vector<SignalPos>* GetLightPos() const;
const vector<SignalPos>* GetStopLinePos() const;
const glm::dvec2 GetRoadGeoCoordinateXY(const double &s, const double &t)const;
const glm::dvec3 GetRoadGeoCoordinateXYHdg(const double &s, const double &t)const;
const glm::dvec2 GetSTCoordinateFromRoad(const double &x, const double &y)const;
const vector<PosXY>* GetLeftLinePosFromLane(const char* sectionID, const char* laneID) const;
const vector<PosXY>* GetRightLinePosFromLane(const char* sectionID, const char* laneID) const;
string GetLastSection()const;
string GetPreSection(const char* sectionID)const;
string GetSucSection(const char* sectionID)const;
const bool IsFirstSection(const char* sectionID)const;
const bool IsLastSection(const char* sectionID)const;
RoadDrivingAttr GetRoadDriveTurningAttr();
vector<GeoCoordinatePoint>* GetLeftBoundartData();
vector<GeoCoordinatePoint>* GetRightBoundartData();
vector<GeoCoordinatePoint>* GetReferenceData();
vector<Object*>* GetObjectData();
void GenerateLaneShp();
void GenerateObjShp();
void GenerateSingalObjShp();
void part(string _str, vector<int> &_num, vector<char> &_op);
GeoCoordinatePoint* GetLanePositionBySectionID(const char* sectionID, const char* laneID) const;
string GetJunction();
const char* GetLaneTypeString(const char* sectionID, const char* laneID) const;
double GetHdg(const double &s);
double GetElevation(const double &s);
~Road();
private:
vector<LaneSection*> *_vecLanSections;
map<string, Signal*> *_mapSignals;
string _name;
string _id;
string _junction;
double _length;
vector<LaneOffset*> *_vecLaneOff;
vector<Geometry*> *_vecData;
vector<Elevation*> *_vecElev;
RoadLink *_preLink;
RoadLink *_sucLink;
vector<Polygon*> _vecPolygon;
vector<GeoCoordinatePoint> *_vecReferenceData;
vector<GeoCoordinatePoint> *_vecLeftBoundaryData; //_laneBoundaryData
vector<GeoCoordinatePoint> *_vecRightBoundaryData; //_laneBoundaryData
glm::dvec2 _midPoint;
glm::dvec2 _min;
glm::dvec2 _max;
vector<string> _sectionID;
vector<Object*>* _vecObjs;
public:
glm::dvec2 _initPoint;
glm::dvec2 _termPoint;
};
}
#pragma once
#include"map"
#include"glm/glm.hpp"
#include"DataDefines.h"
#include"RoadLink.h"
#include"Function.h"
#include"Signal.h"
#include"Road.h"
using namespace std;
namespace OpenDrive
{
class RoadBase
{
public:
RoadBase();
RoadBase(const Road* road);
RoadBase(const RoadBase & roadBase);
RoadBase& operator =(const RoadBase & roadBase);
~RoadBase();
public:
string _name;
string _id;
double _length;
PosXY _initP;
PosXY _termP;
};
}
#pragma once
#include"string"
using namespace std;
namespace OpenDrive
{
class RoadLink
{
public:
RoadLink();
RoadLink& operator = (const RoadLink &link);
RoadLink(const RoadLink &link);
void SetContactPoint(const char* contactPoint);
void SetElementId(const char* elementId);
void SetElementType(const char* elementType);
const char* GetContactPoint()const;
const char* GetElementId()const;
const char* GetElementType()const;
~RoadLink();
private:
string _contactPoint;
string _elementId; //= "19046"
string _elementType;// = "junction" / >
};
}
#pragma once
#include"string"
#include"vector"
#include"SignalReference.h"
using namespace std;
namespace OpenDrive
{
class Signal
{
public:
Signal();
Signal &operator = (const Signal &sigl);
Signal(const Signal &sigl);
void SetID(const char* id);
const char* GetID() const;
void SetName(const char* name);
const char* GetName() const;
void SetCoodinateS(const double& value);
const double GetCoodinateS() const;
void SetCoodinateT(const double& value);
const double GetCoodinateT() const;
void SetCoodinatezOffset(const double& value);
const double GetCoodinatezOffset() const;
void PushSignal(SignalReference *siglRef);
~Signal();
private:
double _s;
double _t;
string _id;
string _name;
double _zOffset;
vector<SignalReference*> *_vecSigRef;
};
}
#pragma once
#include"string"
using namespace std;
namespace OpenDrive
{
class SignalReference
{
public:
SignalReference();
SignalReference& operator=(const SignalReference &siglRef);
SignalReference (const SignalReference &siglRef);
void SetID(const char* id);
const char* GetID() const;
void SetCoodinateS(const double& value);
const double GetCoodinateS() const;
void SetCoodinateT(const double& value);
const double GetCoodinateT() const;
~SignalReference();
private:
double _s = 0.0;
double _t = 0.0;
string _id;
};
}
#pragma once
namespace OpenDrive
{
class Speed
{
public:
Speed();
Speed& operator = (const Speed &speed);
Speed(const Speed &speed);
void SetsOffset(const double &value);
const double GetsOffset() const;
void SetMax(const double &value);
const double GetMax() const;
~Speed();
private:
double _sOffset;
double _max;
};
}
#pragma once
#include"string"
using namespace std;
namespace OpenDrive
{
class UserData
{
public:
UserData();
UserData& operator = (const UserData &usData);
UserData(const UserData &usData);
void SetCode(const char* id);
const string GetCode() const;
void SetsOffset(const char* sOffset);
const string GetsOffset() const;
void SetLaneStyle(const char* laneStyle);
const string GetLaneStyle() const;
void SetMapping(const char* mapping);
const string GetMapping() const;
void SetPos(const char* pos);
const string GetPos() const;
void SetStyle(const char* style);
const string GetStyle() const;
void SetId(const char* id);
const string GetId() const;
~UserData();
private:
string _code;
string _sOffset;
string _laneStyle;
string _mapping;
string _pos;
string _style;
string _id;
};
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment