mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added curvedEdges::compare(const edge&)
This commit is contained in:
@ -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
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user