DGtal  0.9.2
dgtalBoard3D-1-points.cpp
1 
29 #include <iostream>
31 #include "DGtal/base/Common.h"
32 #include "DGtal/io/boards/Board3D.h"
33 #include "DGtal/helpers/StdDefs.h"
35 
36 using namespace std;
37 using namespace DGtal;
38 using namespace DGtal::Z3i;
39 
41 
42 int main()
43 {
44  trace.beginBlock ( "Example dgtalBoard3D-1-points" );
45 
46 
47  Point p1( -3, -2, 0 );
48  Point p2( 7, 3 , 6);
49  Point p3( -1, -1, -1);
50  Point p4(-1, -1, 0 );
51  Point p5( 5, 2 , 4);
52  Point p6(-3, -6, 0 );
53  Point p7( 5, 2 , 3);
54 
55  Domain domain(p4, p5);
56  DigitalSet shape_set( domain );
57  shape_set.insertNew(p6);
58  shape_set.insertNew(p7);
59 
61  Board3D<> board;
62  board << SetMode3D(domain.className(), "Paving");
63  board << p1 << p2 << p3;
64  board << shape_set;
65  board.saveOBJ("dgtalBoard3D-1-points.obj");
67 
68  trace.info()<<" Second"<<std::endl;
69  Board3D<> board2;
70  board2 << SetMode3D(domain.className(), "Paving");
71  board2 << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
72  board2 << p1 ;
73  board2 << CustomColors3D(Color(0, 255,0),Color(0, 0,255));
74  board2 << p2 << p3;
75  board2 << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
76  board2 << p6;
77  board2.saveOBJ("dgtalBoard3D-1bis-points.obj");
78 
79 
80 
81  trace.endBlock();
82  return 0;
83 }
84 // //
void beginBlock(const std::string &keyword="")
Z3i this namespace gathers the standard of types for 3D imagery.
Trace trace
Definition: Common.h:130
void saveOBJ(const std::string &filename, const bool isNormalized=false)
STL namespace.
double endBlock()
std::string className() const
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
Definition: Board3D.h:81
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
std::ostream & info()
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.