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


C++ Board2D::scale方法代码示例

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


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

示例1: testDomain

bool testDomain()
{
    typedef SpaceND<2> TSpace;
    typedef TSpace::Point Point;
    Point a ( 1, 1);
    Point b ( 15, 15);

    trace.beginBlock ( "HyperRectDomain Iterator" );
    HyperRectDomain<TSpace> myDomain ( a,b );
    
    Board2D board;
    
    board << SetMode( myDomain.className(), "Grid" ) << myDomain;
    board.scale(10);
    board.saveSVG( "domain-grid.svg" );
    board.saveTikZ( "domain-grid.tikz" );
    
    Board2D b2;
    b2 << SetMode( myDomain.className(), "Paving" ) << myDomain;
    b2.scale(10);
    b2.saveSVG( "domain-paving.svg" );
    b2.saveTikZ( "domain-paving.tikz" );


    trace.endBlock();

    PointVector<3,int> pl;
    //An assert should be raised 
    //Display2DFactory::draw(b2, pl);

    return true;
}
开发者ID:Jeremy-Gaillard,项目名称:DGtal,代码行数:32,代码来源:testSimpleBoard.cpp

示例2: testDomain

bool testDomain()
{
    typedef SpaceND<2> TSpace;
    typedef TSpace::Point Point;
    Point a ( 1, 1);
    Point b ( 15, 15);

    trace.beginBlock ( "HyperRectDomain Iterator" );
    HyperRectDomain<TSpace> myDomain ( a,b );
    
    Board2D board;
    
    board << DrawDomainGrid() << myDomain;
    board.scale(10);
    board.saveSVG( "domain-grid.svg" );
    
    Board2D b2;
    b2 << DrawDomainPaving() << myDomain;
    b2.scale(10);
    b2.saveSVG( "domain-paving.svg" );


    trace.endBlock();

    PointVector<3,int> pl;
    //An assert should be raised 
    //pl.selfDraw(b2);

    return true;
}
开发者ID:malaterre,项目名称:DGtal,代码行数:30,代码来源:testSimpleBoard.cpp

示例3: testSimpleBoard

/**
 * Example of a test. To be completed.
 *
 */
bool testSimpleBoard()
{
  unsigned int nbok = 0;
  unsigned int nb = 2;

  trace.beginBlock ( "Testing class SimpleBoard" );
  
  Board2D board;

  board.setPenColorRGBi( 0, 0, 0);
  board.drawRectangle( -1, 1, 2.0, 2.0 );
  board.setPenColorRGBi( 0, 0, 255 );
  board.fillCircle( 2, 2, 1 );
  
  

  board.saveSVG( "simpleboard.svg" );
  board.saveFIG( "simpleboard.fig" );
  board.saveEPS( "simpleboard.eps" );
  board.saveTikZ( "simpleboard.tikz" );
  nbok++;

  typedef  PointVector<2,int> Point2D;
  Point2D apoint, p2;
  apoint[0] = 5;
  p2[0] = 1;
  apoint[1] = 8;
  p2[1] = 1;

  board.setPenColorRGBi( 255, 0, 255 );
  board << apoint;

  board.setPenColorRGBi( 255, 0, 0 );
  Display2DFactory::draw(board, apoint, p2);

  board.scale(10);

  board.saveSVG( "pointsimpleboard.svg" );
  board.saveFIG( "pointsimpleboard.fig" );
  board.saveEPS( "pointsimpleboard.eps" );
  board.saveTikZ( "pointsimpleboard.tikz" );
  nbok++;
  trace.endBlock();
  return nbok == nb;
}
开发者ID:Jeremy-Gaillard,项目名称:DGtal,代码行数:49,代码来源:testSimpleBoard.cpp

示例4: testDigitalSetDraw

bool testDigitalSetDraw()
{
  unsigned int nbok = 0;
  unsigned int nb = 0;

  typedef SpaceND<2> Z2;
  typedef HyperRectDomain<Z2> Domain;
  typedef Z2::Point Point;
  Point p1(  -10, -10  );
  Point p2(  10, 10  );
  Domain domain( p1, p2 );
  typedef DigitalSetSelector
  < Domain, BIG_DS + HIGH_ITER_DS + HIGH_BEL_DS >::Type SpecificSet;

  BOOST_CONCEPT_ASSERT(( concepts::CDigitalSet< SpecificSet > ));
  SpecificSet disk( domain );
  Point c(  0, 0  );

  trace.beginBlock ( "Creating disk( r=5.0 ) ..." );
  for ( Domain::ConstIterator it = domain.begin();
  it != domain.end();
      ++it )
  {
    if ( (*it - c ).norm() < 5.0 )
      // insertNew is very important for vector container.
      disk.insertNew( *it );
  }

  //Board export test
  trace.beginBlock("SVG Export");
  Board2D board;
  board << SetMode( domain.className(), "Grid" ) << domain;
  board << disk;

  board.scale(10);
  board.saveSVG( "disk-set.svg" );
  trace.endBlock();

  return nbok == nb;
}
开发者ID:BorisMansencal,项目名称:DGtal,代码行数:40,代码来源:testDigitalSet.cpp


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