added curvedEdges::compare(const edge&)

This commit is contained in:
Mark Olesen
2009-10-07 21:16:21 +02:00
parent da62572187
commit 4bc523b593
2 changed files with 19 additions and 17 deletions

View File

@ -37,6 +37,7 @@ SourceFiles
#ifndef curvedEdges_H
#define curvedEdges_H
#include "edge.H"
#include "pointField.H"
#include "typeInfo.H"
#include "HashTable.H"
@ -123,6 +124,12 @@ public:
// - -1: same edge, but different orientation
inline int compare(const curvedEdge&) const;
//- Compare the given start and end points with this curve
// - 0: different
// - +1: identical
// - -1: same edge, but different orientation
inline int compare(const edge&) const;
//- Compare the given start and end points with this curve
// - 0: different
// - +1: identical

View File

@ -38,23 +38,6 @@ inline Foam::label Foam::curvedEdge::end() const
}
inline int Foam::curvedEdge::compare(const curvedEdge& ce) const
{
if (start_ == ce.start_ && end_ == ce.end_)
{
return 1;
}
else if (start_ == ce.end_ && end_ == ce.start_)
{
return -1;
}
else
{
return 0;
}
}
inline int Foam::curvedEdge::compare(const label start, const label end) const
{
if (start_ == start && end_ == end)
@ -72,6 +55,18 @@ inline int Foam::curvedEdge::compare(const label start, const label end) const
}
inline int Foam::curvedEdge::compare(const curvedEdge& e) const
{
return Foam::curvedEdge::compare(e.start(), e.end());
}
inline int Foam::curvedEdge::compare(const edge& e) const
{
return Foam::curvedEdge::compare(e.start(), e.end());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //