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


C++ GridCurve::getCodesRange方法代码示例

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


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

示例1: main

int main( int argc, char** argv )
{
  trace.beginBlock ( "Testing class GridCurve" );
  trace.info() << "Args:";
  for ( int i = 0; i < argc; ++i )
    trace.info() << " " << argv[ i ];
  trace.info() << endl;


  std::string sinus2D4 = testPath + "samples/sinus2D4.dat";
  std::string polyg2D = testPath + "samples/polyg2D.dat";
  std::string sinus3D = testPath + "samples/sinus3D.dat";
  std::string emptyFile = testPath + "samples/emptyFile.dat";
  std::string square = testPath + "samples/smallSquare.dat";

  typedef KhalimskySpaceND<2> K2;
  typedef KhalimskySpaceND<3> K3;

///////// general tests
  bool res = testIOGridCurve<K2>(sinus2D4)
    && testIOGridCurve<K3>(sinus3D)
    && testExceptions(sinus3D)
    && testExceptions(polyg2D)
    && testExceptions(emptyFile)
    && testDrawGridCurve(sinus2D4)
    && testIsOpen(sinus2D4,true)
    && testIsOpen(square,false); 

/////////// ranges test
  typedef GridCurve<K2> GridCurve;

testRangeConceptChecking<GridCurve::SCellsRange>();
testRangeConceptChecking<GridCurve::SCellsRange>();
testRangeConceptChecking<GridCurve::PointsRange>();
testRangeConceptChecking<GridCurve::MidPointsRange>();
testRangeConceptChecking<GridCurve::ArrowsRange>();
testRangeConceptChecking<GridCurve::InnerPointsRange>();
testRangeConceptChecking<GridCurve::OuterPointsRange>();
testRangeConceptChecking<GridCurve::IncidentPointsRange>();

  //reading grid curve
  GridCurve c; 
  fstream inputStream;
  inputStream.open (square.c_str(), ios::in);
  c.initFromVectorStream(inputStream);
  inputStream.close();

  res = res 
    && testRange<GridCurve::SCellsRange>(c.getSCellsRange())
    && testRange<GridCurve::PointsRange>(c.getPointsRange())
    && testRange<GridCurve::MidPointsRange>(c.getMidPointsRange())
    && testPairsRange<GridCurve::ArrowsRange>(c.getArrowsRange())
    && testRange<GridCurve::InnerPointsRange>(c.getInnerPointsRange())
    && testRange<GridCurve::OuterPointsRange>(c.getOuterPointsRange())
    && testPairsRange<GridCurve::IncidentPointsRange>(c.getIncidentPointsRange())
    && testRange<GridCurve::CodesRange>(c.getCodesRange())
;

  res = res 
    && testDisplayRange<GridCurve::SCellsRange>(c.getSCellsRange())
    && testDisplayRange<GridCurve::PointsRange>(c.getPointsRange())
    && testDisplayRange<GridCurve::MidPointsRange>(c.getMidPointsRange())
    && testDisplayRange<GridCurve::ArrowsRange>(c.getArrowsRange())
    && testDisplayRange<GridCurve::InnerPointsRange>(c.getInnerPointsRange())
    && testDisplayRange<GridCurve::OuterPointsRange>(c.getOuterPointsRange())
    && testDisplayRange<GridCurve::IncidentPointsRange>(c.getIncidentPointsRange())
    && testDisplayRange<GridCurve::CodesRange>(c.getCodesRange())
;

  res = res 
    && testDrawRange<GridCurve::SCellsRange>(c.getSCellsRange(),"1cells","Grid")
    && testDrawRange<GridCurve::PointsRange>(c.getPointsRange(),"Points","Paving")
    && testDrawRange<GridCurve::MidPointsRange>(c.getMidPointsRange(),"MidPoints","Paving")
    && testDrawRange<GridCurve::ArrowsRange>(c.getArrowsRange(),"Arrows","Paving")
    && testDrawRange<GridCurve::InnerPointsRange>(c.getInnerPointsRange(),"InnerPoints","Grid")
    && testDrawRange<GridCurve::OuterPointsRange>(c.getOuterPointsRange(),"OuterPoints","Grid")
    && testDrawRange<GridCurve::IncidentPointsRange>(c.getIncidentPointsRange(),"IncidentPoints","Grid")
;

//////////////////////

  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
  trace.endBlock();
  
  return res ? 0 : 1;
}
开发者ID:kerautret,项目名称:DGtal-forIPOL,代码行数:86,代码来源:testGridCurve.cpp


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