DGtal  1.1.0
mesh3DConstructionAndVisualisation.cpp File Reference
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Mesh.h"
#include "DGtal/io/viewers/Viewer3D.h"
Include dependency graph for mesh3DConstructionAndVisualisation.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/.

Date
2013/01/10

Example of Mesh construction and visualisation.

This file is part of the DGtal library.

Definition in file mesh3DConstructionAndVisualisation.cpp.

## ◆ main()

 int main ( int argc, char ** argv )

[MeshUseInitDisplay]

[MeshUseInitDisplay]

[MeshUseMeshCreation]

[MeshUseMeshConstructor]

[MeshUseMeshConstructor]

[MeshUseDisplay]

[MeshUseDisplay]

Definition at line 53 of file mesh3DConstructionAndVisualisation.cpp.

54 {
55
57  QApplication application(argc,argv);
58  Viewer3D<> viewer;
59  viewer.show();
61
62
64  // A mesh is constructed and faces are added from the vertex set.
66  Mesh<Point> aMesh(true);
68
74
79
90
92  vector<unsigned int> listIndex;
93  listIndex.push_back(7);
94  listIndex.push_back(8);
95  listIndex.push_back(9);
96  listIndex.push_back(10);
97  listIndex.push_back(11);
98  listIndex.push_back(12);
102
104  viewer.setLineColor(Color(150,0,0,254));
105  viewer << aMesh;
106  viewer << Viewer3D<>::updateDisplay;
108  bool res = application.exec();
109  FATAL_ERROR(res);
110  return 0;
111 }
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition: Color.h:67
DGtal::Viewer3D
Definition: Viewer3D.h:133
DGtal::Mesh
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:92
DGtal::Display3D< SpaceND< 3 >, KhalimskySpaceND< 3 > >::setLineColor
virtual void setLineColor(DGtal::Color aColor)
DGtal::Viewer3D::show
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Point
MyPointD Point
Definition: testClone2.cpp:383