DGtal  1.5.beta
dgtalBoard3D-1-points.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/boards/Board3D.h"
#include "DGtal/helpers/StdDefs.h"
Include dependency graph for dgtalBoard3D-1-points.cpp:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Aline MARTIN (aline.nosp@m..mar.nosp@m.tin@i.nosp@m.nsa-.nosp@m.lyon..nosp@m.fr )
Date
2013/06/16

An example file named dgtalBoard3D-1-points.

Definition in file dgtalBoard3D-1-points.cpp.

Function Documentation

◆ main()

int main ( void  )

[ExampleBoard3DExport]

[ExampleBoard3DExport]

Definition at line 50 of file dgtalBoard3D-1-points.cpp.

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 }
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
Definition: Board3D.h:82
void saveOBJ(const std::string &filename, const bool isNormalized=false)
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
std::string className() const
void beginBlock(const std::string &keyword="")
std::ostream & info()
double endBlock()
Trace trace
Definition: Common.h:153
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Domain domain

References DGtal::Trace::beginBlock(), DGtal::HyperRectDomain< TSpace >::className(), domain, DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::DigitalSetByAssociativeContainer< TDomain, TContainer >::insertNew(), DGtal::Board3D< Space, KSpace >::saveOBJ(), and DGtal::trace.