Skip to content

Commit

Permalink
Small fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-ogre committed Nov 13, 2023
1 parent eeae3a7 commit 4227bb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CDT/include/CDTUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ CDT_INLINE_IF_HEADER_ONLY Index opoNbr(const Index vertIndex)
if(vertIndex == Index(2))
return Index(0);
assert(false && "Invalid vertex index");
throw std::runtime_error("Invalid vertex index");
}

CDT_INLINE_IF_HEADER_ONLY Index opoVrt(const Index neighborIndex)
Expand All @@ -175,6 +176,7 @@ CDT_INLINE_IF_HEADER_ONLY Index opoVrt(const Index neighborIndex)
if(neighborIndex == Index(2))
return Index(1);
assert(false && "Invalid neighbor index");
throw std::runtime_error("Invalid neighbor index");
}

CDT_INLINE_IF_HEADER_ONLY Index
Expand Down
14 changes: 8 additions & 6 deletions CDT/include/Triangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,15 @@ void Triangulation<T, TNearPointLocator>::insertEdgeIteration(
// make sure to report original input edges in the exception
Edge e1 = originalEdge;
Edge e2 = Edge(iVL, iVR);
e2 = pieceToOriginals.count(e2) ? pieceToOriginals[e2].front()
: e2;
e2 = pieceToOriginals.count(e2)
? pieceToOriginals.at(e2).front()
: e2;
// 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 IntersectingConstraintsError(
e1,
pieceToOriginals.count(e2) ? pieceToOriginals[e2].front()
pieceToOriginals.count(e2) ? pieceToOriginals.at(e2).front()
: e2,
CDT_SOURCE_LOCATION);
}
Expand Down Expand Up @@ -764,11 +765,12 @@ void Triangulation<T, TNearPointLocator>::conformToEdgeIteration(
{
// make sure to report original input edges in the exception
Edge e1 = pieceToOriginals.count(edge)
? pieceToOriginals[e1].front()
? pieceToOriginals.at(edge).front()
: edge;
Edge e2(iVleft, iVright);
e2 = pieceToOriginals.count(e2) ? pieceToOriginals[e2].front()
: e2;
e2 = pieceToOriginals.count(e2)
? pieceToOriginals.at(e2).front()
: e2;
// 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);
Expand Down

0 comments on commit 4227bb2

Please sign in to comment.