本文整理汇总了C++中KSpace::uIncident方法的典型用法代码示例。如果您正苦于以下问题:C++ KSpace::uIncident方法的具体用法?C++ KSpace::uIncident怎么用?C++ KSpace::uIncident使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSpace
的用法示例。
在下文中一共展示了KSpace::uIncident方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testCellDrawOnBoard
bool testCellDrawOnBoard()
{
typedef typename KSpace::Integer Integer;
typedef typename KSpace::Cell Cell;
typedef typename KSpace::SCell SCell;
typedef typename KSpace::Point Point;
typedef typename KSpace::DirIterator DirIterator;
typedef typename KSpace::Cells Cells;
typedef typename KSpace::SCells SCells;
typedef SpaceND<2, Integer> Z2;
typedef HyperRectDomain<Z2> Domain;
unsigned int nbok = 0;
unsigned int nb = 0;
trace.beginBlock ( "Testing cell draw on digital board ..." );
KSpace K;
int xlow[ 4 ] = { -3, -3 };
int xhigh[ 4 ] = { 5, 3 };
Point low( xlow );
Point high( xhigh );
bool space_ok = K.init( low, high, true );
Domain domain( low, high );
Board2D board;
board.setUnit( LibBoard::Board::UCentimeter );
board << SetMode( domain.className(), "Paving" )
<< domain;
int spel[ 2 ] = { 1, 1 }; // pixel 0,0
Point kp( spel );
Cell uspel = K.uCell( kp );
board << uspel
<< low << high
<< K.uIncident( uspel, 0, false )
<< K.uIncident( uspel, 1, false );
int spel2[ 2 ] = { 5, 1 }; // pixel 2,0
Point kp2( spel2 );
SCell sspel2 = K.sCell( kp2, K.POS );
board << CustomStyle( sspel2.className(),
new CustomPen( Color( 200, 0, 0 ),
Color( 255, 100, 100 ),
2.0,
Board2D::Shape::SolidStyle ) )
<< sspel2
<< K.sIncident( sspel2, 0, K.sDirect( sspel2, 0 ) )
<< K.sIncident( sspel2, 1, K.sDirect( sspel2, 0 ) );
board.saveEPS( "cells-1.eps" );
board.saveSVG( "cells-1.svg" );
trace.endBlock();
board.clear();
board << domain;
SCell slinel0 = K.sIncident( sspel2, 0, K.sDirect( sspel2, 0 ) );
SCell spointel01 = K.sIncident( slinel0, 1, K.sDirect( slinel0, 1 ) );
board << CustomStyle( sspel2.className(),
new CustomColors( Color( 200, 0, 0 ),
Color( 255, 100, 100 ) ) )
<< sspel2
<< CustomStyle( slinel0.className(),
new CustomColors( Color( 0, 200, 0 ),
Color( 100, 255, 100 ) ) )
<< slinel0
<< CustomStyle( spointel01.className(),
new CustomColors( Color( 0, 0, 200 ),
Color( 100, 100, 255 ) ) )
<< spointel01;
board.saveEPS( "cells-3.eps" );
board.saveSVG( "cells-3.svg" );
return ((space_ok) && (nbok == nb));
}