DGtal  0.9.3
dgtalBoard3D-1-points.cpp
Go to the documentation of this file.
1 
37 #include <iostream>
39 #include "DGtal/base/Common.h"
40 #include "DGtal/io/boards/Board3D.h"
41 #include "DGtal/helpers/StdDefs.h"
43 
44 using namespace std;
45 using namespace DGtal;
46 using namespace DGtal::Z3i;
47 
49 
50 int main()
51 {
52  trace.beginBlock ( "Example dgtalBoard3D-1-points" );
53 
54 
55  Point p1( -3, -2, 0 );
56  Point p2( 7, 3 , 6);
57  Point p3( -1, -1, -1);
58  Point p4(-1, -1, 0 );
59  Point p5( 5, 2 , 4);
60  Point p6(-3, -6, 0 );
61  Point p7( 5, 2 , 3);
62 
63  Domain domain(p4, p5);
64  DigitalSet shape_set( domain );
65  shape_set.insertNew(p6);
66  shape_set.insertNew(p7);
67 
69  Board3D<> board;
70  board << SetMode3D(domain.className(), "Paving");
71  board << p1 << p2 << p3;
72  board << shape_set;
73  board.saveOBJ("dgtalBoard3D-1-points.obj");
75 
76  trace.info()<<" Second"<<std::endl;
77  Board3D<> board2;
78  board2 << SetMode3D(domain.className(), "Paving");
79  board2 << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
80  board2 << p1 ;
81  board2 << CustomColors3D(Color(0, 255,0),Color(0, 0,255));
82  board2 << p2 << p3;
83  board2 << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
84  board2 << p6;
85  board2.saveOBJ("dgtalBoard3D-1bis-points.obj");
86 
87 
88 
89  trace.endBlock();
90  return 0;
91 }
92 // //
void beginBlock(const std::string &keyword="")
Z3i this namespace gathers the standard of types for 3D imagery.
const Domain domain(Point(1, 2), Point(6, 5))
int main()
Trace trace
Definition: Common.h:137
void saveOBJ(const std::string &filename, const bool isNormalized=false)
STL namespace.
double endBlock()
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
Definition: Board3D.h:81
std::string className() const
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.