Skip to content
Snippets Groups Projects
Commit 4bc523b5 authored by Mark Olesen's avatar Mark Olesen
Browse files

added curvedEdges::compare(const edge&)

parent da625721
No related merge requests found
...@@ -37,6 +37,7 @@ SourceFiles ...@@ -37,6 +37,7 @@ SourceFiles
#ifndef curvedEdges_H #ifndef curvedEdges_H
#define curvedEdges_H #define curvedEdges_H
#include "edge.H"
#include "pointField.H" #include "pointField.H"
#include "typeInfo.H" #include "typeInfo.H"
#include "HashTable.H" #include "HashTable.H"
...@@ -123,6 +124,12 @@ public: ...@@ -123,6 +124,12 @@ public:
// - -1: same edge, but different orientation // - -1: same edge, but different orientation
inline int compare(const curvedEdge&) const; 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 //- Compare the given start and end points with this curve
// - 0: different // - 0: different
// - +1: identical // - +1: identical
......
...@@ -38,13 +38,13 @@ inline Foam::label Foam::curvedEdge::end() const ...@@ -38,13 +38,13 @@ inline Foam::label Foam::curvedEdge::end() const
} }
inline int Foam::curvedEdge::compare(const curvedEdge& ce) const inline int Foam::curvedEdge::compare(const label start, const label end) const
{ {
if (start_ == ce.start_ && end_ == ce.end_) if (start_ == start && end_ == end)
{ {
return 1; return 1;
} }
else if (start_ == ce.end_ && end_ == ce.start_) else if (start_ == end && end_ == start)
{ {
return -1; return -1;
} }
...@@ -55,20 +55,15 @@ inline int Foam::curvedEdge::compare(const curvedEdge& ce) const ...@@ -55,20 +55,15 @@ inline int Foam::curvedEdge::compare(const curvedEdge& ce) const
} }
inline int Foam::curvedEdge::compare(const label start, const label end) const inline int Foam::curvedEdge::compare(const curvedEdge& e) const
{ {
if (start_ == start && end_ == end) return Foam::curvedEdge::compare(e.start(), e.end());
{ }
return 1;
}
else if (start_ == end && end_ == start) inline int Foam::curvedEdge::compare(const edge& e) const
{ {
return -1; return Foam::curvedEdge::compare(e.start(), e.end());
}
else
{
return 0;
}
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment