Salome HOME
Merge changes from 'master' branch.
[modules/homard.git] / src / FrontTrack / FrontTrack_NodeGroups.hxx
1 // File      : FrontTrack_NodeGroups.hxx
2 // Created   : Tue Apr 25 19:02:49 2017
3 // Author    : Edward AGAPOV (eap)
4
5 #ifndef __FrontTrack_NodeGroups_HXX__
6 #define __FrontTrack_NodeGroups_HXX__
7
8 #include "FrontTrack_NodesOnGeom.hxx"
9 #include "FrontTrack_Projector.hxx"
10
11 #include <vector>
12 #include <string>
13
14 namespace MEDCoupling {
15   class DataArrayDouble;
16 }
17 namespace XAO {
18   class Xao;
19 }
20
21 /*!
22  * \brief Container of node groups.
23  */
24 class FT_NodeGroups
25 {
26 public:
27
28   // Load node groups from files
29   void read( const std::vector< std::string >& nodeFiles,
30              const XAO::Xao*                   xaoGeom,
31              MEDCoupling::DataArrayDouble*     nodeCoords );
32
33   // return number of groups of nodes to move
34   int nbOfGroups() const { return _nodesOnGeom.size(); }
35
36   // Move nodes of a group in parallel mode
37   void operator() ( const int groupIndex ) const
38   {
39     const_cast< FT_NodeGroups* >( this )->projectAndMove( groupIndex );
40   }
41
42   // Project and move nodes of a given group of nodes
43   void projectAndMove( const int groupIndex );
44
45   // return true if all nodes were successfully relocated
46   bool isOK() const;
47
48   // print some statistics on node groups
49   void dumpStat() const;
50
51 private:
52
53   std::vector< FT_NodesOnGeom > _nodesOnGeom;
54   std::vector< FT_Projector >   _projectors[2]; // curves and surfaces separately
55
56 };
57
58 #endif