Пример #1
0
 inline uint32_t
 getFaceId(const std::string& faceUri)
 {
   FaceMapEntry fme(faceUri, 0);
   std::map<std::string, FaceMapEntry>::iterator it = m_table.find(faceUri);
   if (it != m_table.end()) {
     return (it->second).getFaceId();
   }
   return 0;
 }
Пример #2
0
 inline void
 update(const std::string& faceUri, uint32_t faceId)
 {
   FaceMapEntry fme(faceUri, faceId);
   std::map<std::string, FaceMapEntry>::iterator it = m_table.find(faceUri);
   if (it == m_table.end()) {
     m_table.emplace(faceUri, fme);
   }
   else {
     (it->second).setFaceId(fme.getFaceId());
   }
 }
Пример #3
0
   void EOPDataStore::loadIGSFile(std::string igsFile)
      throw(FileMissingException)
   {
      ifstream inpf(igsFile.c_str());
      if(!inpf) 
      {
         FileMissingException fme("Could not open IERS file " + igsFile);
         GPSTK_THROW(fme);
      }

      clear();

      // first we skip the header section
      // skip the header

      //version 2
      //EOP  SOLUTION
      //  MJD         X        Y     UT1-UTC    LOD   Xsig   Ysig   UTsig LODsig  Nr Nf Nt     Xrt    Yrt  Xrtsig Yrtsig   dpsi    deps
      //               10**-6"        .1us    .1us/d    10**-6"     .1us  .1us/d                10**-6"/d    10**-6"/d        10**-6

      string temp;
      getline(inpf,temp);	
      getline(inpf,temp);  
      getline(inpf,temp);  
      getline(inpf,temp);  

      bool ok (true);
      while(!inpf.eof() && inpf.good()) 
      {
         string line;
         getline(inpf,line);
         StringUtils::stripTrailing(line,'\r');
         if(inpf.eof()) break;

         // line length is actually 185
         if(inpf.bad() || line.size() < 120) { ok = false; break; }

         istringstream istrm(line);
         
         double mjd(0.0),xp(0.0),yp(0.0),UT1mUTC(0.0),dPsi(0.0),dEps(0.0);
         
         istrm >> mjd >> xp >> yp >> UT1mUTC;

         for(int i=0;i<12;i++) istrm >> temp;

         istrm >> dPsi >> dEps;
         
         xp *= 1e-6;
         yp *= 1e-6;
         UT1mUTC *= 1e-7;
         
         dPsi *= 1e-6;
         dEps *= 1e-6;

         addEOPData(MJD(mjd,TimeSystem::UTC), EOPData(xp,yp,UT1mUTC,dPsi,dEps));
      };
      inpf.close();

      if(!ok) 
      {
         FileMissingException fme("IERS File " + igsFile
                                  + " is corrupted or wrong format");
         GPSTK_THROW(fme);
      }
   }