예제 #1
0
void ossimKeywordlist::add(const char* prefix,
                           const char* key,
                           ossim_float64 value,
                           bool overwrite,
                           int precision)
{
   if (key)
   {
      ossimString k;
      if (prefix) k = prefix;
      k += key;
      
      ossimString v = ossimString::toString(value,
                                            precision);
      
      KeywordMap::iterator i = getMapEntry(k);
      
      if(i == m_map.end())
      {
         m_map.insert(std::make_pair(k, v));
      }
      else if (overwrite)
      {
         (*i).second = v;
      }
   }
}
예제 #2
0
void ossimKeywordlist::add(const char* prefix,
                           const char* key,
                           char        value,
                           bool        overwrite)
{
   if (key)
   {
      ossimString k;
      if (prefix) k = prefix;
      k += key;
      
      char tmp[2];
      tmp[0] = value;
      tmp[1] = '\0';
      ossimString v = tmp;
      
      KeywordMap::iterator i = getMapEntry(k);
      
      if(i == m_map.end())
      {
         m_map.insert(std::make_pair(k, v));
      }
      else if(overwrite)
      {
         (*i).second = v;
      }
   }
}
예제 #3
0
void ossimKeywordlist::add(const char* prefix,
                           const char* key,
                           const char* value,
                           bool        overwrite)
{
   if (key)
   {
      ossimString k;
      if (prefix) k = prefix;
      k += key;
      
      ossimString v;
      if (value) v = value;
      if ( m_expandEnvVars == true )
      {
         v = v.expandEnvironmentVariable();
      }
      
      KeywordMap::iterator i = getMapEntry(k);
      
      if(i == m_map.end())
      {
         m_map.insert(std::make_pair(k, v));
      }
      else if(overwrite)
      {
         (*i).second = v;
      }
   }
}
예제 #4
0
void TSMaterialManager::mapMaterial(const String & textureName, const String & materialName)
{
   if (getMapEntry(textureName).isNotEmpty())
   {
      if (!textureName.equal("unmapped_mat", String::NoCase))
         Log::warnf(LogEntry::General, "Warning, overwriting material for: %s", textureName.c_str());
   }
   
   mMaterialMap[String::ToLower(textureName)] = materialName;
}
예제 #5
0
void ossimKeywordlist::add(const char* key,
                           ossim_int64 value,
                           bool overwrite)
{
   if (key)
   {
      ossimString k = key;
      
      ossimString v = ossimString::toString(value);
      
      KeywordMap::iterator i = getMapEntry(k);
      
      if(i == m_map.end())
      {
         m_map.insert(std::make_pair(k, v));
      }
      else if (overwrite)
      {
         (*i).second = v;
      }
   }
}
예제 #6
0
void ossimKeywordlist::addPair(const std::string& key,
                               const std::string& value,
                               bool               overwrite)
{
   if ( key.size() )
   {
      ossimString v = value;
      if ( m_expandEnvVars == true )
      {
         v = v.expandEnvironmentVariable();
      }
      
      KeywordMap::iterator i = getMapEntry(key);
      
      if (i == m_map.end())
      {
         m_map.insert(std::make_pair(key, v.string()));
      }
      else if (overwrite)
      {
         (*i).second = v.string();
      }
   }
}