fw4spl
AlgoMeshDeformation.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "Tuto14MeshGenerator/config.hpp"
10 
11 #include <fwData/Array.hpp>
12 #include <fwData/Mesh.hpp>
13 
14 #include <fwDataTools/helper/Mesh.hpp>
15 
16 #include <fwTools/Failed.hpp>
17 
18 namespace Tuto14MeshGenerator
19 {
20 
21 class TUTO14MESHGENERATOR_CLASS_API AlgoMeshDeformation
22 {
23 public:
24 
26  TUTO14MESHGENERATOR_API AlgoMeshDeformation() noexcept;
27 
29  TUTO14MESHGENERATOR_API virtual ~AlgoMeshDeformation() noexcept;
30 
34  TUTO14MESHGENERATOR_API void setParam( ::fwData::Mesh::sptr _mesh,
35  const unsigned int _step,
36  const unsigned int _amplitude);
37 
41  TUTO14MESHGENERATOR_API void initSimu();
42 
46  TUTO14MESHGENERATOR_API void computeSimu();
47 
49  TUTO14MESHGENERATOR_API void computeDeformation( ::fwData::Mesh::sptr _mesh,
50  const unsigned int _nbStep,
51  const unsigned int _amplitude );
52 
53 private:
54 
58  unsigned int m_nbStep;
59 
60  ::fwData::Mesh::wptr m_mesh;
61  ::fwDataTools::helper::Mesh::sptr m_meshHelper;
62  ::fwData::Array::sptr m_originPoints;
63 
64  unsigned int m_amplitude;
65  unsigned int m_step;
66  int m_direction;
67  size_t m_nbPoints;
68  size_t m_nbCells;
69  float m_yCenter;
70 };
71 
72 } // namespace Tuto14MeshGenerator
73