本文整理汇总了C++中KSpace::uSpel方法的典型用法代码示例。如果您正苦于以下问题:C++ KSpace::uSpel方法的具体用法?C++ KSpace::uSpel怎么用?C++ KSpace::uSpel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSpace
的用法示例。
在下文中一共展示了KSpace::uSpel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
KSpace K;
Point plow(-3,-2);
Point pup(5,3);
Domain domain( plow, pup );
Board2D board; // for 2D display
K.init( plow, pup, true );
board << SetMode( domain.styleName(), "Paving" )
<< domain;
Cell pixlow = K.uSpel( plow ); // pixel (-3*2+1,-2*2+1)
Cell ptlow = K.uPointel( plow ); // pointel (-3*2,-2*2)
Cell pixup = K.uSpel( pup ); // pixel (5*2+1,3*2+1)
Cell ptup1 = K.uPointel( pup ); // pointel (5*2,3*2)
Cell ptup2 = K.uTranslation( ptup1, Point::diagonal() ); // pointel (6*2,4*2)
Cell linelb = K.uCell( Point( 1, 0 ) ); // linel (1,0) bottom
Cell linelt = K.uCell( Point( 1, 2 ) ); // linel (1,2) top
Cell linell = K.uCell( Point( 0, 1 ) ); // linel (0,1) left
Cell linelr = K.uCell( Point( 2, 1 ) ); // linel (2,1) right
board << CustomStyle( ptlow.styleName(),
new CustomColors( Color( 0, 0, 200 ),
Color( 100, 100, 255 ) ) )
<< ptlow << ptup2;
board << CustomStyle( pixlow.styleName(),
new CustomColors( Color( 200, 0, 0 ),
Color( 255, 100, 100 ) ) )
<< pixlow << pixup;
board << CustomStyle( linelb.styleName(),
new CustomColors( Color( 0, 200, 0 ),
Color( 100, 255, 100 ) ) )
<< linelb << linelt << linell << linelr;
board.saveSVG("ctopo-1.svg");
board.saveEPS("ctopo-1.eps");
return 0;
}
示例2: main
int main( int /* argc */, char** /* argv */ )
{
//! [cubical-complex-illustrations-X]
using namespace DGtal::Z2i;
typedef CubicalComplex< KSpace > CC;
KSpace K;
K.init( Point( 0,0 ), Point( 5,3 ), true );
trace.beginBlock( "Creating Cubical Complex" );
CC X( K );
Domain domain( Point( 0,0 ), Point( 5,3 ) );
X.insertCell( K.uSpel( Point(1,1) ) );
X.insertCell( K.uSpel( Point(2,1) ) );
X.insertCell( K.uSpel( Point(3,1) ) );
X.insertCell( K.uSpel( Point(2,2) ) );
X.insertCell( K.uSpel( Point(3,2) ) );
X.insertCell( K.uSpel( Point(4,2) ) );
X.close();
trace.endBlock();
trace.beginBlock( "Displays Cubical Complex" );
Board2D board;
board << domain;
board << CustomStyle( X.className(),
new CustomColors( Color(80,80,100), Color(180,180,200) ) )
<< X;
board.saveTikZ( "cubical-complex-illustrations-X.tikz" );
trace.endBlock();
//! [cubical-complex-illustrations-X]
//! [cubical-complex-illustrations-S]
CC S( K );
S.insertCell( K.uCell( Point( 5, 4 ) ) ); // a linel
S.insertCell( K.uCell( Point( 4, 4 ) ) ); // a pointel
S.insertCell( K.uCell( Point( 7, 5 ) ) ); // a pixel
board << CustomStyle( X.className(),
new CustomColors( Color::Black, Color(60,60,60) ) )
<< S;
board.saveTikZ( "cubical-complex-illustrations-S.tikz" );
board.clear();
//! [cubical-complex-illustrations-S]
//! [cubical-complex-illustrations-closure]
board << domain;
board << CustomStyle( X.className(),
new CustomColors( Color(80,80,100), Color(180,180,200) ) )
<< X;
board << CustomStyle( X.className(),
new CustomColors( Color::Red, Color(255,120,120) ) )
<< X.closure( S );
board.saveTikZ( "cubical-complex-illustrations-closure.tikz" );
board.clear();
//! [cubical-complex-illustrations-closure]
//! [cubical-complex-illustrations-star]
board << domain;
board << CustomStyle( X.className(),
new CustomColors( Color(80,80,100), Color(180,180,200) ) )
<< X;
board << CustomStyle( X.className(),
new CustomColors( Color::Blue, Color(120,120,255) ) )
<< X.star( S );
board.saveTikZ( "cubical-complex-illustrations-star.tikz" );
board.clear();
//! [cubical-complex-illustrations-star]
//! [cubical-complex-illustrations-link]
board << domain;
board << CustomStyle( X.className(),
new CustomColors( Color(80,80,100), Color(180,180,200) ) )
<< X;
board << CustomStyle( X.className(),
new CustomColors( Color::Green, Color(120,255,120) ) )
<< X.link( S );
board.saveTikZ( "cubical-complex-illustrations-link.tikz" );
board.clear();
//! [cubical-complex-illustrations-link]
//! [cubical-complex-illustrations-bd]
board << domain;
board << CustomStyle( X.className(),
new CustomColors( Color(80,80,100), Color(180,180,200) ) )
<< X;
board << CustomStyle( X.className(),
new CustomColors( Color::Magenta, Color(255,120,255) ) )
<< X.boundary();
board.saveTikZ( "cubical-complex-illustrations-bd.tikz" );
board.clear();
//! [cubical-complex-illustrations-bd]
//! [cubical-complex-illustrations-int]
board << domain;
board << CustomStyle( X.className(),
new CustomColors( Color(80,80,100), Color(180,180,200) ) )
<< X;
board << CustomStyle( X.className(),
new CustomColors( Color::Cyan, Color(120,255,255) ) )
<< X.interior();
board.saveTikZ( "cubical-complex-illustrations-int.tikz" );
//.........这里部分代码省略.........