File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
testMeshDisplay.cpp File Reference
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Mesh.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
Include dependency graph for testMeshDisplay.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

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
Bertrand Kerautret (kerau.nosp@m.tre@.nosp@m.loria.nosp@m..fr ) LORIA (CNRS, UMR 7503), University of Nancy, France
Date
2012/07/07

Functions for testing class MeshDisplay.

This file is part of the DGtal library.

Definition in file testMeshDisplay.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

[MeshUseInitDisplay]

[MeshUseInitDisplay]

[MeshUseMeshCreation]

[MeshUseMeshCreation] [MeshUseDisplay]

[MeshUseDisplay]

Definition at line 51 of file testMeshDisplay.cpp.

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}
Structure representing an RGB triple with alpha component.
Definition Color.h:77
static const Color Blue
Definition Color.h:428
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition Mesh.h:92
std::vector< Index > MeshFace
Definition Mesh.h:126
void show() override
Starts the event loop and display of elements.
Space::Point Point
Definition StdDefs.h:168
Trace trace

References DGtal::Mesh< TPoint >::addFace(), DGtal::Mesh< TPoint >::addQuadFace(), DGtal::Mesh< TPoint >::addTriangularFace(), DGtal::Mesh< TPoint >::addVertex(), DGtal::Color::Blue, DGtal::PolyscopeViewer< Space, KSpace >::show(), and DGtal::trace.