|
@@ -521,6 +521,22 @@ void Junction::SetJunctionelevationGrid(JunctionelevationGrid elevationGrid)
|
|
mJunctionelevationGrid.push_back(elevationGrid);
|
|
mJunctionelevationGrid.push_back(elevationGrid);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+int Junction::GetJunctionSurface(Junctionsurface & junctionsurface)
|
|
|
|
+{
|
|
|
|
+ if(mJunctionsurface.size() == 0)return 0;
|
|
|
|
+ junctionsurface = mJunctionsurface[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junction::SetJunctionSurface(Junctionsurface junctionsurface)
|
|
|
|
+{
|
|
|
|
+ mJunctionsurface.clear();
|
|
|
|
+ mJunctionsurface.push_back(junctionsurface);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//--------------
|
|
//--------------
|
|
|
|
|
|
|
|
|
|
@@ -1682,3 +1698,266 @@ void JunctionelevationGridelevation::Setright(string right)
|
|
mright.push_back(right);
|
|
mright.push_back(right);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+//***********************************************************************************
|
|
|
|
+//Surface Record
|
|
|
|
+//***********************************************************************************
|
|
|
|
+
|
|
|
|
+Junctionsurface_CRG::Junctionsurface_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 Junctionsurface_CRG::Getfile()
|
|
|
|
+{
|
|
|
|
+ return mfile;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+double Junctionsurface_CRG::GetsStart()
|
|
|
|
+{
|
|
|
|
+ return msStart;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+double Junctionsurface_CRG::GetsEnd()
|
|
|
|
+{
|
|
|
|
+ return msEnd;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+std::string Junctionsurface_CRG::Getorientation()
|
|
|
|
+{
|
|
|
|
+ return morientation;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+std::string Junctionsurface_CRG::Getmode()
|
|
|
|
+{
|
|
|
|
+ return mmode;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface_CRG::Getpurpose(std::string & purpose)
|
|
|
|
+{
|
|
|
|
+ if(mpurpose.size() == 0)return 0;
|
|
|
|
+ purpose = mpurpose[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface_CRG::GetsOffset(double & sOffset)
|
|
|
|
+{
|
|
|
|
+ if(msOffset.size() == 0)return 0;
|
|
|
|
+ sOffset = msOffset[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface_CRG::GettOffset(double & tOffset)
|
|
|
|
+{
|
|
|
|
+ if(mtOffset.size() == 0)return 0;
|
|
|
|
+ tOffset = mtOffset[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface_CRG::GetzOffset(double & zOffset)
|
|
|
|
+{
|
|
|
|
+ if(mzOffset.size() == 0)return 0;
|
|
|
|
+ zOffset = mzOffset[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface_CRG::GetzScale(double & zScale)
|
|
|
|
+{
|
|
|
|
+ if(mzScale.size() == 0)return 0;
|
|
|
|
+ zScale = mzScale[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface_CRG::GethOffset(double & hOffset)
|
|
|
|
+{
|
|
|
|
+ if(mhOffset.size() == 0)return 0;
|
|
|
|
+ hOffset = mhOffset[0];
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::Setfile(std::string file)
|
|
|
|
+{
|
|
|
|
+ mfile = file;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SetsStart(double sStart)
|
|
|
|
+{
|
|
|
|
+ msStart = sStart;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SetsEnd(double sEnd)
|
|
|
|
+{
|
|
|
|
+ msEnd = sEnd;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::Setorientation(std::string orientation)
|
|
|
|
+{
|
|
|
|
+ morientation = orientation;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::Setmode(std::string mode)
|
|
|
|
+{
|
|
|
|
+ mmode = mode;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::Setpurpose(std::string purpose)
|
|
|
|
+{
|
|
|
|
+ if(mpurpose.size() > 0)mpurpose.clear();
|
|
|
|
+ mpurpose.push_back(purpose);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SetsOffset(double sOffset)
|
|
|
|
+{
|
|
|
|
+ if(msOffset.size()>0)msOffset.clear();
|
|
|
|
+ msOffset.push_back(sOffset);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SettOffset(double tOffset)
|
|
|
|
+{
|
|
|
|
+ if(mtOffset.size()>0)mtOffset.clear();
|
|
|
|
+ mtOffset.push_back(tOffset);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SetzOffset(double zOffset)
|
|
|
|
+{
|
|
|
|
+ if(mzOffset.size()>0)mzOffset.clear();
|
|
|
|
+ mzOffset.push_back(zOffset);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SetzScale(double zScale)
|
|
|
|
+{
|
|
|
|
+ if(mzScale.size()>0)mzScale.clear();
|
|
|
|
+ mzScale.push_back(zScale);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::SethOffset(double hOffset)
|
|
|
|
+{
|
|
|
|
+ if(mhOffset.size()>0)mhOffset.clear();
|
|
|
|
+ mhOffset.push_back(hOffset);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::Resetpurpose()
|
|
|
|
+{
|
|
|
|
+ if(mpurpose.size()>0)mpurpose.clear();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::ResetsOffset()
|
|
|
|
+{
|
|
|
|
+ if(msOffset.size()>0)msOffset.clear();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::ResettOffset()
|
|
|
|
+{
|
|
|
|
+ if(mtOffset.size()>0)mtOffset.clear();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::ResetzOffset()
|
|
|
|
+{
|
|
|
|
+ if(mzOffset.size()>0)mzOffset.clear();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::ResetzScale()
|
|
|
|
+{
|
|
|
|
+ if(mzScale.size()>0)mzScale.clear();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Junctionsurface_CRG::ResethOffset()
|
|
|
|
+{
|
|
|
|
+ if(mhOffset.size()>0)mhOffset.clear();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool Junctionsurface_CRG::CheckInterval(double s_check)
|
|
|
|
+{
|
|
|
|
+ if (s_check>=msStart)
|
|
|
|
+ return true;
|
|
|
|
+ else
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+Junctionsurface::Junctionsurface()
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+std::vector<Junctionsurface_CRG> * Junctionsurface::GetCRGVector()
|
|
|
|
+{
|
|
|
|
+ return &mCRG;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Junctionsurface_CRG* Junctionsurface::GetCRG(unsigned int i)
|
|
|
|
+{
|
|
|
|
+ if ((mCRG.size()>0)&&(i<(mCRG.size())))
|
|
|
|
+ return &(mCRG.at(i));
|
|
|
|
+ else
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+unsigned int Junctionsurface::GetCRGCount()
|
|
|
|
+{
|
|
|
|
+ return static_cast<unsigned int >(mCRG.size()) ;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Junctionsurface_CRG* Junctionsurface::GetLastCRG()
|
|
|
|
+{
|
|
|
|
+ if (mCRG.size()>0)
|
|
|
|
+ return &mCRG.at(mCRG.size()-1);
|
|
|
|
+ else
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Junctionsurface_CRG* Junctionsurface::GetLastAddedCRG()
|
|
|
|
+{
|
|
|
|
+ if(mLastAddedCRG<mCRG.size())
|
|
|
|
+ return &mCRG.at(mLastAddedCRG);
|
|
|
|
+ else
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+unsigned int Junctionsurface::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(Junctionsurface_CRG(file,sStart,sEnd,orientation,mode));
|
|
|
|
+ else mCRG.insert(mCRG.begin()+index, Junctionsurface_CRG(file,sStart,sEnd,orientation,mode));
|
|
|
|
+ mLastAddedCRG=index;
|
|
|
|
+ return index;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+unsigned int Junctionsurface::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 Junctionsurface::DeleteCRG(unsigned int index)
|
|
|
|
+{
|
|
|
|
+ mCRG.erase(mCRG.begin()+index);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int Junctionsurface::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
|
|
|
|
+}
|
|
|
|
+
|