|
@@ -322,11 +322,50 @@ Objects_bridge* Road::GetObjectsBridge(unsigned int i)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
unsigned int Road::GetObjectsBridgeCount()
|
|
|
{
|
|
|
return static_cast<unsigned int>(mObjectsBridgeVector.size()) ;
|
|
|
}
|
|
|
|
|
|
+//Road Tunnel records
|
|
|
+vector<Objects_tunnel> *Road::GetObjectsTunnelVector()
|
|
|
+{
|
|
|
+ return &mObjectsTunnelVector;
|
|
|
+}
|
|
|
+
|
|
|
+Objects_tunnel* Road::GetObjectsTunnel(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mObjectsTunnelVector.size()>0)&&(i<mObjectsTunnelVector.size()))
|
|
|
+ return &mObjectsTunnelVector.at(i);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Road::GetObjectsTunnelCount()
|
|
|
+{
|
|
|
+ return static_cast<unsigned int>(mObjectsTunnelVector.size()) ;
|
|
|
+}
|
|
|
+
|
|
|
+// Road objectReference records
|
|
|
+vector<Objects_objectReference> *Road::GetObjectsObjectReferenceVector()
|
|
|
+{
|
|
|
+ return &mObjectsObjectReferenceVector;
|
|
|
+}
|
|
|
+
|
|
|
+Objects_objectReference* Road::GetObjectsObjectReference(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mObjectsObjectReferenceVector.size()>0)&&(i<mObjectsObjectReferenceVector.size()))
|
|
|
+ return &mObjectsObjectReferenceVector.at(i);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Road::GetObjectsObjectReferenceCount()
|
|
|
+{
|
|
|
+ return static_cast<unsigned int>(mObjectsObjectReferenceVector.size()) ;
|
|
|
+}
|
|
|
+
|
|
|
// Road object records
|
|
|
vector<Object> *Road::GetObjectVector()
|
|
|
{
|
|
@@ -452,6 +491,20 @@ Objects_bridge* Road::GetLastObjectsBridge()
|
|
|
else
|
|
|
return NULL;
|
|
|
}
|
|
|
+Objects_objectReference* Road::GetLastObjectsObjectReference()
|
|
|
+{
|
|
|
+ if (mObjectsObjectReferenceVector.size()>0)
|
|
|
+ return &mObjectsObjectReferenceVector.at(mObjectsObjectReferenceVector.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+Objects_tunnel* Road::GetLastObjectsTunnel()
|
|
|
+{
|
|
|
+ if (mObjectsTunnelVector.size()>0)
|
|
|
+ return &mObjectsTunnelVector.at(mObjectsTunnelVector.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
Object* Road::GetLastObject()
|
|
|
{
|
|
|
if (mObjectsVector.size()>0)
|
|
@@ -535,6 +588,20 @@ Objects_bridge* Road::GetLastAddedObjectsBridge()
|
|
|
else
|
|
|
return NULL;
|
|
|
}
|
|
|
+Objects_tunnel* Road::GetLastAddedObjectsTunnel()
|
|
|
+{
|
|
|
+ if(mLastAddedObjectsTunnel<mObjectsTunnelVector.size())
|
|
|
+ return &mObjectsTunnelVector.at(mLastAddedObjectsTunnel);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+Objects_objectReference* Road::GetLastAddedObjectsObjectReference()
|
|
|
+{
|
|
|
+ if(mLastAddedObject<mObjectsObjectReferenceVector.size())
|
|
|
+ return &mObjectsObjectReferenceVector.at(mLastAddedObject);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
Object* Road::GetLastAddedObject()
|
|
|
{
|
|
|
if(mLastAddedObject<mObjectsVector.size())
|
|
@@ -762,6 +829,24 @@ unsigned int Road::AddRoadNoavoid(double s, double length)
|
|
|
return index;
|
|
|
}
|
|
|
//-------------
|
|
|
+unsigned int Road::AddObjectsTunnel(double s,double length,string id,string type)
|
|
|
+{
|
|
|
+ unsigned int index = static_cast<unsigned int>(CheckRoadObjectsTunnelInterval(s)+1) ;
|
|
|
+ if(index>=GetObjectsTunnelCount()) mObjectsTunnelVector.push_back(Objects_tunnel(s,length,id,type));
|
|
|
+ else mObjectsTunnelVector.insert(mObjectsTunnelVector.begin()+index, Objects_tunnel(s,length,id,type));
|
|
|
+ mLastAddedObjectsTunnel=index;
|
|
|
+ return index;
|
|
|
+}
|
|
|
+//-------------
|
|
|
+unsigned int Road::AddObjectsObjectReference(double s,double t,string id,string orientation)
|
|
|
+{
|
|
|
+ unsigned int index = static_cast<unsigned int>(CheckRoadObjectsTunnelInterval(s)+1) ;
|
|
|
+ if(index>=GetObjectsObjectReferenceCount()) mObjectsObjectReferenceVector.push_back(Objects_objectReference(s,t,id,orientation));
|
|
|
+ else mObjectsObjectReferenceVector.insert(mObjectsObjectReferenceVector.begin()+index, Objects_objectReference(s,t,id,orientation));
|
|
|
+ mLastAddedObjectsObjectReference=index;
|
|
|
+ return index;
|
|
|
+}
|
|
|
+//-------------
|
|
|
unsigned int Road::AddObjectsBridge(double s,double length,string id,string type)
|
|
|
{
|
|
|
unsigned int index = static_cast<unsigned int>(CheckRoadObjectsBridgeInterval(s)+1) ;
|
|
@@ -950,7 +1035,6 @@ unsigned int Road::CloneLaneSectionEnd(unsigned int index)
|
|
|
}
|
|
|
unsigned int Road::CloneObjectsBridge(unsigned int index)
|
|
|
{
|
|
|
-
|
|
|
if(index<mObjectsBridgeVector.size()-1)
|
|
|
mObjectsBridgeVector.insert(mObjectsBridgeVector.begin()+index+1, mObjectsBridgeVector[index]);
|
|
|
else if(index==mObjectsBridgeVector.size()-1)
|
|
@@ -958,6 +1042,24 @@ unsigned int Road::CloneObjectsBridge(unsigned int index)
|
|
|
mLastAddedObjectsBridge=index+1;
|
|
|
return mLastAddedObjectsBridge;
|
|
|
}
|
|
|
+unsigned int Road::CloneObjectsTunnel(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<mObjectsTunnelVector.size()-1)
|
|
|
+ mObjectsTunnelVector.insert(mObjectsTunnelVector.begin()+index+1, mObjectsTunnelVector[index]);
|
|
|
+ else if(index==mObjectsTunnelVector.size()-1)
|
|
|
+ mObjectsTunnelVector.push_back(mObjectsTunnelVector[index]);
|
|
|
+ mLastAddedObjectsTunnel=index+1;
|
|
|
+ return mLastAddedObjectsTunnel;
|
|
|
+}
|
|
|
+unsigned int Road::CloneObjectsObjectReference(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<mObjectsObjectReferenceVector.size()-1)
|
|
|
+ mObjectsObjectReferenceVector.insert(mObjectsObjectReferenceVector.begin()+index+1, mObjectsObjectReferenceVector[index]);
|
|
|
+ else if(index==mObjectsObjectReferenceVector.size()-1)
|
|
|
+ mObjectsObjectReferenceVector.push_back(mObjectsObjectReferenceVector[index]);
|
|
|
+ mLastAddedObjectsObjectReference=index+1;
|
|
|
+ return mLastAddedObjectsObjectReference;
|
|
|
+}
|
|
|
unsigned int Road::CloneObject(unsigned int index)
|
|
|
{
|
|
|
// Check the first method in the group for details
|
|
@@ -1038,6 +1140,14 @@ void Road::DeleteObjectsBridge(unsigned int index)
|
|
|
{
|
|
|
mObjectsBridgeVector.erase(mObjectsBridgeVector.begin()+index);
|
|
|
}
|
|
|
+void Road::DeleteObjectsTunnel(unsigned int index)
|
|
|
+{
|
|
|
+ mObjectsTunnelVector.erase(mObjectsTunnelVector.begin()+index);
|
|
|
+}
|
|
|
+void Road::DeleteObjectsObjectReference(unsigned int index)
|
|
|
+{
|
|
|
+ mObjectsObjectReferenceVector.erase(mObjectsObjectReferenceVector.begin()+index);
|
|
|
+}
|
|
|
void Road::DeleteObject(unsigned int index)
|
|
|
{
|
|
|
mObjectsVector.erase(mObjectsVector.begin()+index);
|
|
@@ -1418,7 +1528,7 @@ int Road::CheckRoadNoavoidInterval(double s_check)
|
|
|
int Road::CheckRoadObjectsBridgeInterval(double s_check)
|
|
|
{
|
|
|
int res=-1;
|
|
|
- //Go through all the lane section records
|
|
|
+ //Go through all the bridge records
|
|
|
for (unsigned int i=0;i<mObjectsBridgeVector.size();i++)
|
|
|
{
|
|
|
//check if the s_check belongs to the current record
|
|
@@ -1431,6 +1541,37 @@ int Road::CheckRoadObjectsBridgeInterval(double s_check)
|
|
|
|
|
|
}
|
|
|
//-----------
|
|
|
+int Road::CheckRoadObjectsTunnelInterval(double s_check)
|
|
|
+{
|
|
|
+ int res=-1;
|
|
|
+ //Go through all the tunnel records
|
|
|
+ for (unsigned int i=0;i<mObjectsTunnelVector.size();i++)
|
|
|
+ {
|
|
|
+ //check if the s_check belongs to the current record
|
|
|
+ if (mObjectsTunnelVector.at(i).CheckInterval(s_check))
|
|
|
+ res=static_cast<int>(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 Road::CheckRoadObjectsObjectReferenceInterval(double s_check)
|
|
|
+{
|
|
|
+ int res=-1;
|
|
|
+ //Go through all the tunnel records
|
|
|
+ for (unsigned int i=0;i<mObjectsObjectReferenceVector.size();i++)
|
|
|
+ {
|
|
|
+ //check if the s_check belongs to the current record
|
|
|
+ if (mObjectsObjectReferenceVector.at(i).CheckInterval(s_check))
|
|
|
+ res=static_cast<int>(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 Road::CheckLaneOffsetInterval(double s_check)
|
|
|
{
|
|
|
int res=-1;
|