|
@@ -455,6 +455,24 @@ unsigned int Road::GetRoadNoavoidCount()
|
|
|
return mRoadNoavoidVector.size();
|
|
|
}
|
|
|
//-------------------------------------------------
|
|
|
+vector<surface> *Road::GetSurfaceVector()
|
|
|
+{
|
|
|
+ return &mSurfaceVector;
|
|
|
+}
|
|
|
+
|
|
|
+surface* Road::GetSurface(unsigned int i)
|
|
|
+{
|
|
|
+ if((mSurfaceVector.size()>0)&&(i<mSurfaceVector.size()))
|
|
|
+ return &mSurfaceVector.at(i);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int Road::GetSurfaceCount()
|
|
|
+{
|
|
|
+ return static_cast<unsigned int>(mSurfaceVector.size());
|
|
|
+}
|
|
|
+//-------------------------------------------------
|
|
|
|
|
|
/**
|
|
|
* Getters for the last child records in their respective vectors
|
|
@@ -563,6 +581,14 @@ RoadNoavoid* Road::GetLastRoadNoavoid()
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+surface * Road::GetLastSurface()
|
|
|
+{
|
|
|
+ if(mSurfaceVector.size()>0)
|
|
|
+ return &mSurfaceVector.at(mSurfaceVector.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* Getters for the last added child records in their respective vectors
|
|
@@ -669,6 +695,13 @@ RoadNoavoid* Road::GetLastAddedRoadNoavoid()
|
|
|
else
|
|
|
return NULL;
|
|
|
}
|
|
|
+surface* Road::GetLastAddedSurface()
|
|
|
+{
|
|
|
+ if(mLastAddedSurface<mSurfaceVector.size())
|
|
|
+ return &mSurfaceVector.at(mLastAddedSurface);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
//-------------------------------------------------
|
|
|
|
|
|
/**
|
|
@@ -867,6 +900,14 @@ unsigned int Road::AddRoadNoavoid(double s, double length)
|
|
|
mLastAddedRoadNoavoid=index;
|
|
|
return index;
|
|
|
}
|
|
|
+
|
|
|
+unsigned int Road::AddSurface()
|
|
|
+{
|
|
|
+ mSurfaceVector.push_back(surface());
|
|
|
+ mLastAddedSurface = static_cast<unsigned int >( mSurfaceVector.size()-1);
|
|
|
+ return mLastAddedSurface;
|
|
|
+}
|
|
|
+
|
|
|
//-------------
|
|
|
unsigned int Road::AddObjectsTunnel(double s,double length,string id,string type)
|
|
|
{
|
|
@@ -1160,6 +1201,16 @@ unsigned int Road::CloneRoadNoavoid(unsigned int index)
|
|
|
return mLastAddedRoadNoavoid;
|
|
|
}
|
|
|
|
|
|
+unsigned int Road::CloneSurface(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<mSurfaceVector.size()-1)
|
|
|
+ mSurfaceVector.insert(mSurfaceVector.begin()+index+1, mSurfaceVector[index]);
|
|
|
+ else if(index==mSurfaceVector.size()-1)
|
|
|
+ mSurfaceVector.push_back(mSurfaceVector[index]);
|
|
|
+ mLastAddedSurface=index+1;
|
|
|
+ return mLastAddedSurface;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* Methods used to delete child records from the respective vectors
|
|
@@ -1229,6 +1280,11 @@ void Road::DeleteRoadNoavoid(unsigned int index)
|
|
|
mRoadNoavoidVector.erase(mRoadNoavoidVector.begin()+index);
|
|
|
}
|
|
|
|
|
|
+void Road::DeleteSurface(unsigned int index)
|
|
|
+{
|
|
|
+ mSurfaceVector.erase(mSurfaceVector.begin()+index);
|
|
|
+}
|
|
|
+
|
|
|
//-------------------------------------------------
|
|
|
// EVALUATION METHODS
|
|
|
|
|
@@ -2005,3 +2061,268 @@ void Crossfall::SetSide(string side)
|
|
|
mSide=side;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//***********************************************************************************
|
|
|
+//Surface Record
|
|
|
+//***********************************************************************************
|
|
|
+
|
|
|
+surface_CRG::surface_CRG(std::string file,double sStart,double sEnd,std::string orientation,std::string mode)
|
|
|
+{
|
|
|
+ mfile = file;
|
|
|
+ msStart = sStart;
|
|
|
+ msEnd = sEnd;
|
|
|
+ morientation = orientation;
|
|
|
+ mmode = mode;
|
|
|
+}
|
|
|
+
|
|
|
+std::string surface_CRG::Getfile()
|
|
|
+{
|
|
|
+ return mfile;
|
|
|
+}
|
|
|
+
|
|
|
+double surface_CRG::GetsStart()
|
|
|
+{
|
|
|
+ return msStart;
|
|
|
+}
|
|
|
+
|
|
|
+double surface_CRG::GetsEnd()
|
|
|
+{
|
|
|
+ return msEnd;
|
|
|
+}
|
|
|
+
|
|
|
+std::string surface_CRG::Getorientation()
|
|
|
+{
|
|
|
+ return morientation;
|
|
|
+}
|
|
|
+
|
|
|
+std::string surface_CRG::Getmode()
|
|
|
+{
|
|
|
+ return mmode;
|
|
|
+}
|
|
|
+
|
|
|
+int surface_CRG::Getpurpose(std::string & purpose)
|
|
|
+{
|
|
|
+ if(mpurpose.size() == 0)return 0;
|
|
|
+ purpose = mpurpose[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int surface_CRG::GetsOffset(double & sOffset)
|
|
|
+{
|
|
|
+ if(msOffset.size() == 0)return 0;
|
|
|
+ sOffset = msOffset[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int surface_CRG::GettOffset(double & tOffset)
|
|
|
+{
|
|
|
+ if(mtOffset.size() == 0)return 0;
|
|
|
+ tOffset = mtOffset[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int surface_CRG::GetzOffset(double & zOffset)
|
|
|
+{
|
|
|
+ if(mzOffset.size() == 0)return 0;
|
|
|
+ zOffset = mzOffset[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int surface_CRG::GetzScale(double & zScale)
|
|
|
+{
|
|
|
+ if(mzScale.size() == 0)return 0;
|
|
|
+ zScale = mzScale[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int surface_CRG::GethOffset(double & hOffset)
|
|
|
+{
|
|
|
+ if(mhOffset.size() == 0)return 0;
|
|
|
+ hOffset = mhOffset[0];
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::Setfile(std::string file)
|
|
|
+{
|
|
|
+ mfile = file;
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SetsStart(double sStart)
|
|
|
+{
|
|
|
+ msStart = sStart;
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SetsEnd(double sEnd)
|
|
|
+{
|
|
|
+ msEnd = sEnd;
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::Setorientation(std::string orientation)
|
|
|
+{
|
|
|
+ morientation = orientation;
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::Setmode(std::string mode)
|
|
|
+{
|
|
|
+ mmode = mode;
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::Setpurpose(std::string purpose)
|
|
|
+{
|
|
|
+ if(mpurpose.size() > 0)mpurpose.clear();
|
|
|
+ mpurpose.push_back(purpose);
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SetsOffset(double sOffset)
|
|
|
+{
|
|
|
+ if(msOffset.size()>0)msOffset.clear();
|
|
|
+ msOffset.push_back(sOffset);
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SettOffset(double tOffset)
|
|
|
+{
|
|
|
+ if(mtOffset.size()>0)mtOffset.clear();
|
|
|
+ mtOffset.push_back(tOffset);
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SetzOffset(double zOffset)
|
|
|
+{
|
|
|
+ if(mzOffset.size()>0)mzOffset.clear();
|
|
|
+ mzOffset.push_back(zOffset);
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SetzScale(double zScale)
|
|
|
+{
|
|
|
+ if(mzScale.size()>0)mzScale.clear();
|
|
|
+ mzScale.push_back(zScale);
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::SethOffset(double hOffset)
|
|
|
+{
|
|
|
+ if(mhOffset.size()>0)mhOffset.clear();
|
|
|
+ mhOffset.push_back(hOffset);
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::Resetpurpose()
|
|
|
+{
|
|
|
+ if(mpurpose.size()>0)mpurpose.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::ResetsOffset()
|
|
|
+{
|
|
|
+ if(msOffset.size()>0)msOffset.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::ResettOffset()
|
|
|
+{
|
|
|
+ if(mtOffset.size()>0)mtOffset.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::ResetzOffset()
|
|
|
+{
|
|
|
+ if(mzOffset.size()>0)mzOffset.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::ResetzScale()
|
|
|
+{
|
|
|
+ if(mzScale.size()>0)mzScale.clear();
|
|
|
+}
|
|
|
+
|
|
|
+void surface_CRG::ResethOffset()
|
|
|
+{
|
|
|
+ if(mhOffset.size()>0)mhOffset.clear();
|
|
|
+}
|
|
|
+
|
|
|
+bool surface_CRG::CheckInterval(double s_check)
|
|
|
+{
|
|
|
+ if (s_check>=msStart)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+surface::surface()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+vector<surface_CRG> * surface::GetCRGVector()
|
|
|
+{
|
|
|
+ return &mCRG;
|
|
|
+}
|
|
|
+
|
|
|
+surface_CRG* surface::GetCRG(unsigned int i)
|
|
|
+{
|
|
|
+ if ((mCRG.size()>0)&&(i<(mCRG.size())))
|
|
|
+ return &(mCRG.at(i));
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int surface::GetCRGCount()
|
|
|
+{
|
|
|
+ return static_cast<unsigned int >(mCRG.size()) ;
|
|
|
+}
|
|
|
+
|
|
|
+surface_CRG* surface::GetLastCRG()
|
|
|
+{
|
|
|
+ if (mCRG.size()>0)
|
|
|
+ return &mCRG.at(mCRG.size()-1);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+surface_CRG* surface::GetLastAddedCRG()
|
|
|
+{
|
|
|
+ if(mLastAddedCRG<mCRG.size())
|
|
|
+ return &mCRG.at(mLastAddedCRG);
|
|
|
+ else
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int surface::AddCRG(std::string file,double sStart,double sEnd,std::string orientation,std::string mode)
|
|
|
+{
|
|
|
+
|
|
|
+ // Check the first method in the group for details
|
|
|
+
|
|
|
+ unsigned int index = static_cast<unsigned int>(CheckCRGInterval(sStart)+1) ;
|
|
|
+ if(index>=GetCRGCount()) mCRG.push_back(surface_CRG(file,sStart,sEnd,orientation,mode));
|
|
|
+ else mCRG.insert(mCRG.begin()+index, surface_CRG(file,sStart,sEnd,orientation,mode));
|
|
|
+ mLastAddedCRG=index;
|
|
|
+ return index;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned int surface::CloneCRG(unsigned int index)
|
|
|
+{
|
|
|
+ if(index<(mCRG.size()-1))
|
|
|
+ mCRG.insert(mCRG.begin()+index+1, mCRG[index]);
|
|
|
+ else if(index==mCRG.size()-1)
|
|
|
+ mCRG.push_back(mCRG[index]);
|
|
|
+ mLastAddedCRG=index+1;
|
|
|
+ return mLastAddedCRG;
|
|
|
+}
|
|
|
+
|
|
|
+void surface::DeleteCRG(unsigned int index)
|
|
|
+{
|
|
|
+ mCRG.erase(mCRG.begin()+index);
|
|
|
+}
|
|
|
+
|
|
|
+int surface::CheckCRGInterval(double s_check)
|
|
|
+{
|
|
|
+ int res=-1;
|
|
|
+ //Go through all the tunnel records
|
|
|
+ for (unsigned int i=0;i<mCRG.size();i++)
|
|
|
+ {
|
|
|
+ //check if the s_check belongs to the current record
|
|
|
+ if (mCRG.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
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|