Skip to content

Commit

Permalink
Polish intersecting constraints error
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-ogre committed Nov 11, 2023
1 parent 0459ccc commit 14cfa2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions CDT/include/Triangulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ class DuplicateVertexError : public Error
* Error thrown when intersecting constraint edges are detected, but
* triangulation is not configured to attempt to resolve them
*/
class IntersectingConstraintsNotAllowed : public Error
class IntersectingConstraintsError : public Error
{
public:
IntersectingConstraintsNotAllowed(
IntersectingConstraintsError(
const Edge& e1,
const Edge& e2,
const SourceLocation& srcLoc)
Expand All @@ -227,6 +227,14 @@ class IntersectingConstraintsNotAllowed : public Error
, m_e1(e1)
, m_e2(e2)
{}
const Edge& e1() const
{
return m_e1;
}
const Edge& e2() const
{
return m_e2;
}

private:
Edge m_e1, m_e2;
Expand Down
4 changes: 2 additions & 2 deletions CDT/include/Triangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void Triangulation<T, TNearPointLocator>::insertEdgeIteration(
// don't count super-triangle vertices
e1 = Edge(e1.v1() - m_nTargetVerts, e1.v2() - m_nTargetVerts);
e2 = Edge(e2.v1() - m_nTargetVerts, e2.v2() - m_nTargetVerts);
throw IntersectingConstraintsNotAllowed(
throw IntersectingConstraintsError(
e1,
pieceToOriginals.count(e2) ? pieceToOriginals[e2].front()
: e2,
Expand Down Expand Up @@ -776,7 +776,7 @@ void Triangulation<T, TNearPointLocator>::conformToEdgeIteration(
// don't count super-triangle vertices
e1 = Edge(e1.v1() - m_nTargetVerts, e1.v2() - m_nTargetVerts);
e2 = Edge(e2.v1() - m_nTargetVerts, e2.v2() - m_nTargetVerts);
throw IntersectingConstraintsNotAllowed(
throw IntersectingConstraintsError(
e1, e2, CDT_SOURCE_LOCATION);
}
break;
Expand Down

0 comments on commit 14cfa2f

Please sign in to comment.