DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testMeshDisplay.cpp
Go to the documentation of this file.
1
16
29
32
#include "DGtal/base/Common.h"
33
#include "DGtal/helpers/StdDefs.h"
34
#include "DGtal/shapes/Mesh.h"
35
#include "DGtal/io/viewers/PolyscopeViewer.h"
38
39
using namespace
std
;
40
using namespace
DGtal
;
41
using namespace
DGtal::Z3i
;
42
44
// Functions for testing class Mesh Display.
46
48
// Standard services - public :
49
50
51
int
main
(
int
argc,
char
** argv )
52
{
53
trace
.
beginBlock
(
"Testing class MeshDisplay"
);
54
trace
.
info
() <<
"Args:"
;
55
for
(
int
i = 0; i < argc; ++i )
56
trace
.
info
() <<
" "
<< argv[ i ];
57
trace
.
info
() << endl;
59
PolyscopeViewer
viewer;
61
63
Mesh<Point>
aMesh(
true
);
64
aMesh.
addVertex
(
Point
(0,0,0));
65
aMesh.
addVertex
(
Point
(1,0,0));
66
aMesh.
addVertex
(
Point
(1,1,0));
67
68
aMesh.
addVertex
(
Point
(0,0,1));
69
aMesh.
addVertex
(
Point
(1,0,1));
70
aMesh.
addVertex
(
Point
(1,1,1));
71
aMesh.
addVertex
(
Point
(0,1,1));
72
73
aMesh.
addVertex
(
Point
(0,1,0));
74
aMesh.
addVertex
(
Point
(0,2,0));
75
aMesh.
addVertex
(
Point
(0,3,1));
76
aMesh.
addVertex
(
Point
(0,2,2));
77
aMesh.
addVertex
(
Point
(0,1,2));
78
aMesh.
addVertex
(
Point
(0,0,1));
79
80
aMesh.
addTriangularFace
(0, 1, 2,
Color
(150,0,150,104));
81
aMesh.
addQuadFace
(6,5,4,3,
Color::Blue
);
82
83
Mesh<Point>::MeshFace
listIndex;
84
listIndex.push_back(7);
85
listIndex.push_back(8);
86
listIndex.push_back(9);
87
listIndex.push_back(10);
88
listIndex.push_back(11);
89
listIndex.push_back(12);
90
91
aMesh.
addFace
(listIndex,
Color
(150,150,0,54));
94
viewer << aMesh;
95
97
trace
.
emphase
() <<
"Passed."
<< endl;
98
trace
.
endBlock
();
99
viewer.
show
();
100
return
0;
101
}
102
// //
DGtal::Color::Color
Color()
Definition
Color.h:139
DGtal::Color::Blue
static const Color Blue
Definition
Color.h:428
DGtal::Mesh
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition
Mesh.h:92
DGtal::Mesh::addQuadFace
void addQuadFace(Index indexVertex1, Index indexVertex2, Index indexVertex3, Index indexVertex4, const DGtal::Color &aColor=DGtal::Color::White)
DGtal::Mesh::addFace
void addFace(const MeshFace &aFace, const DGtal::Color &aColor=DGtal::Color::White)
DGtal::Mesh::MeshFace
std::vector< Index > MeshFace
Definition
Mesh.h:126
DGtal::Mesh::addTriangularFace
void addTriangularFace(Index indexVertex1, Index indexVertex2, Index indexVertex3, const DGtal::Color &aColor=DGtal::Color::White)
DGtal::Mesh::addVertex
void addVertex(const TPoint &vertex)
DGtal::PolyscopeViewer
Definition
PolyscopeViewer.h:57
DGtal::PolyscopeViewer::show
void show() override
Starts the event loop and display of elements.
Definition
PolyscopeViewer.h:73
DGtal::Point
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
tests
shapes
testMeshDisplay.cpp
Generated on
for DGtal by
1.18.0