32 #include "DGtal/base/Common.h"
33 #include "ConfigTest.h"
34 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/io/boards/Board3D.h"
39 using namespace DGtal;
51 unsigned int nbok = 0;
57 Point p1( -3, -2, 0 );
59 Point p3( -1, -1, -1);
67 shape_set.insertNew(p6);
68 shape_set.insertNew(p7);
72 board << p1 << p2 << p3;
74 board.
saveOBJ(
"dgtalBoard3D-1-points.obj");
86 board2.
saveOBJ(
"dgtalBoard3D-1bis-points.obj");
90 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
91 <<
"true == true" << std::endl;
99 unsigned int nbok = 0;
127 board.
saveOBJ(
"dgtalBoard3D.quad.obj");
130 nbok +=
true ? 1 : 0;
132 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
133 <<
"true == true" << std::endl;
140 bool testNormaliation()
145 Point p2( 0, 10 , 0);
146 Point p3( 10, 10, 0);
147 Point p4(10, 0, 100 );
148 Point p5( 20, 0 , 0);
149 Point p6( 20, 10, 0);
157 board << p1<<p2<<p3<<p4;
159 board.
saveOBJ(
"dgtalBoard3D-norm.obj",
true);
160 board.
saveOBJ(
"dgtalBoard3D-wonorm.obj");
180 board.
saveOBJ(
"dgtalBoard3D-line.obj");
192 int main(
int argc,
char** argv )
196 for (
int i = 0; i < argc; ++i )
200 bool res = testBoard3D() && testQuadNorm()
201 && testNormaliation()
203 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
void saveOBJ(const std::string &filename, const bool isNormalized=false)
virtual void setLineColor(DGtal::Color aColor)
Factory for GPL Display3D:
Cell uCell(const PreCell &c) const
std::string className() const
bool init(const Point &lower, const Point &upper, bool isClosed)
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
void addLine(const RealPoint &p1, const RealPoint &p2, const double width=0.03)
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...
Structure representing an RGB triple with alpha component.
void addQuadWithNormal(const RealPoint &p1, const RealPoint &p2, const RealPoint &p3, const RealPoint &p4, const RealPoint &n, const bool enableReorientation, const bool enableDoubleFace=false)
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex...
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.