Example of Khalimsky Signed Cell export with Display3D.
#include <iostream>
#include "DGtal/io/boards/Board3D.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
using namespace std;
using namespace Z3i;
{
K.init( plow, pup,
true );
Board3D<Space, KSpace> board(
K);
board << SetMode3D( v.className(), "Illustration" );
board << v << v2 << v3;
board.saveOBJ("board3D-2-ks.obj");
Board3D<Space, KSpace> board2(
K);
SCell sx =
K.sIncident( v, 0,
true );
SCell sy =
K.sIncident( v, 1,
true );
SCell sz =
K.sIncident( v, 2,
true );
SCell sxn =
K.sIncident( v, 0,
false );
SCell syn =
K.sIncident( v, 1,
false );
SCell szn =
K.sIncident( v, 2,
false );
board2 << tsx << tsy << tsz << tsxn << tsyn << tszn;
SCell sx2 =
K.sIncident( v2, 0,
true );
SCell sy2 =
K.sIncident( v2, 1,
true );
SCell sz2 =
K.sIncident( v2, 2,
true );
SCell sxn2 =
K.sIncident( v2, 0,
false );
SCell syn2 =
K.sIncident( v2, 1,
false );
SCell szn2 =
K.sIncident( v2, 2,
false );
board2 << tsx2 << tsy2 << tsz2 << tsxn2 << tsyn2 << tszn2;
SCell sx3 =
K.sIncident( v3, 0,
true );
SCell sy3 =
K.sIncident( v3, 1,
true );
SCell sz3 =
K.sIncident( v3, 2,
true );
SCell sxn3 =
K.sIncident( v3, 0,
false );
SCell syn3 =
K.sIncident( v3, 1,
false );
SCell szn3 =
K.sIncident( v3, 2,
false );
board2 << tsx3 << tsy3 << tsz3 << tsxn3 << tsyn3 << tszn3;
std::cout << "save obj" << std::endl;
board2.saveOBJ("board3D-2bis-ks.obj");
}
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
HyperRectDomain< Space > Domain