MEPP2 Project
FEVV
DataStructures
AIF
AIFEdgeComparator.inl
Go to the documentation of this file.
1
// Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2
// All rights reserved.
3
//
4
// This file is part of MEPP2; you can redistribute it and/or modify
5
// it under the terms of the GNU Lesser General Public License as
6
// published by the Free Software Foundation; either version 3 of
7
// the License, or (at your option) any later version.
8
//
9
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11
12
namespace
FEVV
{
13
namespace
DataStructures {
14
namespace
AIF {
15
16
inline
17
bool
18
AIFEdgeComparator::operator()
(
const
AIFEdge
&e1,
const
AIFEdge
&e2)
19
{
20
// compare the min vertex of each edge
21
AIFEdge::ptr_vertex
minVertexE1 = std::min< AIFEdge::ptr_vertex >(
22
e1.
m_incident_vertices
[0], e1.
m_incident_vertices
[1]);
23
AIFEdge::ptr_vertex
minVertexE2 = std::min< AIFEdge::ptr_vertex >(
24
e2.
m_incident_vertices
[0], e2.
m_incident_vertices
[1]);
25
if
(minVertexE1 != minVertexE2)
26
return
minVertexE1 < minVertexE2;
27
28
// if min vertices are equal, then compare the max vertex of each edge
29
AIFEdge::ptr_vertex
maxVertexE1 = std::max< AIFEdge::ptr_vertex >(
30
e1.
m_incident_vertices
[0], e1.
m_incident_vertices
[1]);
31
AIFEdge::ptr_vertex
maxVertexE2 = std::max< AIFEdge::ptr_vertex >(
32
e2.
m_incident_vertices
[0], e2.
m_incident_vertices
[1]);
33
return
maxVertexE1 < maxVertexE2;
34
}
35
36
}
// namespace AIF
37
}
// namespace DataStructures
38
}
// namespace FEVV
FEVV::DataStructures::AIF::AIFEdge::m_incident_vertices
VertexContainerType m_incident_vertices
Definition:
AIFEdge.hpp:76
FEVV::DataStructures::AIF::AIFEdgeComparator::operator()
bool operator()(const AIFEdge &e1, const AIFEdge &e2)
Definition:
AIFEdgeComparator.inl:18
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition:
Assert.h:16
FEVV::DataStructures::AIF::AIFEdge
This class represents an edge used by AIFMesh objects. An AIFEdge natively saves relations with its i...
Definition:
AIFEdge.hpp:49
FEVV::DataStructures::AIF::AIFEdge::ptr_vertex
boost::shared_ptr< vertex_type > ptr_vertex
Definition:
AIFEdge.hpp:61
Generated by
1.8.20