xmsmesh  1.0
MeWeightMatcher.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
10 
11 // 3. Standard library headers
12 #include <vector>
13 
14 // 4. External library headers
15 
16 // 5. Shared code headers
19 #include <xmscore/stl/vector.h>
20 
21 //----- Forward declarations ---------------------------------------------------
22 
23 //----- Namespace declaration --------------------------------------------------
24 
25 namespace xms
26 {
27 //----- Constants / Enumerations -----------------------------------------------
28 
29 //----- Structs / Classes ------------------------------------------------------
30 
36 struct MeEdge
37 {
42  MeEdge(int a_f0, int a_f1, int a_weight)
43  : m_f0(a_f0)
44  , m_f1(a_f1)
45  , m_weight(a_weight)
46  {
47  }
48 
52  bool operator==(const MeEdge& a_rhs) const
53  {
54  return m_f0 == a_rhs.m_f0 && m_f1 == a_rhs.m_f1 && m_weight == a_rhs.m_weight;
55  }
56 
57  int m_f0;
58  int m_f1;
59  int m_weight;
60 
61 }; // struct MeEdge
62 
63 typedef std::vector<MeEdge> VecMeEdge;
64 
66 {
67 public:
68  static BSHP<MeWeightMatcher> New();
70  virtual ~MeWeightMatcher();
71 
73  virtual VecInt MatchWeights(const VecMeEdge& a_edges, bool maxcardinality = false) = 0;
74 
75 private:
78 }; // class MeWeightMatcher
79 
80 //----- Function prototypes ----------------------------------------------------
81 
82 } // namespace xms
std::vector< int > VecInt
static BSHP< MeWeightMatcher > New()
Create new weight matcher.
int m_weight
The weight assigned to the edge.
bool operator==(const MeEdge &a_rhs) const
MeWeightMatcher()
Constructor.
MeEdge(int a_f0, int a_f1, int a_weight)
#define XM_DISALLOW_COPY_AND_ASSIGN(TypeName)
int m_f1
Index of one of the adjacent faces.
int m_f0
Index of one of the adjacent faces.
std::vector< MeEdge > VecMeEdge
Vector of MeEdge.
virtual ~MeWeightMatcher()
Destructor.