fw4spl
tests/fwTest/include/fwTest/generator/Mesh.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWTEST_GENERATOR_MESH_HPP__
8 #define __FWTEST_GENERATOR_MESH_HPP__
9 
10 #include "fwTest/config.hpp"
11 
12 #include <fwCore/base.hpp>
13 
14 #include <fwData/Mesh.hpp>
15 
16 #include <fwDataTools/Vector.hxx>
17 #include <fwDataTools/helper/Mesh.hpp>
18 
19 
20 namespace fwTest
21 {
22 namespace generator
23 {
24 
25 
29 class Mesh
30 {
31 
32 public:
33 
34  typedef std::map< ::fwDataTools::Point, ::fwData::Mesh::Id> PointsMapType;
35 
36 
40  FWTEST_API static void initRand();
41 
46  FWTEST_API static void generateMesh( ::fwData::Mesh::sptr mesh );
47 
48 
57  FWTEST_API static void addQuadMesh(::fwData::Mesh::sptr mesh,
58  PointsMapType& points,
59  size_t nbPointsByEdge = 10,
60  float edgeDim = 100.);
61 
70  FWTEST_API static void addTriangleMesh(::fwData::Mesh::sptr mesh,
71  PointsMapType& points,
72  size_t nbPointsByEdge = 10,
73  float edgeDim = 100.);
74 
80  FWTEST_API static void generateQuadMesh(::fwData::Mesh::sptr mesh);
81 
87  FWTEST_API static void generateTriangleMesh(::fwData::Mesh::sptr mesh);
88 
95  FWTEST_API static void generateTriangleQuadMesh(::fwData::Mesh::sptr mesh);
96 
97 
98 protected:
99 
100  FWTEST_API static ::fwData::Mesh::Id addPoint(::fwData::Mesh::PointValueType* pt,
101  ::fwDataTools::helper::Mesh::sptr meshHelper,
102  PointsMapType& points);
103 
104 
105 };
106 
107 } // namespace generator
108 } // namespace fwTest
109 
110 #endif // __FWTEST_GENERATOR_MESH_HPP__
static FWTEST_API void addQuadMesh(::fwData::Mesh::sptr mesh, PointsMapType &points, size_t nbPointsByEdge=10, float edgeDim=100.)
Add quad cells in mesh, this method generates synthetic data (two face of a cube).
static FWTEST_API void initRand()
Initialize &#39;rand&#39; seed.
This helper generates a mesh using specified structure (quad or triangle).
Definition: Data.hpp:15
static FWTEST_API void addTriangleMesh(::fwData::Mesh::sptr mesh, PointsMapType &points, size_t nbPointsByEdge=10, float edgeDim=100.)
Add triangle cells in mesh, this method generates synthetic data (two face of a cube).
static FWTEST_API void generateQuadMesh(::fwData::Mesh::sptr mesh)
Generate a quad mesh.
static FWTEST_API void generateTriangleQuadMesh(::fwData::Mesh::sptr mesh)
Generate a mesh with quad and triangle cells.
static FWTEST_API void generateMesh(::fwData::Mesh::sptr mesh)
Generate a mesh.
static FWTEST_API void generateTriangleMesh(::fwData::Mesh::sptr mesh)
Generate a triangle mesh.