|
@@ -3,6 +3,336 @@
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
+Object_outlines_outline::Object_outlines_outline()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+Object_outlines::Object_outlines()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+Object_material::Object_material()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+int Object_material::Getsurface(string & surface)
|
|
|
+{
|
|
|
+ if(msurface.size()<1)return 0;
|
|
|
+ surface = msurface[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_material::Getfriction(double & friction)
|
|
|
+{
|
|
|
+ if(mfriction.size()<1)return 0;
|
|
|
+ friction = mfriction[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_material::Getroughness(double & roughness)
|
|
|
+{
|
|
|
+ if(mroughness.size()<1)return 0;
|
|
|
+ roughness = mroughness[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_material::Setsurface(string surface)
|
|
|
+{
|
|
|
+ if(msurface.size()>0)msurface.clear();
|
|
|
+ msurface.push_back(surface);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_material::Setfriction(double friction)
|
|
|
+{
|
|
|
+ if(mfriction.size()>0)mfriction.clear();
|
|
|
+ mfriction.push_back(friction);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_material::Setroughness(double roughness)
|
|
|
+{
|
|
|
+ if(mroughness.size()>0)mroughness.clear();
|
|
|
+ mroughness.push_back(roughness);
|
|
|
+}
|
|
|
+
|
|
|
+Object_repeat::Object_repeat(double s,double length,double distance,double tStart,double tEnd,double heightStart,
|
|
|
+ double heightEnd,double zOffsetStart,double zOffsetEnd)
|
|
|
+{
|
|
|
+ ms = s;
|
|
|
+ mlength = length;
|
|
|
+ mdistance = distance;
|
|
|
+ mtStart = tStart;
|
|
|
+ mtEnd = tEnd;
|
|
|
+ mheightStart = heightStart;
|
|
|
+ mheightEnd = heightEnd;
|
|
|
+ mzOffsetStart = zOffsetStart;
|
|
|
+ mzOffsetEnd = zOffsetEnd;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::Gets()
|
|
|
+{
|
|
|
+ return ms;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::Getlength()
|
|
|
+{
|
|
|
+ return mlength;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::Getdistance()
|
|
|
+{
|
|
|
+ return mdistance;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::GettStart()
|
|
|
+{
|
|
|
+ return mtStart;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::GettEnd()
|
|
|
+{
|
|
|
+ return mtEnd;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::GetheightStart()
|
|
|
+{
|
|
|
+ return mheightStart;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::GetheightEnd()
|
|
|
+{
|
|
|
+ return mheightEnd;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::GetzOffsetStart()
|
|
|
+{
|
|
|
+ return mzOffsetStart;
|
|
|
+}
|
|
|
+
|
|
|
+double Object_repeat::GetzOffsetEnd()
|
|
|
+{
|
|
|
+ return mzOffsetEnd;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void Object_repeat::Sets(double s)
|
|
|
+{
|
|
|
+ ms = s;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::Setlength(double length)
|
|
|
+{
|
|
|
+ mlength = length;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::Setdistance(double distance)
|
|
|
+{
|
|
|
+ mdistance = distance;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SettStart(double tStart)
|
|
|
+{
|
|
|
+ mtStart = tStart;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SettEnd(double tEnd)
|
|
|
+{
|
|
|
+ mtEnd = tEnd;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetheightStart(double heightStart)
|
|
|
+{
|
|
|
+ mheightStart = heightStart;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetheightEnd(double heightEnd)
|
|
|
+{
|
|
|
+ mheightEnd = heightEnd;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetzOffsetStart(double zOffsetStart)
|
|
|
+{
|
|
|
+ mzOffsetStart = zOffsetStart;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetzOffsetEnd(double zOffsetEnd)
|
|
|
+{
|
|
|
+ mzOffsetEnd = zOffsetEnd;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+int Object_repeat::GetwidthStart(double & widthStart)
|
|
|
+{
|
|
|
+ if(mwidthStart.size() <1)return 0;
|
|
|
+ widthStart = mwidthStart[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_repeat::GetwidthEnd(double & widthEnd)
|
|
|
+{
|
|
|
+ if(mwidthEnd.size() < 1)return 0;
|
|
|
+ widthEnd = mwidthEnd[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_repeat::GetlengthStart(double & lengthStart)
|
|
|
+{
|
|
|
+ if(mlengthStart.size() < 1)return 0;
|
|
|
+ lengthStart = mlengthStart[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_repeat::GetlengthEnd(double & lengthEnd)
|
|
|
+{
|
|
|
+ if(mlengthEnd.size() < 1)return 0;
|
|
|
+ lengthEnd = mlengthEnd[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_repeat::GetradiusStart(double & radiusStart)
|
|
|
+{
|
|
|
+ if(mradiusStart.size() < 1)return 0;
|
|
|
+ radiusStart = mradiusStart[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Object_repeat::GetradiusEnd(double & radiusEnd)
|
|
|
+{
|
|
|
+ if(mradiusEnd.size() < 1)return 0;
|
|
|
+ radiusEnd = mradiusEnd[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::DeletewidthStart()
|
|
|
+{
|
|
|
+ if(mwidthStart.size() > 0)mwidthStart.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::DeletewidthEnd()
|
|
|
+{
|
|
|
+ if(mwidthEnd.size() > 0)mwidthEnd.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::DeletelengthStart()
|
|
|
+{
|
|
|
+ if(mlengthStart.size() > 0)mlengthStart.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::DeletelengthEnd()
|
|
|
+{
|
|
|
+ if(mlengthEnd.size() > 0)mlengthEnd.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::DeleteradiusStart()
|
|
|
+{
|
|
|
+ if(mradiusStart.size() > 0)mradiusStart.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::DeleteradiusEnd()
|
|
|
+{
|
|
|
+ if(mradiusEnd.size() > 0)mradiusEnd.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetwidthStart(double widthStart)
|
|
|
+{
|
|
|
+ if(mwidthStart.size() > 0)mwidthStart.clear();
|
|
|
+ mwidthStart.push_back(widthStart);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetwidthEnd(double widthEnd)
|
|
|
+{
|
|
|
+ if(mwidthEnd.size() > 0)mwidthEnd.clear();
|
|
|
+ mwidthEnd.push_back(widthEnd);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetlengthStart(double lengthStart)
|
|
|
+{
|
|
|
+ if(mlengthStart.size() > 0)mlengthStart.clear();
|
|
|
+ mlengthStart.push_back(lengthStart);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetlengthEnd(double lengthEnd)
|
|
|
+{
|
|
|
+ if(mlengthEnd.size() > 0)mlengthEnd.clear();
|
|
|
+ mlengthEnd.push_back(lengthEnd);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetradiusStart(double radiusStart)
|
|
|
+{
|
|
|
+ if(mradiusStart.size() > 0)mradiusStart.clear();
|
|
|
+ mradiusStart.push_back(radiusStart);
|
|
|
+}
|
|
|
+
|
|
|
+void Object_repeat::SetradiusEnd(double radiusEnd)
|
|
|
+{
|
|
|
+ if(mradiusEnd.size() > 0)mradiusEnd.clear();
|
|
|
+ mradiusEnd.push_back(radiusEnd);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+* Check if the tested s-offset is inside the lane offset interval
|
|
|
+* @param A double s-offset value that has to be checked
|
|
|
+* @return Return true if the s-offset value belongs to current lane section, false otherwise
|
|
|
+*/
|
|
|
+bool Object_repeat::CheckInterval(double s_check)
|
|
|
+{
|
|
|
+ if (s_check>=ms)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+Object_parkingSpace::Object_parkingSpace()
|
|
|
+{
|
|
|
+ maccess = "all";
|
|
|
+}
|
|
|
+
|
|
|
+void Object_parkingSpace::Setaccess(std::string access)
|
|
|
+{
|
|
|
+ maccess = access;
|
|
|
+}
|
|
|
+
|
|
|
+void Object_parkingSpace::Setrestrictions(std::string restrictions)
|
|
|
+{
|
|
|
+ mrestrictions = restrictions;
|
|
|
+}
|
|
|
+
|
|
|
+string Object_parkingSpace::Getaccess()
|
|
|
+{
|
|
|
+ return maccess;
|
|
|
+}
|
|
|
+
|
|
|
+string Object_parkingSpace::Getrestrictions()
|
|
|
+{
|
|
|
+ return mrestrictions;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Copy constructor
|
|
|
+ */
|
|
|
+Object_parkingSpace::Object_parkingSpace (const Object_parkingSpace& parkingSpace)
|
|
|
+{
|
|
|
+ if(this != &parkingSpace)
|
|
|
+ {
|
|
|
+ mrestrictions = parkingSpace.mrestrictions;
|
|
|
+ maccess = parkingSpace.maccess;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Assignment operator overload
|
|
|
+ */
|
|
|
+const Object_parkingSpace& Object_parkingSpace::operator=(const Object_parkingSpace& rhs)
|
|
|
+{
|
|
|
+ if (this!= &rhs)
|
|
|
+ {
|
|
|
+ mrestrictions = rhs.mrestrictions;
|
|
|
+ maccess = rhs.maccess;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
Object::Object(std::string id, double s, double t, double zOffset)
|
|
|
{
|
|
|
mid = id;
|
|
@@ -112,6 +442,13 @@ int Object::Getradius(double &radius)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int Object::GetparkingSpace(Object_parkingSpace &parkingSpace)
|
|
|
+{
|
|
|
+ if(mObject_parkingSpace.size()<1)return 0;
|
|
|
+ parkingSpace = mObject_parkingSpace[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
void Object::Sett(double t)
|
|
|
{
|
|
|
mt = t;
|
|
@@ -204,6 +541,142 @@ void Object::Setradius(double radius)
|
|
|
mradius.push_back(radius);
|
|
|
}
|
|
|
|
|
|
+void Object::SetparkingSpace(Object_parkingSpace parkingSpace)
|
|
|
+{
|
|
|
+ if(mObject_parkingSpace.size()>0)mObject_parkingSpace.clear();
|
|
|
+ mObject_parkingSpace.push_back(parkingSpace);
|
|
|
+}
|
|
|
+
|
|
|
+vector<Object_repeat> * Object::GetObjectrepeatVector()
|
|
|
+{
|
|
|
+ return &mObject_repeat;
|
|
|
+}
|
|
|
+
|
|
|
+Object_repeat* Object::GetObjectrepeat(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mObject_repeat.size()>0)&&(i<(mObject_repeat.size())))
|
|
|
+ return &(mObject_repeat.at(i));
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Object::GetObjectrepeatCount()
|
|
|
+{
|
|
|
+ return mObject_repeat.size();
|
|
|
+}
|
|
|
+
|
|
|
+Object_repeat* Object::GetLastObjectrepeat()
|
|
|
+{
|
|
|
+ if (mObject_repeat.size()>0)
|
|
|
+ return &mObject_repeat.at(mObject_repeat.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+Object_repeat* Object::GetLastAddedObjectrepeat()
|
|
|
+{
|
|
|
+ if(mLastAddedObjectrepeat<mObject_repeat.size())
|
|
|
+ return &mObject_repeat.at(mLastAddedObjectrepeat);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Object::AddObjectrepeat(double s,double length,double distance,double tStart,double tEnd,
|
|
|
+ double heightStart,double heightEnd,double zOffsetStart,double zOffsetEnd)
|
|
|
+{
|
|
|
+ unsigned int index = CheckObjectrepeatInterval(s)+1;
|
|
|
+ if(index>=GetObjectrepeatCount()) mObject_repeat.push_back(Object_repeat(s,length,distance,tStart,tEnd,heightStart,heightEnd,zOffsetStart,zOffsetEnd));
|
|
|
+ else mObject_repeat.insert(mObject_repeat.begin()+index, Object_repeat(s,length,distance,tStart,tEnd,heightStart,heightEnd,zOffsetStart,zOffsetEnd));
|
|
|
+ mLastAddedObjectrepeat=index;
|
|
|
+ return index;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Object::CloneObjectrepeat(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<(mObject_repeat.size()-1))
|
|
|
+ mObject_repeat.insert(mObject_repeat.begin()+index+1, mObject_repeat[index]);
|
|
|
+ else if(index==mObject_repeat.size()-1)
|
|
|
+ mObject_repeat.push_back(mObject_repeat[index]);
|
|
|
+ mLastAddedObjectrepeat=index+1;
|
|
|
+ return mLastAddedObjectrepeat;
|
|
|
+}
|
|
|
+
|
|
|
+void Object::DeleteObjectrepeat(unsigned int index)
|
|
|
+{
|
|
|
+ mObject_repeat.erase(mObject_repeat.begin()+index);
|
|
|
+}
|
|
|
+
|
|
|
+int Object::CheckObjectrepeatInterval(double s_check)
|
|
|
+{
|
|
|
+ int res=-1;
|
|
|
+ //Go through all the lane section records
|
|
|
+ for (unsigned int i=0;i<mObject_repeat.size();i++)
|
|
|
+ {
|
|
|
+ //check if the s_check belongs to the current record
|
|
|
+ if (mObject_repeat.at(i).CheckInterval(s_check))
|
|
|
+ res=i; //assign it to the result id
|
|
|
+ else
|
|
|
+ break; //if not, break;
|
|
|
+ }
|
|
|
+ return res; //return the result: 0 to MaxInt as the index to the record containing s_check or -1 if nothing found
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+vector<Object_material> * Object::GetObjectmaterialVector()
|
|
|
+{
|
|
|
+ return &mObject_material;
|
|
|
+}
|
|
|
+
|
|
|
+Object_material* Object::GetObjectmaterial(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mObject_material.size()>0)&&(i<(mObject_material.size())))
|
|
|
+ return &(mObject_material.at(i));
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+unsigned int Object::GetObjectmaterialCount()
|
|
|
+{
|
|
|
+ return mObject_material.size();
|
|
|
+}
|
|
|
+
|
|
|
+Object_material* Object::GetLastObjectmaterial()
|
|
|
+{
|
|
|
+ if (mObject_material.size()>0)
|
|
|
+ return &mObject_material.at(mObject_material.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+Object_material* Object::GetLastAddedObjectmaterial()
|
|
|
+{
|
|
|
+ if(mLastAddedObjectmaterial<mObject_material.size())
|
|
|
+ return &mObject_material.at(mLastAddedObjectmaterial);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Object::AddObjectmaterial()
|
|
|
+{
|
|
|
+ mObject_material.push_back(Object_material());
|
|
|
+ mLastAddedObjectmaterial = mObject_material.size()-1;
|
|
|
+ return mLastAddedObjectmaterial;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Object::CloneObjectmaterial(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<(mObject_material.size()-1))
|
|
|
+ mObject_material.insert(mObject_material.begin()+index+1, mObject_material[index]);
|
|
|
+ else if(index==mObject_material.size()-1)
|
|
|
+ mObject_material.push_back(mObject_material[index]);
|
|
|
+ mLastAddedObjectmaterial=index+1;
|
|
|
+ return mLastAddedObjectmaterial;
|
|
|
+}
|
|
|
+
|
|
|
+void Object::DeleteObjectmaterial(unsigned int index)
|
|
|
+{
|
|
|
+ mObject_material.erase(mObject_material.begin()+index);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
signal_positionRoad::signal_positionRoad(double s, double t, double zOffset, double hOffset, double pitch, double roll)
|
|
|
{
|