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


C++ Projector::setPmeshName方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
            pmeshname = atoi(optarg);
                  
          }
          break;
        }
      case '?':
      default: // help
        {
          std::cout << "Usage: " << argv[0] << " [options] "
                    << "InputFile InputProjectionFile [outputfile]"
                    << std::endl;
          std::cout << "where options are: " << std::endl;
          std::cout << "   -p pmesh number 6=LeastSqrs 8=Bilinear "
                    << "9=bicubic" << std::endl;
          std::cout << "   -n pmeshsize" << std::endl;
          std::cout << "   -l logfile for timings " << std::endl;
          std::cout << "   -s number where number is the output scale" 
                    << std::endl;
          std::cout << "   -S forces output scale same length as input scale"
                    << std::endl;
          std::cout << "   -? this help screen" << std::endl;
          return 0;
        }
      }
    
    if (optind > argc-2 || argv[optind+1] == NULL)
    {
      std::cout << "You must specify a input file and a input projection file"
                << std::endl
                << "See -h for help" << std::endl;
      return 0;
    }
    else
    {
      filename = std::string(argv[optind++]);
   	  parameterfile = std::string(argv[optind++]);
    }
  
    if (parameterfile == std::string(" ") || filename == std::string(" "))
    {
      std::cout << "You must specify a input file and parameter file " 
                << "use -help for options" << std::endl;
      return 0;
    }
    
    outproj = SetProjection(parameterfile);
    
    if (!outproj)
    {
      std::cout << "Could not create the output projection!"
                << std::endl;
      return 0;
    }
    
    //check for the time file
    if (timefile)
    {
      out.open(logname.c_str()); //open the ouput file
      start = time(NULL);        //get the start
      out << start << std::endl; //output the start
    }
    
    if (optind == argc-1)
    {
      projector.setOutputFileName(std::string(argv[optind]));
    }

    projector.setOutputProjection(outproj);
    projector.setPmeshName(pmeshname);
    projector.setPmeshSize(pmeshsize);
    
    if (!samescale)
      projector.setOutputScale(newscale);
    else
      projector.setSameScale(true);
    
    projector.setInputFile(filename);
 
    projector.project(&progress);
   
    if (timefile)
    {
      finish = time(NULL);
      out << finish << std::endl;
      out << (finish - start);
      out.close();
    }
    return 0;
  }
  catch(ProjectorException & temp)
  {
    std::cout << temp.getExceptionMessage() << std::endl;
    return 0;
  }
  catch(...)
  {
    std::cout << "An unkown exception has been thrown" << std::endl;
    return 0;
  }
}
开发者ID:briangmaddox,项目名称:USGS-Projector,代码行数:101,代码来源:Main.cpp


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