当前位置: 首页>>代码示例>>C++>>正文


C++ PvlGroup::Keywords方法代码示例

本文整理汇总了C++中PvlGroup::Keywords方法的典型用法代码示例。如果您正苦于以下问题:C++ PvlGroup::Keywords方法的具体用法?C++ PvlGroup::Keywords怎么用?C++ PvlGroup::Keywords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PvlGroup的用法示例。


在下文中一共展示了PvlGroup::Keywords方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsisMain

void IsisMain() {
  UserInterface &ui = Application::GetUserInterface();
  SerialNumberList serialNumbers(true);

  FileList images(ui.GetFilename("FROMLIST"));
  // list of sns/filenames sorted by serial number
  vector< pair<string, string> > sortedList;

  // We want to sort the input data by serial number so that the same
  //   results are produced every time this program is run with the same
  //   images. This is a modified insertion sort.
  for(unsigned int image = 0; image < images.size(); image++) {
    unsigned int insertPos = 0;
    string sn = SerialNumber::Compose(images[image]);

    for(insertPos = 0; insertPos < sortedList.size(); insertPos++) {
      if(sn.compare(sortedList[insertPos].first) < 0) break;
    }

    pair<string, string> newPair = pair<string, string>(sn, images[image]);
    sortedList.insert(sortedList.begin() + insertPos, newPair);
  }

  // Add the serial numbers in sorted order now
  for(unsigned int i = 0; i < sortedList.size(); i++) {
    serialNumbers.Add(sortedList[i].second);
  }

  // Now we want the ImageOverlapSet to calculate our overlaps
  ImageOverlapSet overlaps(true);
  overlaps.FindImageOverlaps(serialNumbers, Filename(ui.GetFilename("TO")).Expanded());

  // These call were the old way of calculating overlaps and writing them
  //overlaps.FindImageOverlaps(serialNumbers);
  //overlaps.WriteImageOverlaps(Filename(ui.GetFilename("TO")).Expanded());

  // This will only occur when "CONTINUE" was true, so we can assume "ERRORS" was 
  //   an entered parameter.
  if(overlaps.Errors().size() != 0 && ui.WasEntered("ERRORS")) {
    Pvl outFile;

    bool filenamesOnly = !ui.GetBoolean("DETAILED");

    vector<PvlGroup> errorList = overlaps.Errors();

    for(unsigned int err = 0; err < errorList.size(); err++) {
      if(!filenamesOnly) {
        outFile += errorList[err];
      }
      else if(errorList[err].HasKeyword("Filenames")) {
        PvlGroup origError = errorList[err];
        PvlGroup err("ImageOverlapError");

        for(int keyword = 0; keyword < origError.Keywords(); keyword++) {
          if(origError[keyword].Name() == "Filenames") {
            err += origError[keyword];
          }
        }

        outFile += err;
      }
    }

    outFile.Write(Filename(ui.GetFilename("ERRORS")).Expanded());
  }

  PvlGroup results("Results");
  results += PvlKeyword("ErrorCount", (BigInt)overlaps.Errors().size());
  Application::Log(results);
}
开发者ID:assutech,项目名称:isis3,代码行数:70,代码来源:findimageoverlaps.cpp

示例2: IsisMain


//.........这里部分代码省略.........
    if(outMappingGrp.HasKeyword("PixelResolution")) {
      outMappingGrp.DeleteKeyword("PixelResolution");
    }

    if(fromMappingGrp.HasKeyword("Scale")) {
      fromMappingGrp.DeleteKeyword("Scale");
    }

    if(fromMappingGrp.HasKeyword("PixelResolution")) {
      fromMappingGrp.DeleteKeyword("PixelResolution");
    }

    if(userMappingGrp.HasKeyword("Scale")) {
      userMappingGrp.DeleteKeyword("Scale");
    }

    if(userMappingGrp.HasKeyword("PixelResolution")) {
      userMappingGrp.DeleteKeyword("PixelResolution");
    }

    outMappingGrp.AddKeyword(PvlKeyword("Scale", ui.GetDouble("RESOLUTION"), "pixels/degree"), Pvl::Replace);
  }

  // Rotation will NOT Propagate
  if(outMappingGrp.HasKeyword("Rotation")) {
    outMappingGrp.DeleteKeyword("Rotation");
  }


  /**
   * The user specified map template file overrides what ever is in the
   * cube's mapping group.
   */
  for(int keyword = 0; keyword < userMappingGrp.Keywords(); keyword ++) {
    outMappingGrp.AddKeyword(userMappingGrp[keyword], Pvl::Replace);
  }

  /**
   * Now, we have to deal with unit conversions. We convert only if the following are true:
   *   1) We used values from the input cube
   *   2) The values are longitudes or latitudes
   *   3) The map file or user-specified information uses a different measurement system than
   *        the input cube for said values.
   *
   * The data is corrected for:
   *   1) Positive east/positive west
   *   2) Longitude domain
   *   3) planetographic/planetocentric.
   */

  // First, the longitude direction
  if(!sameDirection) {
    PvlGroup longitudes = inproj->MappingLongitudes();

    for(int index = 0; index < longitudes.Keywords(); index ++) {
      if(!userMappingGrp.HasKeyword(longitudes[index].Name())) {
        // use the from domain because that's where our values are coming from
        if(((string)userMappingGrp["LongitudeDirection"]).compare("PositiveEast") == 0) {
          outMappingGrp[longitudes[index].Name()] =
            Projection::ToPositiveEast(outMappingGrp[longitudes[index].Name()], outMappingGrp["LongitudeDomain"]);
        }
        else {
          outMappingGrp[longitudes[index].Name()] =
            Projection::ToPositiveWest(outMappingGrp[longitudes[index].Name()], outMappingGrp["LongitudeDomain"]);
        }
      }
开发者ID:assutech,项目名称:isis3,代码行数:67,代码来源:map2map.cpp


注:本文中的PvlGroup::Keywords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。