|
@@ -428,7 +428,23 @@ LaneSection::~LaneSection()
|
|
|
mLaneVector.clear();
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * @brief LaneSection::SetSingleSide
|
|
|
+ * @param singleSide
|
|
|
+ */
|
|
|
+void LaneSection::SetSingleSide(std::string singleSide)
|
|
|
+{
|
|
|
+ msingleSide = singleSide;
|
|
|
+}
|
|
|
|
|
|
+/**
|
|
|
+ * @brief LaneSection::GetSingleSide
|
|
|
+ * @return singleSide
|
|
|
+ */
|
|
|
+string LaneSection::GetSingleSide()
|
|
|
+{
|
|
|
+ return msingleSide;
|
|
|
+}
|
|
|
/**
|
|
|
* Lane Section Sample. Holds all the lane information at a certain S value including lane widths, levels,
|
|
|
* heights, etc
|
|
@@ -615,6 +631,28 @@ void Lane::RemoveSuccessor()
|
|
|
{ mSuccessor=0; mSuccessorExists=false; }
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * @brief Lane::AddBorderRecord Add Border Record
|
|
|
+ * @param s
|
|
|
+ * @param a
|
|
|
+ * @param b
|
|
|
+ * @param c
|
|
|
+ * @param d
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+unsigned int Lane::AddBorderRecord(double s, double a, double b, double c, double d)
|
|
|
+{
|
|
|
+ // Gets the index where the record should be inserted in the vector
|
|
|
+ unsigned int index = CheckBorderInterval(s)+1;
|
|
|
+ // If larger than the record count - push to the back
|
|
|
+ if(index>=GetLaneBorderCount()) mLaneBorder.push_back(LaneBorder(s,a,b,c,d));
|
|
|
+ // else insert in the middle
|
|
|
+ else mLaneBorder.insert(mLaneBorder.begin()+index, LaneBorder(s,a,b,c,d));
|
|
|
+ // Save the last added record index
|
|
|
+ mLastAddedLaneBorder=index;
|
|
|
+ return index;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Methods used to add child records to the respective vectors
|
|
|
*/
|
|
@@ -697,6 +735,24 @@ unsigned int Lane::AddHeightRecord(double sOffset, double inner, double outer)
|
|
|
return index;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * @brief Lane::CloneLaneBorder
|
|
|
+ * @param index
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+unsigned int Lane::CloneLaneBorder(unsigned int index)
|
|
|
+{
|
|
|
+ // Clone the object and insert it in the middle of the vector
|
|
|
+ if(index<mLaneBorder.size()-1)
|
|
|
+ mLaneBorder.insert(mLaneBorder.begin()+index+1, mLaneBorder[index]);
|
|
|
+ // or just push it to the back
|
|
|
+ else if(index==mLaneBorder.size()-1)
|
|
|
+ mLaneBorder.push_back(mLaneBorder[index]);
|
|
|
+ // Save the last added record index
|
|
|
+ mLastAddedLaneBorder=index+1;
|
|
|
+ return mLastAddedLaneBorder;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Methods used to clone child records in the respective vectors
|
|
|
*/
|
|
@@ -779,9 +835,16 @@ unsigned int Lane::CloneLaneHeight(unsigned int index)
|
|
|
return mLastAddedLaneHeight;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* Methods used to delete child records from the respective vectors
|
|
|
*/
|
|
|
+
|
|
|
+void Lane::DeleteLaneBoder(unsigned int index)
|
|
|
+{
|
|
|
+ mLaneBorder.erase(mLaneBorder.begin()+index);
|
|
|
+}
|
|
|
void Lane::DeleteLaneWidth(unsigned int index)
|
|
|
{
|
|
|
mLaneWidth.erase(mLaneWidth.begin()+index);
|
|
@@ -856,6 +919,9 @@ int Lane::GetSuccessor()
|
|
|
/**
|
|
|
* Get pointers to the records vectors
|
|
|
*/
|
|
|
+vector <LaneBorder> *Lane::GetLaneBorderVector()
|
|
|
+{ return &mLaneBorder; }
|
|
|
+
|
|
|
vector <LaneWidth> *Lane::GetLaneWidthVector()
|
|
|
{ return &mLaneWidth; }
|
|
|
|
|
@@ -881,6 +947,9 @@ vector <LaneHeight> *Lane::GetLaneHeightVector()
|
|
|
/**
|
|
|
* Get the number of elements in a certain vector
|
|
|
*/
|
|
|
+unsigned int Lane::GetLaneBorderCount()
|
|
|
+{ return mLaneBorder.size(); }
|
|
|
+
|
|
|
unsigned int Lane::GetLaneWidthCount()
|
|
|
{ return mLaneWidth.size(); }
|
|
|
|
|
@@ -905,6 +974,14 @@ unsigned int Lane::GetLaneHeightCount()
|
|
|
/**
|
|
|
* Get the elements of a certain vectors at position i
|
|
|
*/
|
|
|
+LaneBorder* Lane::GetLaneBorder(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mLaneBorder.size()>0)&&(i<mLaneBorder.size()))
|
|
|
+ return &mLaneBorder.at(i);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
LaneWidth* Lane::GetLaneWidth(unsigned int i)
|
|
|
{
|
|
|
if ((mLaneWidth.size()>0)&&(i<mLaneWidth.size()))
|
|
@@ -965,6 +1042,13 @@ LaneHeight* Lane::GetLaneHeight(unsigned int i)
|
|
|
/**
|
|
|
* Get the last elements of a certain vectors
|
|
|
*/
|
|
|
+LaneBorder* Lane::GetLastLaneBorder()
|
|
|
+{
|
|
|
+ if (mLaneBorder.size()>0)
|
|
|
+ return &mLaneBorder.at(mLaneBorder.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
LaneWidth* Lane::GetLastLaneWidth()
|
|
|
{
|
|
|
if (mLaneWidth.size()>0)
|
|
@@ -1018,6 +1102,13 @@ LaneHeight* Lane::GetLastLaneHeight()
|
|
|
/**
|
|
|
* Get the last added elements of a certain vectors (their position might not be at the end of the vector)
|
|
|
*/
|
|
|
+LaneBorder* Lane::GetLastAddedLaneBorder()
|
|
|
+{
|
|
|
+ if(mLastAddedLaneBorder<mLaneBorder.size())
|
|
|
+ return &mLaneBorder.at(mLastAddedLaneBorder);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
LaneWidth* Lane::GetLastAddedLaneWidth()
|
|
|
{
|
|
|
if(mLastAddedLaneWidth<mLaneWidth.size())
|
|
@@ -1071,6 +1162,21 @@ LaneHeight* Lane::GetLastAddedLaneHeight()
|
|
|
/**
|
|
|
* Check the intervals and return the index of the records that applies to the provided s-offset
|
|
|
*/
|
|
|
+int Lane::CheckBorderInterval(double s_check)
|
|
|
+{
|
|
|
+
|
|
|
+ int res=-1;
|
|
|
+ //Go through all the width records
|
|
|
+ for (unsigned int i=0;i<mLaneBorder.size();i++)
|
|
|
+ {
|
|
|
+ //check if the s_check belongs to the current record
|
|
|
+ if (s_check >= mLaneBorder.at(i).GetS())
|
|
|
+ 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
|
|
|
+}
|
|
|
int Lane::CheckWidthInterval(double s_check)
|
|
|
{
|
|
|
|
|
@@ -1174,6 +1280,18 @@ int Lane::CheckHeightInterval(double s_check)
|
|
|
/**
|
|
|
* Evaluate the record and return the width value
|
|
|
*/
|
|
|
+
|
|
|
+double Lane::GetBorderValue(double s_check)
|
|
|
+{
|
|
|
+ double retVal=0;
|
|
|
+ //find the record where s_check belongs
|
|
|
+ int index=CheckBorderInterval(s_check);
|
|
|
+ //If found, return the type
|
|
|
+ if (index>=0)
|
|
|
+ retVal= mLaneBorder.at(index).GetValue(s_check);
|
|
|
+ return retVal;
|
|
|
+}
|
|
|
+
|
|
|
double Lane::GetWidthValue(double s_check)
|
|
|
{
|
|
|
double retVal=0;
|
|
@@ -1203,6 +1321,16 @@ LaneHeight Lane::GetHeightValue(double s_check)
|
|
|
}
|
|
|
|
|
|
|
|
|
+void Lane::SetuserData(std::string struserData)
|
|
|
+{
|
|
|
+ muserData = struserData;
|
|
|
+}
|
|
|
+
|
|
|
+void Lane::GetuserData(std::string &struserData)
|
|
|
+{
|
|
|
+ struserData = muserData;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Evaluate the road marks records and return the road mark object corresponding to the provided s-offset
|
|
|
*/
|
|
@@ -1252,8 +1380,23 @@ Lane::~Lane()
|
|
|
|
|
|
// DELETING LANE HEIGHTS
|
|
|
mLaneHeight.clear();
|
|
|
+
|
|
|
+ //DELETE LANE BORDERS
|
|
|
+ mLaneBorder.clear();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief LaneWidth::LaneWidth
|
|
|
+ * @param s
|
|
|
+ * @param a
|
|
|
+ * @param b
|
|
|
+ * @param c
|
|
|
+ * @param d
|
|
|
+ */
|
|
|
+LaneBorder::LaneBorder(double s, double a, double b, double c, double d):ThirdOrderPolynom(s,a,b,c,d)
|
|
|
+{}
|
|
|
+
|
|
|
/**
|
|
|
* Lane width class. Holds all the data that describes a lane width
|
|
|
*
|