|
@@ -2,6 +2,173 @@
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
+Objects_tunnel::Objects_tunnel(double s,double length,std::string strid,std::string strtype)
|
|
|
+{
|
|
|
+ mS = s;
|
|
|
+ mlength = length;
|
|
|
+ mstrid = strid;
|
|
|
+ mstrtype = strtype;
|
|
|
+}
|
|
|
+
|
|
|
+double Objects_tunnel::GetS()
|
|
|
+{
|
|
|
+ return mS;
|
|
|
+}
|
|
|
+
|
|
|
+double Objects_tunnel::Getlength()
|
|
|
+{
|
|
|
+ return mlength;
|
|
|
+}
|
|
|
+
|
|
|
+int Objects_tunnel::GetName(std::string name)
|
|
|
+{
|
|
|
+ if(mname.size() == 0)return 0;
|
|
|
+ name = mname[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+std::string Objects_tunnel::Getid()
|
|
|
+{
|
|
|
+ return mstrid;
|
|
|
+}
|
|
|
+
|
|
|
+std::string Objects_tunnel::Gettype()
|
|
|
+{
|
|
|
+ return mstrtype;
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::SetS(double s)
|
|
|
+{
|
|
|
+ mS = s;
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Setlength(double length)
|
|
|
+{
|
|
|
+ mlength = length;
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Setname(std::string name)
|
|
|
+{
|
|
|
+ if(mname.size() == 0)mname.clear();
|
|
|
+ mname.push_back(name);
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Resetname()
|
|
|
+{
|
|
|
+ if(mname.size() == 0)mname.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Setid(std::string id)
|
|
|
+{
|
|
|
+ mstrid = id;
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Settype(std::string type)
|
|
|
+{
|
|
|
+ mstrtype = type;
|
|
|
+}
|
|
|
+
|
|
|
+int Objects_tunnel::Getlighting(int & lighting)
|
|
|
+{
|
|
|
+ if(mvectorlighting.size() == 0)return 0;
|
|
|
+ lighting = mvectorlighting[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int Objects_tunnel::Getdaylight(int & daylight)
|
|
|
+{
|
|
|
+ if(mvectordaylight.size() == 0)return 0;
|
|
|
+ daylight = mvectordaylight[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Setlighting(int lighting)
|
|
|
+{
|
|
|
+ if(mvectorlighting.size() > 0)mvectorlighting.clear();
|
|
|
+ mvectorlighting.push_back(lighting);
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Setdaylight(int daylight)
|
|
|
+{
|
|
|
+ if(mvectordaylight.size() > 0)mvectordaylight.clear();
|
|
|
+ mvectordaylight.push_back(daylight);
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Resetlighting()
|
|
|
+{
|
|
|
+ if(mvectorlighting.size() > 0)mvectorlighting.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void Objects_tunnel::Resetdaylight()
|
|
|
+{
|
|
|
+ if(mvectordaylight.size() > 0)mvectordaylight.clear();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+vector<Object_laneValidity> * Objects_tunnel::GetObjectlaneValidityVector()
|
|
|
+{
|
|
|
+ return &mObject_laneValidity;
|
|
|
+}
|
|
|
+
|
|
|
+Object_laneValidity* Objects_tunnel::GetObjectlaneValidity(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mObject_laneValidity.size()>0)&&(i<(mObject_laneValidity.size())))
|
|
|
+ return &(mObject_laneValidity.at(i));
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Objects_tunnel::GetObjectlaneValidityCount()
|
|
|
+{
|
|
|
+ return static_cast<unsigned int>(mObject_laneValidity.size());
|
|
|
+}
|
|
|
+
|
|
|
+Object_laneValidity* Objects_tunnel::GetLastObjectlaneValidity()
|
|
|
+{
|
|
|
+ if (mObject_laneValidity.size()>0)
|
|
|
+ return &mObject_laneValidity.at(mObject_laneValidity.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+Object_laneValidity* Objects_tunnel::GetLastAddedObjectlaneValidity()
|
|
|
+{
|
|
|
+ if(mLastAddedObjectlaneValidity<mObject_laneValidity.size())
|
|
|
+ return &mObject_laneValidity.at(mLastAddedObjectlaneValidity);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Objects_tunnel::AddObjectlaneValidity(int fromLane, int toLane)
|
|
|
+{
|
|
|
+ mObject_laneValidity.push_back(Object_laneValidity(fromLane,toLane));
|
|
|
+ mLastAddedObjectlaneValidity = static_cast<unsigned int>(mObject_laneValidity.size()-1) ;
|
|
|
+ return mLastAddedObjectlaneValidity;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Objects_tunnel::CloneObjectlaneValidity(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<(mObject_laneValidity.size()-1))
|
|
|
+ mObject_laneValidity.insert(mObject_laneValidity.begin()+index+1, mObject_laneValidity[index]);
|
|
|
+ else if(index==mObject_laneValidity.size()-1)
|
|
|
+ mObject_laneValidity.push_back(mObject_laneValidity[index]);
|
|
|
+ mLastAddedObjectlaneValidity=index+1;
|
|
|
+ return mLastAddedObjectlaneValidity;
|
|
|
+}
|
|
|
+void Objects_tunnel::DeleteObjectlaneValidity(unsigned int index)
|
|
|
+{
|
|
|
+ mObject_laneValidity.erase(mObject_laneValidity.begin()+index);
|
|
|
+}
|
|
|
+
|
|
|
+bool Objects_tunnel::CheckInterval(double s_check)
|
|
|
+{
|
|
|
+ if (s_check>=mS)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
Objects_bridge::Objects_bridge(double s,double length,std::string strid,std::string strtype)
|
|
|
{
|
|
|
mS = s;
|