diff --git a/CDT/include/CDTUtils.hpp b/CDT/include/CDTUtils.hpp index 443b828..001098a 100644 --- a/CDT/include/CDTUtils.hpp +++ b/CDT/include/CDTUtils.hpp @@ -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) @@ -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 diff --git a/CDT/include/Triangulation.hpp b/CDT/include/Triangulation.hpp index 5dbcc61..036eb92 100644 --- a/CDT/include/Triangulation.hpp +++ b/CDT/include/Triangulation.hpp @@ -581,14 +581,15 @@ void Triangulation::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); } @@ -764,11 +765,12 @@ void Triangulation::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);