From 1dfe29d796966cc9635b81672f1e5806b1af3d8b Mon Sep 17 00:00:00 2001 From: artem-ogre Date: Wed, 4 Oct 2023 23:18:53 +0200 Subject: [PATCH] #142 Bugfixes and refactoring - Fix multiple hanging edges, add regression tests - Fix zeroes in `overlapCount`, fix tests - Refactor splitting edge --- CDT/include/CDTUtils.h | 3 + CDT/include/CDTUtils.hpp | 5 + CDT/include/Triangulation.h | 34 ++- CDT/include/Triangulation.hpp | 214 +++++++++--------- CDT/tests/cdt.test.cpp | 48 +++- ...gingIntersection__f64_auto_resolve_all.txt | 4 +- .../corner cases__as-provided_resolve_all.txt | 5 +- ...corner cases__as-provided_resolve_auto.txt | 5 +- ...orner cases__as-provided_resolve_outer.txt | 5 +- ...orner cases__as-provided_resolve_super.txt | 5 +- .../corner cases__auto_resolve_all.txt | 5 +- .../corner cases__auto_resolve_auto.txt | 5 +- .../corner cases__auto_resolve_outer.txt | 5 +- .../corner cases__auto_resolve_super.txt | 5 +- .../crossing-edges__auto_resolve_all.txt | 4 +- ...ersection__f64_as-provided_resolve_all.txt | 4 +- ...double-hanging__as-provided_ignore_all.txt | 23 ++ ...ouble-hanging__as-provided_ignore_auto.txt | 8 + ...uble-hanging__as-provided_ignore_outer.txt | 8 + ...uble-hanging__as-provided_ignore_super.txt | 15 ++ ...ouble-hanging__as-provided_resolve_all.txt | 23 ++ ...uble-hanging__as-provided_resolve_auto.txt | 8 + ...ble-hanging__as-provided_resolve_outer.txt | 8 + ...ble-hanging__as-provided_resolve_super.txt | 15 ++ .../double-hanging__auto_ignore_all.txt | 23 ++ .../double-hanging__auto_ignore_auto.txt | 8 + .../double-hanging__auto_ignore_outer.txt | 8 + .../double-hanging__auto_ignore_super.txt | 15 ++ .../double-hanging__auto_resolve_all.txt | 23 ++ .../double-hanging__auto_resolve_auto.txt | 8 + .../double-hanging__auto_resolve_outer.txt | 8 + .../double-hanging__auto_resolve_super.txt | 15 ++ ...e-hanging__conforming_auto_ignore_auto.txt | 31 +++ ...e-hanging-edge__as-provided_ignore_all.txt | 35 +++ ...-hanging-edge__as-provided_ignore_auto.txt | 23 ++ ...hanging-edge__as-provided_ignore_outer.txt | 23 ++ ...hanging-edge__as-provided_ignore_super.txt | 28 +++ ...-hanging-edge__as-provided_resolve_all.txt | 35 +++ ...hanging-edge__as-provided_resolve_auto.txt | 23 ++ ...anging-edge__as-provided_resolve_outer.txt | 23 ++ ...anging-edge__as-provided_resolve_super.txt | 28 +++ ...2-double-hanging-edge__auto_ignore_all.txt | 35 +++ ...-double-hanging-edge__auto_ignore_auto.txt | 23 ++ ...double-hanging-edge__auto_ignore_outer.txt | 23 ++ ...double-hanging-edge__auto_ignore_super.txt | 28 +++ ...-double-hanging-edge__auto_resolve_all.txt | 35 +++ ...double-hanging-edge__auto_resolve_auto.txt | 23 ++ ...ouble-hanging-edge__auto_resolve_outer.txt | 23 ++ ...ouble-hanging-edge__auto_resolve_super.txt | 28 +++ ...ging-edge__conforming_auto_ignore_auto.txt | 87 +++++++ ...anging-flipped__as-provided_ignore_all.txt | 25 ++ ...nging-flipped__as-provided_ignore_auto.txt | 8 + ...ging-flipped__as-provided_ignore_outer.txt | 8 + ...ging-flipped__as-provided_ignore_super.txt | 17 ++ ...nging-flipped__as-provided_resolve_all.txt | 25 ++ ...ging-flipped__as-provided_resolve_auto.txt | 8 + ...ing-flipped__as-provided_resolve_outer.txt | 8 + ...ing-flipped__as-provided_resolve_super.txt | 17 ++ ...riple-hanging-flipped__auto_ignore_all.txt | 25 ++ ...iple-hanging-flipped__auto_ignore_auto.txt | 8 + ...ple-hanging-flipped__auto_ignore_outer.txt | 8 + ...ple-hanging-flipped__auto_ignore_super.txt | 17 ++ ...iple-hanging-flipped__auto_resolve_all.txt | 25 ++ ...ple-hanging-flipped__auto_resolve_auto.txt | 8 + ...le-hanging-flipped__auto_resolve_outer.txt | 8 + ...le-hanging-flipped__auto_resolve_super.txt | 17 ++ ...g-flipped__conforming_auto_ignore_auto.txt | 31 +++ ...triple-hanging__as-provided_ignore_all.txt | 25 ++ ...riple-hanging__as-provided_ignore_auto.txt | 8 + ...iple-hanging__as-provided_ignore_outer.txt | 8 + ...iple-hanging__as-provided_ignore_super.txt | 17 ++ ...riple-hanging__as-provided_resolve_all.txt | 25 ++ ...iple-hanging__as-provided_resolve_auto.txt | 8 + ...ple-hanging__as-provided_resolve_outer.txt | 8 + ...ple-hanging__as-provided_resolve_super.txt | 17 ++ .../triple-hanging__auto_ignore_all.txt | 25 ++ .../triple-hanging__auto_ignore_auto.txt | 8 + .../triple-hanging__auto_ignore_outer.txt | 8 + .../triple-hanging__auto_ignore_super.txt | 17 ++ .../triple-hanging__auto_resolve_all.txt | 25 ++ .../triple-hanging__auto_resolve_auto.txt | 8 + .../triple-hanging__auto_resolve_outer.txt | 8 + .../triple-hanging__auto_resolve_super.txt | 17 ++ ...e-hanging__conforming_auto_ignore_auto.txt | 31 +++ CDT/tests/inputs/double-hanging.txt | 9 + .../inputs/issue-142-double-hanging-edge.txt | 19 ++ CDT/tests/inputs/triple-hanging-flipped.txt | 10 + CDT/tests/inputs/triple-hanging.txt | 10 + visualizer/main.cpp | 4 +- 89 files changed, 1550 insertions(+), 154 deletions(-) create mode 100644 CDT/tests/expected/double-hanging__as-provided_ignore_all.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_ignore_auto.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_ignore_outer.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_ignore_super.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_resolve_all.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_resolve_auto.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_resolve_outer.txt create mode 100644 CDT/tests/expected/double-hanging__as-provided_resolve_super.txt create mode 100644 CDT/tests/expected/double-hanging__auto_ignore_all.txt create mode 100644 CDT/tests/expected/double-hanging__auto_ignore_auto.txt create mode 100644 CDT/tests/expected/double-hanging__auto_ignore_outer.txt create mode 100644 CDT/tests/expected/double-hanging__auto_ignore_super.txt create mode 100644 CDT/tests/expected/double-hanging__auto_resolve_all.txt create mode 100644 CDT/tests/expected/double-hanging__auto_resolve_auto.txt create mode 100644 CDT/tests/expected/double-hanging__auto_resolve_outer.txt create mode 100644 CDT/tests/expected/double-hanging__auto_resolve_super.txt create mode 100644 CDT/tests/expected/double-hanging__conforming_auto_ignore_auto.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_all.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_auto.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_outer.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_super.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_all.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_auto.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_outer.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_super.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_all.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_auto.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_outer.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_super.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_all.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_auto.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_outer.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_super.txt create mode 100644 CDT/tests/expected/issue-142-double-hanging-edge__conforming_auto_ignore_auto.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_all.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_auto.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_outer.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_super.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_all.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_auto.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_outer.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_super.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_ignore_all.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_ignore_auto.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_ignore_outer.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_ignore_super.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_resolve_all.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_resolve_auto.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_resolve_outer.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__auto_resolve_super.txt create mode 100644 CDT/tests/expected/triple-hanging-flipped__conforming_auto_ignore_auto.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_ignore_all.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_ignore_auto.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_ignore_outer.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_ignore_super.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_resolve_all.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_resolve_auto.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_resolve_outer.txt create mode 100644 CDT/tests/expected/triple-hanging__as-provided_resolve_super.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_ignore_all.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_ignore_auto.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_ignore_outer.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_ignore_super.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_resolve_all.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_resolve_auto.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_resolve_outer.txt create mode 100644 CDT/tests/expected/triple-hanging__auto_resolve_super.txt create mode 100644 CDT/tests/expected/triple-hanging__conforming_auto_ignore_auto.txt create mode 100644 CDT/tests/inputs/double-hanging.txt create mode 100644 CDT/tests/inputs/issue-142-double-hanging-edge.txt create mode 100644 CDT/tests/inputs/triple-hanging-flipped.txt create mode 100644 CDT/tests/inputs/triple-hanging.txt diff --git a/CDT/include/CDTUtils.h b/CDT/include/CDTUtils.h index 89dae343..bc06b643 100644 --- a/CDT/include/CDTUtils.h +++ b/CDT/include/CDTUtils.h @@ -425,6 +425,9 @@ CDT_EXPORT T distance(const V2d& a, const V2d& b); template CDT_EXPORT T distanceSquared(const V2d& a, const V2d& b); +/// Check if any of triangle's vertices belongs to a super-triangle +CDT_EXPORT bool touchesSuperTriangle(const Triangle& t); + } // namespace CDT #ifndef CDT_USE_AS_COMPILED_LIBRARY diff --git a/CDT/include/CDTUtils.hpp b/CDT/include/CDTUtils.hpp index 2d58bb1c..bd9af3a8 100644 --- a/CDT/include/CDTUtils.hpp +++ b/CDT/include/CDTUtils.hpp @@ -300,4 +300,9 @@ T distanceSquared(const V2d& a, const V2d& b) return distanceSquared(a.x, a.y, b.x, b.y); } +bool touchesSuperTriangle(const Triangle& t) +{ + return t.vertices[0] < 3 || t.vertices[1] < 3 || t.vertices[2] < 3; +} + } // namespace CDT diff --git a/CDT/include/Triangulation.h b/CDT/include/Triangulation.h index d3526963..4177d033 100644 --- a/CDT/include/Triangulation.h +++ b/CDT/include/Triangulation.h @@ -509,9 +509,40 @@ class CDT_EXPORT Triangulation */ void finalizeTriangulation(const TriIndUSet& removedTriangles); TriIndUSet growToBoundary(std::stack seeds) const; - void fixEdge(const Edge& edge, BoundaryOverlapCount overlaps); void fixEdge(const Edge& edge); void fixEdge(const Edge& edge, const Edge& originalEdge); + /** + * Split existing constraint (fixed) edge + * @param edge fixed edge to split + * @param iSplitVert index of the vertex to be used as a split vertex + */ + void splitFixedEdge(const Edge& edge, const VertInd iSplitVert); + /** + * Add a vertex that splits an edge into the triangulation + * @param splitVert position of split vertex + * @param iT index of a first triangle adjacent to the split edge + * @param iTopo index of a second triangle adjacent to the split edge + * (opposed to the first triangle) + * @return index of a newly added split vertex + */ + VertInd addSplitEdgeVertex( + const V2d& splitVert, + const TriInd iT, + const TriInd iTopo); + /** + * Split fixed edge and add a split vertex into the triangulation + * @param edge fixed edge to split + * @param splitVert position of split vertex + * @param iT index of a first triangle adjacent to the split edge + * @param iTopo index of a second triangle adjacent to the split edge + * (opposed to the first triangle) + * @return index of a newly added split vertex + */ + VertInd splitFixedEdgeAt( + const Edge& edge, + const V2d& splitVert, + const TriInd iT, + const TriInd iTopo); /** * Flag triangle as dummy * @note Advanced method for manually modifying the triangulation from @@ -551,6 +582,7 @@ class CDT_EXPORT Triangulation VertInd superGeomVertCount, V2d boxMin, V2d boxMax); + std::pair edgeTriangles(VertInd a, VertInd b) const; bool hasEdge(VertInd a, VertInd b) const; void setAdjacentTriangle(const VertInd v, const TriInd t); void pivotVertexTriangleCW(VertInd v); diff --git a/CDT/include/Triangulation.hpp b/CDT/include/Triangulation.hpp index dd0debdb..d65ca199 100644 --- a/CDT/include/Triangulation.hpp +++ b/CDT/include/Triangulation.hpp @@ -136,8 +136,7 @@ void Triangulation::eraseSuperTriangle() TriIndUSet toErase; for(TriInd iT(0); iT < TriInd(triangles.size()); ++iT) { - Triangle& t = triangles[iT]; - if(t.vertices[0] < 3 || t.vertices[1] < 3 || t.vertices[2] < 3) + if(touchesSuperTriangle(triangles[iT])) toErase.insert(iT); } finalizeTriangulation(toErase); @@ -402,22 +401,74 @@ void insert_unique( } // namespace detail template -void Triangulation::fixEdge( +void Triangulation::splitFixedEdge( const Edge& edge, - const Edge& originalEdge) + const VertInd iSplitVert) +{ + // split constraint (fixed) edge that already exists in triangulation + const Edge half1(edge.v1(), iSplitVert); + const Edge half2(iSplitVert, edge.v2()); + // remove the edge that and add its halves + fixedEdges.erase(edge); + fixEdge(half1); + fixEdge(half2); + // maintain overlaps + typedef unordered_map::const_iterator It; + const It overlapIt = overlapCount.find(edge); + if(overlapIt != overlapCount.end()) + { + overlapCount[half1] += overlapIt->second; + overlapCount[half2] += overlapIt->second; + overlapCount.erase(overlapIt); + } + // maintain piece-to-original mapping + EdgeVec newOriginals(1, edge); + const unordered_map::const_iterator originalsIt = + pieceToOriginals.find(edge); + if(originalsIt != pieceToOriginals.end()) + { // edge being split was split before: pass-through originals + newOriginals = originalsIt->second; + pieceToOriginals.erase(originalsIt); + } + detail::insert_unique(pieceToOriginals[half1], newOriginals); + detail::insert_unique(pieceToOriginals[half2], newOriginals); +} + +template +VertInd Triangulation::addSplitEdgeVertex( + const V2d& splitVert, + const TriInd iT, + const TriInd iTopo) { - fixEdge(edge); - if(edge != originalEdge) - detail::insert_unique(pieceToOriginals[edge], originalEdge); + // add a new point on the edge that splits an edge in two + const VertInd iSplitVert = static_cast(vertices.size()); + addNewVertex(splitVert, noNeighbor); + std::stack triStack = insertVertexOnEdge(iSplitVert, iT, iTopo); + tryAddVertexToLocator(iSplitVert); + ensureDelaunayByEdgeFlips(splitVert, iSplitVert, triStack); + return iSplitVert; +} + +template +VertInd Triangulation::splitFixedEdgeAt( + const Edge& edge, + const V2d& splitVert, + const TriInd iT, + const TriInd iTopo) +{ + const VertInd iSplitVert = addSplitEdgeVertex(splitVert, iT, iTopo); + splitFixedEdge(edge, iSplitVert); + return iSplitVert; } template void Triangulation::fixEdge( const Edge& edge, - const BoundaryOverlapCount overlaps) + const Edge& originalEdge) { - fixedEdges.insert(edge); - overlapCount[edge] = overlaps; // override overlap counter + fixEdge(edge); + if(edge != originalEdge) + detail::insert_unique(pieceToOriginals[edge], originalEdge); } namespace detail @@ -508,6 +559,8 @@ void Triangulation::insertEdgeIteration( polyR.push_back(iVR); outerTrisR.push_back(edgeNeighbor(t, iA, iVR)); VertInd iV = iA; + IndexSizeType nChainedHangingEdgesL = 0; + IndexSizeType nChainedHangingEdgesR = 0; while(!t.containsVertex(iB)) { @@ -520,38 +573,11 @@ void Triangulation::insertEdgeIteration( IntersectingConstraintEdges::Resolve && fixedEdges.count(Edge(iVL, iVR))) { - const VertInd iNewVert = static_cast(vertices.size()); - - // split constraint edge that already exists in triangulation - const Edge splitEdge(iVL, iVR); - const Edge half1(iVL, iNewVert); - const Edge half2(iNewVert, iVR); - const BoundaryOverlapCount overlaps = overlapCount[splitEdge]; - // remove the edge that will be split - fixedEdges.erase(splitEdge); - overlapCount.erase(splitEdge); - // add split edge's halves - fixEdge(half1, overlaps); - fixEdge(half2, overlaps); - // maintain piece-to-original mapping - EdgeVec newOriginals(1, splitEdge); - const unordered_map::const_iterator originalsIt = - pieceToOriginals.find(splitEdge); - if(originalsIt != pieceToOriginals.end()) - { // edge being split was split before: pass-through originals - newOriginals = originalsIt->second; - pieceToOriginals.erase(originalsIt); - } - detail::insert_unique(pieceToOriginals[half1], newOriginals); - detail::insert_unique(pieceToOriginals[half2], newOriginals); - // add a new point at the intersection of two constraint edges + // split edge at the intersection of two constraint edges const V2d newV = detail::intersectionPosition( vertices[iA], vertices[iB], vertices[iVL], vertices[iVR]); - addNewVertex(newV, noNeighbor); - std::stack triStack = - insertVertexOnEdge(iNewVert, iT, iTopo); - tryAddVertexToLocator(iNewVert); - ensureDelaunayByEdgeFlips(newV, iNewVert, triStack); + const VertInd iNewVert = + splitFixedEdgeAt(Edge(iVL, iVR), newV, iT, iTopo); // TODO: is it's possible to re-use pseudo-polygons // for inserting [iA, iNewVert] edge half? remaining.push_back(Edge(iA, iNewVert)); @@ -565,17 +591,21 @@ void Triangulation::insertEdgeIteration( { // hanging edge check // previous entry of the vertex in poly if edge is hanging - const IndexSizeType prev = polyL.size() - 2; + const IndexSizeType prev = + (polyL.size() - 2) - 2 * nChainedHangingEdgesL; if(iVopo == polyL[prev]) { // hanging edge + ++nChainedHangingEdgesL; outerTrisL[prev] = noNeighbor; outerTrisL.push_back(noNeighbor); } else { // normal case + nChainedHangingEdgesL = 0; outerTrisL.push_back(edgeNeighbor(tOpo, polyL.back(), iVopo)); } polyL.push_back(iVopo); + removeAdjacentTriangle(iVopo); iV = iVL; iVL = iVopo; } @@ -583,17 +613,21 @@ void Triangulation::insertEdgeIteration( { // hanging edge check // previous entry of the vertex in poly if edge is hanging - const IndexSizeType prev = polyR.size() - 2; + const IndexSizeType prev = + (polyR.size() - 2) - 2 * nChainedHangingEdgesR; if(iVopo == polyR[prev]) { // hanging edge + ++nChainedHangingEdgesR; outerTrisR[prev] = noNeighbor; outerTrisR.push_back(noNeighbor); } else { // normal case + nChainedHangingEdgesR = 0; outerTrisR.push_back(edgeNeighbor(tOpo, polyR.back(), iVopo)); } polyR.push_back(iVopo); + removeAdjacentTriangle(iVopo); iV = iVR; iVR = iVopo; } @@ -620,13 +654,14 @@ void Triangulation::insertEdgeIteration( typedef std::vector::const_iterator TriIndCit; for(TriIndCit it = intersected.begin(); it != intersected.end(); ++it) makeDummy(*it); - // Triangulate pseudo-polygons on both sides - std::reverse(polyR.begin(), polyR.end()); - std::reverse(outerTrisR.begin(), outerTrisR.end()); - const TriInd iTL = addTriangle(); - const TriInd iTR = addTriangle(); - triangulatePseudopolygon(polyL, outerTrisL, iTL, iTR, tppIterations); - triangulatePseudopolygon(polyR, outerTrisR, iTR, iTL, tppIterations); + { // Triangulate pseudo-polygons on both sides + std::reverse(polyR.begin(), polyR.end()); + std::reverse(outerTrisR.begin(), outerTrisR.end()); + const TriInd iTL = addTriangle(); + const TriInd iTR = addTriangle(); + triangulatePseudopolygon(polyL, outerTrisL, iTL, iTR, tppIterations); + triangulatePseudopolygon(polyR, outerTrisR, iTR, iTL, tppIterations); + } if(iB != edge.v2()) // encountered point on the edge { @@ -674,7 +709,9 @@ void Triangulation::conformToEdgeIteration( if(hasEdge(iA, iB)) { - overlaps > 0 ? fixEdge(edge, overlaps) : fixEdge(edge); + fixEdge(edge); + if(overlaps > 0) + overlapCount[edge] = overlaps; // avoid marking edge as a part of itself if(!originals.empty() && edge != originals.front()) { @@ -696,7 +733,9 @@ void Triangulation::conformToEdgeIteration( if(iT == noNeighbor) { const Edge edgePart(iA, iVleft); - overlaps > 0 ? fixEdge(edgePart, overlaps) : fixEdge(edgePart); + fixEdge(edgePart); + if(overlaps > 0) + overlapCount[edgePart] = overlaps; detail::insert_unique(pieceToOriginals[edgePart], originals); #ifdef CDT_CXX11_IS_SUPPORTED remaining.emplace_back(Edge(iVleft, iB), originals, overlaps); @@ -721,56 +760,14 @@ void Triangulation::conformToEdgeIteration( IntersectingConstraintEdges::Resolve && fixedEdges.count(Edge(iVleft, iVright))) { - const VertInd iNewVert = static_cast(vertices.size()); - - // split constraint edge that already exists in triangulation - const Edge splitEdge(iVleft, iVright); - const Edge half1(iVleft, iNewVert); - const Edge half2(iNewVert, iVright); - - const unordered_map::const_iterator - splitEdgeOverlapsIt = overlapCount.find(splitEdge); - const BoundaryOverlapCount splitEdgeOverlaps = - splitEdgeOverlapsIt != overlapCount.end() - ? splitEdgeOverlapsIt->second - : 0; - // remove the edge that will be split and add split edge's - // halves - fixedEdges.erase(splitEdge); - if(splitEdgeOverlaps > 0) - { - overlapCount.erase(splitEdgeOverlapsIt); - fixEdge(half1, splitEdgeOverlaps); - fixEdge(half2, splitEdgeOverlaps); - } - else - { - fixEdge(half1); - fixEdge(half2); - } - // maintain piece-to-original mapping - EdgeVec newOriginals(1, splitEdge); - const unordered_map::const_iterator originalsIt = - pieceToOriginals.find(splitEdge); - if(originalsIt != pieceToOriginals.end()) - { // edge being split was split before: pass-through originals - newOriginals = originalsIt->second; - pieceToOriginals.erase(originalsIt); - } - detail::insert_unique(pieceToOriginals[half1], newOriginals); - detail::insert_unique(pieceToOriginals[half2], newOriginals); - - // add a new point at the intersection of two constraint edges + // split edge at the intersection of two constraint edges const V2d newV = detail::intersectionPosition( vertices[iA], vertices[iB], vertices[iVleft], vertices[iVright]); - addNewVertex(newV, noNeighbor); - std::stack triStack = - insertVertexOnEdge(iNewVert, iT, iTopo); - tryAddVertexToLocator(iNewVert); - ensureDelaunayByEdgeFlips(newV, iNewVert, triStack); + const VertInd iNewVert = + splitFixedEdgeAt(Edge(iVleft, iVright), newV, iT, iTopo); #ifdef CDT_CXX11_IS_SUPPORTED remaining.emplace_back(Edge(iNewVert, iB), originals, overlaps); remaining.emplace_back(Edge(iA, iNewVert), originals, overlaps); @@ -1633,7 +1630,7 @@ void Triangulation::triangulatePseudopolygonIteration( triangles[iParent].neighbors[iInParent] = iT; t.neighbors[0] = iParent; t.vertices = detail::arr3(a, b, c); - // needs to be done at the end not to affect finding edge triangles + setAdjacentTriangle(a, iT); setAdjacentTriangle(c, iT); } @@ -1954,23 +1951,34 @@ void Triangulation::insertVertices_KDTreeBFS( } template -bool Triangulation::hasEdge( +std::pair Triangulation::edgeTriangles( const VertInd a, const VertInd b) const { const TriInd triStart = m_vertTris[a]; assert(triStart != noNeighbor); - TriInd iT = triStart; + TriInd iT = triStart, iTNext = triStart; VertInd iV = noVertex; do { const Triangle& t = triangles[iT]; - tie(iT, iV) = t.next(a); - assert(iT != noNeighbor); + tie(iTNext, iV) = t.next(a); + assert(iTNext != noNeighbor); if(iV == b) - return true; + { + return std::make_pair(iT, iTNext); + } + iT = iTNext; } while(iT != triStart); - return false; + return std::make_pair(invalidIndex, invalidIndex); +} + +template +bool Triangulation::hasEdge( + const VertInd a, + const VertInd b) const +{ + return edgeTriangles(a, b).first != invalidIndex; } template diff --git a/CDT/tests/cdt.test.cpp b/CDT/tests/cdt.test.cpp index 268c824c..94544c73 100644 --- a/CDT/tests/cdt.test.cpp +++ b/CDT/tests/cdt.test.cpp @@ -498,29 +498,33 @@ TEMPLATE_LIST_TEST_CASE( const auto inputFile = GENERATE( as{}, "Capital A.txt", - "Hanging.txt", - "Hanging2.txt", - "Letter u.txt", - "OnEdge.txt", - "ProblematicCase1.txt", "cdt.txt", "corner cases.txt", "ditch.txt", + "double-hanging.txt", "gh_issue.txt", "guitar no box.txt", + "Hanging.txt", + "Hanging2.txt", "island.txt", + "issue-142-double-hanging-edge.txt", "issue-42-full-boundary-overlap.txt", "issue-42-hole-overlaps-bondary.txt", "issue-42-multiple-boundary-overlaps-conform-to-edge.txt", "issue-42-multiple-boundary-overlaps.txt", "issue-65-wrong-edges.txt", "kidney.txt", + "Letter u.txt", + "OnEdge.txt", "overlapping constraints.txt", "overlapping constraints2.txt", "points_on_constraint_edge.txt", + "ProblematicCase1.txt", "regression_issue_38_wrong_hull_small.txt", "square with crack.txt", "test_data_small.txt", + "triple-hanging-flipped.txt", + "triple-hanging.txt", "unit square.txt"); const auto typeSpecific = std::unordered_set{ @@ -609,15 +613,19 @@ TEMPLATE_LIST_TEST_CASE( const auto inputFile = GENERATE( as{}, "Capital A.txt", - "Hanging2.txt", - "ProblematicCase1.txt", "cdt.txt", "corner cases.txt", "ditch.txt", + "double-hanging.txt", "gh_issue.txt", "guitar no box.txt", + "Hanging2.txt", + "issue-142-double-hanging-edge.txt", "issue-42-multiple-boundary-overlaps.txt", "points_on_constraint_edge.txt", + "ProblematicCase1.txt", + "triple-hanging-flipped.txt", + "triple-hanging.txt", "unit square.txt"); const auto typeSpecific = std::unordered_set{ @@ -813,3 +821,29 @@ TEST_CASE( REQUIRE(topologyString(cdt) == topologyString(outFile)); } } + +TEST_CASE("Regression: multiple hanging edges", "") +{ + const auto inputFile = std::string("HangingIntersection.txt"); + const auto order = VertexInsertionOrder::Auto; + const auto intersectingEdgesStrategy = IntersectingConstraintEdges::Resolve; + const auto minDistToConstraintEdge = 1e-6; + const auto outFile = "expected/" + + inputFile.substr(0, inputFile.size() - 4) + "__f64_" + + to_string(order) + "_" + + to_string(intersectingEdgesStrategy) + "_all.txt"; + + const auto [vv, ee] = readInputFromFile("inputs/" + inputFile); + auto cdt = Triangulation( + order, intersectingEdgesStrategy, minDistToConstraintEdge); + cdt.insertVertices(vv); + cdt.insertEdges(ee); + REQUIRE(CDT::verifyTopology(cdt)); + + if(updateFiles) + topologyToFile(outFile, cdt); + else + { + REQUIRE(topologyString(cdt) == topologyString(outFile)); + } +} diff --git a/CDT/tests/expected/HangingIntersection__f64_auto_resolve_all.txt b/CDT/tests/expected/HangingIntersection__f64_auto_resolve_all.txt index 094c66bf..9a2c4cc0 100644 --- a/CDT/tests/expected/HangingIntersection__f64_auto_resolve_all.txt +++ b/CDT/tests/expected/HangingIntersection__f64_auto_resolve_all.txt @@ -23,9 +23,7 @@ 7 10 8 10 -2 -6 10 0 -8 10 0 +0 4 3 10 diff --git a/CDT/tests/expected/corner cases__as-provided_resolve_all.txt b/CDT/tests/expected/corner cases__as-provided_resolve_all.txt index ba05e9a0..2b14d246 100644 --- a/CDT/tests/expected/corner cases__as-provided_resolve_all.txt +++ b/CDT/tests/expected/corner cases__as-provided_resolve_all.txt @@ -50,14 +50,11 @@ 15 16 17 18 -7 +4 3 15 1 8 9 1 8 16 1 -9 17 0 -14 18 0 15 16 1 -17 18 0 15 3 15 diff --git a/CDT/tests/expected/corner cases__as-provided_resolve_auto.txt b/CDT/tests/expected/corner cases__as-provided_resolve_auto.txt index 5157d724..10f14c92 100644 --- a/CDT/tests/expected/corner cases__as-provided_resolve_auto.txt +++ b/CDT/tests/expected/corner cases__as-provided_resolve_auto.txt @@ -17,14 +17,11 @@ 12 13 14 15 -7 +4 0 12 1 5 6 1 5 13 1 -6 14 0 -11 15 0 12 13 1 -14 15 0 15 0 12 diff --git a/CDT/tests/expected/corner cases__as-provided_resolve_outer.txt b/CDT/tests/expected/corner cases__as-provided_resolve_outer.txt index 5157d724..10f14c92 100644 --- a/CDT/tests/expected/corner cases__as-provided_resolve_outer.txt +++ b/CDT/tests/expected/corner cases__as-provided_resolve_outer.txt @@ -17,14 +17,11 @@ 12 13 14 15 -7 +4 0 12 1 5 6 1 5 13 1 -6 14 0 -11 15 0 12 13 1 -14 15 0 15 0 12 diff --git a/CDT/tests/expected/corner cases__as-provided_resolve_super.txt b/CDT/tests/expected/corner cases__as-provided_resolve_super.txt index 81a5f885..f09f7c3c 100644 --- a/CDT/tests/expected/corner cases__as-provided_resolve_super.txt +++ b/CDT/tests/expected/corner cases__as-provided_resolve_super.txt @@ -37,14 +37,11 @@ 12 13 14 15 -7 +4 0 12 1 5 6 1 5 13 1 -6 14 0 -11 15 0 12 13 1 -14 15 0 15 0 12 diff --git a/CDT/tests/expected/corner cases__auto_resolve_all.txt b/CDT/tests/expected/corner cases__auto_resolve_all.txt index 425142ff..691b8366 100644 --- a/CDT/tests/expected/corner cases__auto_resolve_all.txt +++ b/CDT/tests/expected/corner cases__auto_resolve_all.txt @@ -50,14 +50,11 @@ 15 16 17 18 -7 +4 3 15 1 8 9 1 8 16 1 -9 17 0 -14 18 0 15 16 1 -17 18 0 15 3 15 diff --git a/CDT/tests/expected/corner cases__auto_resolve_auto.txt b/CDT/tests/expected/corner cases__auto_resolve_auto.txt index 5157d724..10f14c92 100644 --- a/CDT/tests/expected/corner cases__auto_resolve_auto.txt +++ b/CDT/tests/expected/corner cases__auto_resolve_auto.txt @@ -17,14 +17,11 @@ 12 13 14 15 -7 +4 0 12 1 5 6 1 5 13 1 -6 14 0 -11 15 0 12 13 1 -14 15 0 15 0 12 diff --git a/CDT/tests/expected/corner cases__auto_resolve_outer.txt b/CDT/tests/expected/corner cases__auto_resolve_outer.txt index 5157d724..10f14c92 100644 --- a/CDT/tests/expected/corner cases__auto_resolve_outer.txt +++ b/CDT/tests/expected/corner cases__auto_resolve_outer.txt @@ -17,14 +17,11 @@ 12 13 14 15 -7 +4 0 12 1 5 6 1 5 13 1 -6 14 0 -11 15 0 12 13 1 -14 15 0 15 0 12 diff --git a/CDT/tests/expected/corner cases__auto_resolve_super.txt b/CDT/tests/expected/corner cases__auto_resolve_super.txt index 3954f094..97c6bc57 100644 --- a/CDT/tests/expected/corner cases__auto_resolve_super.txt +++ b/CDT/tests/expected/corner cases__auto_resolve_super.txt @@ -37,14 +37,11 @@ 12 13 14 15 -7 +4 0 12 1 5 6 1 5 13 1 -6 14 0 -11 15 0 12 13 1 -14 15 0 15 0 12 diff --git a/CDT/tests/expected/crossing-edges__auto_resolve_all.txt b/CDT/tests/expected/crossing-edges__auto_resolve_all.txt index 74ecc2a1..cb65b043 100644 --- a/CDT/tests/expected/crossing-edges__auto_resolve_all.txt +++ b/CDT/tests/expected/crossing-edges__auto_resolve_all.txt @@ -17,9 +17,7 @@ 5 7 6 7 -2 -3 7 0 -5 7 0 +0 4 3 7 diff --git a/CDT/tests/expected/dont_flip_constraint_when_resolving_intersection__f64_as-provided_resolve_all.txt b/CDT/tests/expected/dont_flip_constraint_when_resolving_intersection__f64_as-provided_resolve_all.txt index 412543ad..5faa35b4 100644 --- a/CDT/tests/expected/dont_flip_constraint_when_resolving_intersection__f64_as-provided_resolve_all.txt +++ b/CDT/tests/expected/dont_flip_constraint_when_resolving_intersection__f64_as-provided_resolve_all.txt @@ -22,9 +22,7 @@ 5 9 6 9 -2 -3 9 0 -5 9 0 +0 4 3 9 diff --git a/CDT/tests/expected/double-hanging__as-provided_ignore_all.txt b/CDT/tests/expected/double-hanging__as-provided_ignore_all.txt new file mode 100644 index 00000000..f4265ff6 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_ignore_all.txt @@ -0,0 +1,23 @@ +15 +0 1 7 4294967295 5 4 +0 3 2 2 6 4294967295 +0 4 3 3 8 1 +0 6 4 4 8 2 +0 7 6 0 10 3 +1 2 7 4294967295 7 0 +2 3 9 1 12 7 +2 9 7 6 14 5 +3 4 6 2 3 10 +3 5 8 11 13 12 +3 6 7 8 4 11 +3 7 5 10 13 9 +3 8 9 9 14 6 +5 7 8 11 14 9 +7 9 8 7 12 13 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_ignore_auto.txt b/CDT/tests/expected/double-hanging__as-provided_ignore_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_ignore_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_ignore_outer.txt b/CDT/tests/expected/double-hanging__as-provided_ignore_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_ignore_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_ignore_super.txt b/CDT/tests/expected/double-hanging__as-provided_ignore_super.txt new file mode 100644 index 00000000..a31d19b4 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_ignore_super.txt @@ -0,0 +1,15 @@ +7 +0 1 3 4294967295 4294967295 2 +0 2 5 3 5 4 +0 3 4 0 4294967295 3 +0 4 2 2 5 1 +0 5 6 1 6 4294967295 +2 4 5 3 6 1 +4 6 5 4294967295 4 5 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_resolve_all.txt b/CDT/tests/expected/double-hanging__as-provided_resolve_all.txt new file mode 100644 index 00000000..f4265ff6 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_resolve_all.txt @@ -0,0 +1,23 @@ +15 +0 1 7 4294967295 5 4 +0 3 2 2 6 4294967295 +0 4 3 3 8 1 +0 6 4 4 8 2 +0 7 6 0 10 3 +1 2 7 4294967295 7 0 +2 3 9 1 12 7 +2 9 7 6 14 5 +3 4 6 2 3 10 +3 5 8 11 13 12 +3 6 7 8 4 11 +3 7 5 10 13 9 +3 8 9 9 14 6 +5 7 8 11 14 9 +7 9 8 7 12 13 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_resolve_auto.txt b/CDT/tests/expected/double-hanging__as-provided_resolve_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_resolve_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_resolve_outer.txt b/CDT/tests/expected/double-hanging__as-provided_resolve_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_resolve_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__as-provided_resolve_super.txt b/CDT/tests/expected/double-hanging__as-provided_resolve_super.txt new file mode 100644 index 00000000..a31d19b4 --- /dev/null +++ b/CDT/tests/expected/double-hanging__as-provided_resolve_super.txt @@ -0,0 +1,15 @@ +7 +0 1 3 4294967295 4294967295 2 +0 2 5 3 5 4 +0 3 4 0 4294967295 3 +0 4 2 2 5 1 +0 5 6 1 6 4294967295 +2 4 5 3 6 1 +4 6 5 4294967295 4 5 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_ignore_all.txt b/CDT/tests/expected/double-hanging__auto_ignore_all.txt new file mode 100644 index 00000000..f4265ff6 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_ignore_all.txt @@ -0,0 +1,23 @@ +15 +0 1 7 4294967295 5 4 +0 3 2 2 6 4294967295 +0 4 3 3 8 1 +0 6 4 4 8 2 +0 7 6 0 10 3 +1 2 7 4294967295 7 0 +2 3 9 1 12 7 +2 9 7 6 14 5 +3 4 6 2 3 10 +3 5 8 11 13 12 +3 6 7 8 4 11 +3 7 5 10 13 9 +3 8 9 9 14 6 +5 7 8 11 14 9 +7 9 8 7 12 13 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_ignore_auto.txt b/CDT/tests/expected/double-hanging__auto_ignore_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_ignore_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_ignore_outer.txt b/CDT/tests/expected/double-hanging__auto_ignore_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_ignore_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_ignore_super.txt b/CDT/tests/expected/double-hanging__auto_ignore_super.txt new file mode 100644 index 00000000..a31d19b4 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_ignore_super.txt @@ -0,0 +1,15 @@ +7 +0 1 3 4294967295 4294967295 2 +0 2 5 3 5 4 +0 3 4 0 4294967295 3 +0 4 2 2 5 1 +0 5 6 1 6 4294967295 +2 4 5 3 6 1 +4 6 5 4294967295 4 5 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_resolve_all.txt b/CDT/tests/expected/double-hanging__auto_resolve_all.txt new file mode 100644 index 00000000..f4265ff6 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_resolve_all.txt @@ -0,0 +1,23 @@ +15 +0 1 7 4294967295 5 4 +0 3 2 2 6 4294967295 +0 4 3 3 8 1 +0 6 4 4 8 2 +0 7 6 0 10 3 +1 2 7 4294967295 7 0 +2 3 9 1 12 7 +2 9 7 6 14 5 +3 4 6 2 3 10 +3 5 8 11 13 12 +3 6 7 8 4 11 +3 7 5 10 13 9 +3 8 9 9 14 6 +5 7 8 11 14 9 +7 9 8 7 12 13 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_resolve_auto.txt b/CDT/tests/expected/double-hanging__auto_resolve_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_resolve_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_resolve_outer.txt b/CDT/tests/expected/double-hanging__auto_resolve_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_resolve_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__auto_resolve_super.txt b/CDT/tests/expected/double-hanging__auto_resolve_super.txt new file mode 100644 index 00000000..a31d19b4 --- /dev/null +++ b/CDT/tests/expected/double-hanging__auto_resolve_super.txt @@ -0,0 +1,15 @@ +7 +0 1 3 4294967295 4294967295 2 +0 2 5 3 5 4 +0 3 4 0 4294967295 3 +0 4 2 2 5 1 +0 5 6 1 6 4294967295 +2 4 5 3 6 1 +4 6 5 4294967295 4 5 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/double-hanging__conforming_auto_ignore_auto.txt b/CDT/tests/expected/double-hanging__conforming_auto_ignore_auto.txt new file mode 100644 index 00000000..b7206655 --- /dev/null +++ b/CDT/tests/expected/double-hanging__conforming_auto_ignore_auto.txt @@ -0,0 +1,31 @@ +0 + +6 +0 8 +4 10 +7 9 +7 11 +8 9 +10 11 + +0 + +6 +0 8 + 1 + 0 4 +4 10 + 1 + 0 4 +7 9 + 1 + 0 4 +7 11 + 1 + 0 4 +8 9 + 1 + 0 4 +10 11 + 1 + 0 4 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_all.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_all.txt new file mode 100644 index 00000000..71ecb90f --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_all.txt @@ -0,0 +1,35 @@ +19 +0 1 10 4294967295 4 1 +0 10 11 0 10 2 +0 11 2 1 6 4294967295 +1 2 9 4294967295 5 4 +1 9 10 3 17 0 +2 8 9 6 16 3 +2 11 8 2 13 5 +3 4 11 8 13 10 +3 5 4 9 11 7 +3 10 5 10 17 8 +3 11 10 7 1 9 +4 5 6 8 14 12 +4 6 8 11 18 13 +4 8 11 12 6 7 +5 7 6 15 18 11 +5 8 7 16 18 14 +5 9 8 17 5 15 +5 10 9 9 4 16 +6 7 8 14 15 12 + +9 +3 4 +3 11 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 +10 11 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_auto.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_auto.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_auto.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_outer.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_outer.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_outer.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_super.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_super.txt new file mode 100644 index 00000000..9f46dcab --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_ignore_super.txt @@ -0,0 +1,28 @@ +12 +0 1 8 1 6 3 +0 2 1 2 4 0 +0 7 2 3 10 1 +0 8 7 0 4294967295 2 +1 2 3 1 7 5 +1 3 5 4 11 6 +1 5 8 5 4294967295 0 +2 4 3 8 11 4 +2 5 4 9 11 7 +2 6 5 10 4294967295 8 +2 7 6 2 4294967295 9 +3 4 5 7 8 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_all.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_all.txt new file mode 100644 index 00000000..71ecb90f --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_all.txt @@ -0,0 +1,35 @@ +19 +0 1 10 4294967295 4 1 +0 10 11 0 10 2 +0 11 2 1 6 4294967295 +1 2 9 4294967295 5 4 +1 9 10 3 17 0 +2 8 9 6 16 3 +2 11 8 2 13 5 +3 4 11 8 13 10 +3 5 4 9 11 7 +3 10 5 10 17 8 +3 11 10 7 1 9 +4 5 6 8 14 12 +4 6 8 11 18 13 +4 8 11 12 6 7 +5 7 6 15 18 11 +5 8 7 16 18 14 +5 9 8 17 5 15 +5 10 9 9 4 16 +6 7 8 14 15 12 + +9 +3 4 +3 11 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 +10 11 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_auto.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_auto.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_auto.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_outer.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_outer.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_outer.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_super.txt b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_super.txt new file mode 100644 index 00000000..9f46dcab --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__as-provided_resolve_super.txt @@ -0,0 +1,28 @@ +12 +0 1 8 1 6 3 +0 2 1 2 4 0 +0 7 2 3 10 1 +0 8 7 0 4294967295 2 +1 2 3 1 7 5 +1 3 5 4 11 6 +1 5 8 5 4294967295 0 +2 4 3 8 11 4 +2 5 4 9 11 7 +2 6 5 10 4294967295 8 +2 7 6 2 4294967295 9 +3 4 5 7 8 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_all.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_all.txt new file mode 100644 index 00000000..71ecb90f --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_all.txt @@ -0,0 +1,35 @@ +19 +0 1 10 4294967295 4 1 +0 10 11 0 10 2 +0 11 2 1 6 4294967295 +1 2 9 4294967295 5 4 +1 9 10 3 17 0 +2 8 9 6 16 3 +2 11 8 2 13 5 +3 4 11 8 13 10 +3 5 4 9 11 7 +3 10 5 10 17 8 +3 11 10 7 1 9 +4 5 6 8 14 12 +4 6 8 11 18 13 +4 8 11 12 6 7 +5 7 6 15 18 11 +5 8 7 16 18 14 +5 9 8 17 5 15 +5 10 9 9 4 16 +6 7 8 14 15 12 + +9 +3 4 +3 11 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 +10 11 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_auto.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_auto.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_auto.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_outer.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_outer.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_outer.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_super.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_super.txt new file mode 100644 index 00000000..9f46dcab --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_ignore_super.txt @@ -0,0 +1,28 @@ +12 +0 1 8 1 6 3 +0 2 1 2 4 0 +0 7 2 3 10 1 +0 8 7 0 4294967295 2 +1 2 3 1 7 5 +1 3 5 4 11 6 +1 5 8 5 4294967295 0 +2 4 3 8 11 4 +2 5 4 9 11 7 +2 6 5 10 4294967295 8 +2 7 6 2 4294967295 9 +3 4 5 7 8 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_all.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_all.txt new file mode 100644 index 00000000..71ecb90f --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_all.txt @@ -0,0 +1,35 @@ +19 +0 1 10 4294967295 4 1 +0 10 11 0 10 2 +0 11 2 1 6 4294967295 +1 2 9 4294967295 5 4 +1 9 10 3 17 0 +2 8 9 6 16 3 +2 11 8 2 13 5 +3 4 11 8 13 10 +3 5 4 9 11 7 +3 10 5 10 17 8 +3 11 10 7 1 9 +4 5 6 8 14 12 +4 6 8 11 18 13 +4 8 11 12 6 7 +5 7 6 15 18 11 +5 8 7 16 18 14 +5 9 8 17 5 15 +5 10 9 9 4 16 +6 7 8 14 15 12 + +9 +3 4 +3 11 +4 5 +5 6 +6 7 +7 8 +8 9 +9 10 +10 11 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_auto.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_auto.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_auto.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_outer.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_outer.txt new file mode 100644 index 00000000..d5916399 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_outer.txt @@ -0,0 +1,23 @@ +7 +0 2 1 1 4294967295 4294967295 +0 7 2 2 6 0 +0 8 7 4294967295 4294967295 1 +2 4 3 4 4294967295 4294967295 +2 5 4 5 4294967295 3 +2 6 5 6 4294967295 4 +2 7 6 1 4294967295 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_super.txt b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_super.txt new file mode 100644 index 00000000..9f46dcab --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__auto_resolve_super.txt @@ -0,0 +1,28 @@ +12 +0 1 8 1 6 3 +0 2 1 2 4 0 +0 7 2 3 10 1 +0 8 7 0 4294967295 2 +1 2 3 1 7 5 +1 3 5 4 11 6 +1 5 8 5 4294967295 0 +2 4 3 8 11 4 +2 5 4 9 11 7 +2 6 5 10 4294967295 8 +2 7 6 2 4294967295 9 +3 4 5 7 8 5 + +9 +0 1 +0 8 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 + +0 + +0 diff --git a/CDT/tests/expected/issue-142-double-hanging-edge__conforming_auto_ignore_auto.txt b/CDT/tests/expected/issue-142-double-hanging-edge__conforming_auto_ignore_auto.txt new file mode 100644 index 00000000..a79af398 --- /dev/null +++ b/CDT/tests/expected/issue-142-double-hanging-edge__conforming_auto_ignore_auto.txt @@ -0,0 +1,87 @@ +18 +0 7 9 5 16 1 +0 9 12 0 4294967295 4 +0 10 1 3 4294967295 4294967295 +0 11 10 4 4294967295 2 +0 12 11 1 4294967295 3 +0 19 7 4294967295 17 0 +2 5 15 7 13 4294967295 +2 6 5 8 4294967295 6 +2 7 6 9 4294967295 7 +2 13 7 4294967295 15 8 +3 18 4 4294967295 12 4294967295 +4 17 5 12 14 4294967295 +4 18 17 10 4294967295 11 +5 16 15 14 4294967295 6 +5 17 16 11 4294967295 13 +7 13 14 9 4294967295 16 +7 14 9 15 4294967295 0 +7 19 8 5 4294967295 4294967295 + +20 +0 1 +0 19 +1 10 +2 13 +2 15 +3 4 +3 18 +4 5 +5 6 +6 7 +7 8 +8 19 +9 12 +9 14 +10 11 +11 12 +13 14 +15 16 +16 17 +17 18 + +0 + +14 +0 19 + 1 + 0 8 +1 10 + 1 + 1 2 +2 13 + 1 + 1 2 +2 15 + 1 + 2 3 +3 18 + 1 + 2 3 +8 19 + 1 + 0 8 +9 12 + 1 + 1 2 +9 14 + 1 + 1 2 +10 11 + 1 + 1 2 +11 12 + 1 + 1 2 +13 14 + 1 + 1 2 +15 16 + 1 + 2 3 +16 17 + 1 + 2 3 +17 18 + 1 + 2 3 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_all.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_all.txt new file mode 100644 index 00000000..0c663cfe --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_all.txt @@ -0,0 +1,25 @@ +17 +0 1 10 4294967295 4 2 +0 3 2 2 5 4294967295 +0 10 3 0 12 1 +1 2 7 4294967295 7 4 +1 7 10 3 16 0 +2 3 4 1 9 6 +2 4 6 5 13 7 +2 6 7 6 13 3 +3 5 7 10 14 9 +3 7 4 8 13 5 +3 8 5 11 14 8 +3 9 8 12 15 10 +3 10 9 2 16 11 +4 7 6 9 7 6 +5 8 7 10 15 8 +7 8 9 14 11 16 +7 9 10 15 12 4 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_auto.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_outer.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_super.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_super.txt new file mode 100644 index 00000000..b64032b0 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_ignore_super.txt @@ -0,0 +1,17 @@ +9 +0 2 4 2 6 1 +0 4 1 0 5 4294967295 +0 5 2 3 6 0 +0 6 5 4 7 2 +0 7 6 4294967295 8 3 +1 4 3 1 4294967295 4294967295 +2 5 4 2 7 0 +4 5 6 6 3 8 +4 6 7 7 4 4294967295 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_all.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_all.txt new file mode 100644 index 00000000..0c663cfe --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_all.txt @@ -0,0 +1,25 @@ +17 +0 1 10 4294967295 4 2 +0 3 2 2 5 4294967295 +0 10 3 0 12 1 +1 2 7 4294967295 7 4 +1 7 10 3 16 0 +2 3 4 1 9 6 +2 4 6 5 13 7 +2 6 7 6 13 3 +3 5 7 10 14 9 +3 7 4 8 13 5 +3 8 5 11 14 8 +3 9 8 12 15 10 +3 10 9 2 16 11 +4 7 6 9 7 6 +5 8 7 10 15 8 +7 8 9 14 11 16 +7 9 10 15 12 4 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_auto.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_outer.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_super.txt b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_super.txt new file mode 100644 index 00000000..b64032b0 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__as-provided_resolve_super.txt @@ -0,0 +1,17 @@ +9 +0 2 4 2 6 1 +0 4 1 0 5 4294967295 +0 5 2 3 6 0 +0 6 5 4 7 2 +0 7 6 4294967295 8 3 +1 4 3 1 4294967295 4294967295 +2 5 4 2 7 0 +4 5 6 6 3 8 +4 6 7 7 4 4294967295 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_ignore_all.txt b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_all.txt new file mode 100644 index 00000000..0c663cfe --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_all.txt @@ -0,0 +1,25 @@ +17 +0 1 10 4294967295 4 2 +0 3 2 2 5 4294967295 +0 10 3 0 12 1 +1 2 7 4294967295 7 4 +1 7 10 3 16 0 +2 3 4 1 9 6 +2 4 6 5 13 7 +2 6 7 6 13 3 +3 5 7 10 14 9 +3 7 4 8 13 5 +3 8 5 11 14 8 +3 9 8 12 15 10 +3 10 9 2 16 11 +4 7 6 9 7 6 +5 8 7 10 15 8 +7 8 9 14 11 16 +7 9 10 15 12 4 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_ignore_auto.txt b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_ignore_outer.txt b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_ignore_super.txt b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_super.txt new file mode 100644 index 00000000..b64032b0 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_ignore_super.txt @@ -0,0 +1,17 @@ +9 +0 2 4 2 6 1 +0 4 1 0 5 4294967295 +0 5 2 3 6 0 +0 6 5 4 7 2 +0 7 6 4294967295 8 3 +1 4 3 1 4294967295 4294967295 +2 5 4 2 7 0 +4 5 6 6 3 8 +4 6 7 7 4 4294967295 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_resolve_all.txt b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_all.txt new file mode 100644 index 00000000..0c663cfe --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_all.txt @@ -0,0 +1,25 @@ +17 +0 1 10 4294967295 4 2 +0 3 2 2 5 4294967295 +0 10 3 0 12 1 +1 2 7 4294967295 7 4 +1 7 10 3 16 0 +2 3 4 1 9 6 +2 4 6 5 13 7 +2 6 7 6 13 3 +3 5 7 10 14 9 +3 7 4 8 13 5 +3 8 5 11 14 8 +3 9 8 12 15 10 +3 10 9 2 16 11 +4 7 6 9 7 6 +5 8 7 10 15 8 +7 8 9 14 11 16 +7 9 10 15 12 4 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_resolve_auto.txt b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_resolve_outer.txt b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__auto_resolve_super.txt b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_super.txt new file mode 100644 index 00000000..b64032b0 --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__auto_resolve_super.txt @@ -0,0 +1,17 @@ +9 +0 2 4 2 6 1 +0 4 1 0 5 4294967295 +0 5 2 3 6 0 +0 6 5 4 7 2 +0 7 6 4294967295 8 3 +1 4 3 1 4294967295 4294967295 +2 5 4 2 7 0 +4 5 6 6 3 8 +4 6 7 7 4 4294967295 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging-flipped__conforming_auto_ignore_auto.txt b/CDT/tests/expected/triple-hanging-flipped__conforming_auto_ignore_auto.txt new file mode 100644 index 00000000..05e9935b --- /dev/null +++ b/CDT/tests/expected/triple-hanging-flipped__conforming_auto_ignore_auto.txt @@ -0,0 +1,31 @@ +0 + +6 +0 9 +4 11 +8 10 +8 12 +9 10 +11 12 + +0 + +6 +0 9 + 1 + 0 4 +4 11 + 1 + 0 4 +8 10 + 1 + 0 4 +8 12 + 1 + 0 4 +9 10 + 1 + 0 4 +11 12 + 1 + 0 4 diff --git a/CDT/tests/expected/triple-hanging__as-provided_ignore_all.txt b/CDT/tests/expected/triple-hanging__as-provided_ignore_all.txt new file mode 100644 index 00000000..7d1c8c5e --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_ignore_all.txt @@ -0,0 +1,25 @@ +17 +0 1 7 4294967295 5 4 +0 3 2 2 6 4294967295 +0 4 3 3 8 1 +0 6 4 4 8 2 +0 7 6 0 10 3 +1 2 7 4294967295 7 0 +2 3 10 1 13 7 +2 10 7 6 16 5 +3 4 6 2 3 10 +3 5 8 11 14 12 +3 6 7 8 4 11 +3 7 5 10 14 9 +3 8 9 9 15 13 +3 9 10 12 16 6 +5 7 8 11 15 9 +7 9 8 16 12 14 +7 10 9 7 13 15 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_ignore_auto.txt b/CDT/tests/expected/triple-hanging__as-provided_ignore_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_ignore_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_ignore_outer.txt b/CDT/tests/expected/triple-hanging__as-provided_ignore_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_ignore_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_ignore_super.txt b/CDT/tests/expected/triple-hanging__as-provided_ignore_super.txt new file mode 100644 index 00000000..ef3bcfc8 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_ignore_super.txt @@ -0,0 +1,17 @@ +9 +0 1 3 4294967295 4294967295 2 +0 2 5 3 6 4 +0 3 4 0 4294967295 3 +0 4 2 2 6 1 +0 5 6 1 7 5 +0 6 7 4 8 4294967295 +2 4 5 3 7 1 +4 6 5 8 4 6 +4 7 6 4294967295 5 7 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_resolve_all.txt b/CDT/tests/expected/triple-hanging__as-provided_resolve_all.txt new file mode 100644 index 00000000..7d1c8c5e --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_resolve_all.txt @@ -0,0 +1,25 @@ +17 +0 1 7 4294967295 5 4 +0 3 2 2 6 4294967295 +0 4 3 3 8 1 +0 6 4 4 8 2 +0 7 6 0 10 3 +1 2 7 4294967295 7 0 +2 3 10 1 13 7 +2 10 7 6 16 5 +3 4 6 2 3 10 +3 5 8 11 14 12 +3 6 7 8 4 11 +3 7 5 10 14 9 +3 8 9 9 15 13 +3 9 10 12 16 6 +5 7 8 11 15 9 +7 9 8 16 12 14 +7 10 9 7 13 15 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_resolve_auto.txt b/CDT/tests/expected/triple-hanging__as-provided_resolve_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_resolve_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_resolve_outer.txt b/CDT/tests/expected/triple-hanging__as-provided_resolve_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_resolve_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__as-provided_resolve_super.txt b/CDT/tests/expected/triple-hanging__as-provided_resolve_super.txt new file mode 100644 index 00000000..ef3bcfc8 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__as-provided_resolve_super.txt @@ -0,0 +1,17 @@ +9 +0 1 3 4294967295 4294967295 2 +0 2 5 3 6 4 +0 3 4 0 4294967295 3 +0 4 2 2 6 1 +0 5 6 1 7 5 +0 6 7 4 8 4294967295 +2 4 5 3 7 1 +4 6 5 8 4 6 +4 7 6 4294967295 5 7 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_ignore_all.txt b/CDT/tests/expected/triple-hanging__auto_ignore_all.txt new file mode 100644 index 00000000..5bb2b2c8 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_ignore_all.txt @@ -0,0 +1,25 @@ +17 +0 1 3 4294967295 3 1 +0 3 2 0 6 4294967295 +1 2 7 4294967295 7 5 +1 4 3 4 8 0 +1 6 4 5 8 3 +1 7 6 2 10 4 +2 3 10 1 13 7 +2 10 7 6 16 2 +3 4 6 3 4 10 +3 5 8 11 14 12 +3 6 7 8 5 11 +3 7 5 10 14 9 +3 8 9 9 15 13 +3 9 10 12 16 6 +5 7 8 11 15 9 +7 9 8 16 12 14 +7 10 9 7 13 15 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_ignore_auto.txt b/CDT/tests/expected/triple-hanging__auto_ignore_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_ignore_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_ignore_outer.txt b/CDT/tests/expected/triple-hanging__auto_ignore_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_ignore_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_ignore_super.txt b/CDT/tests/expected/triple-hanging__auto_ignore_super.txt new file mode 100644 index 00000000..ef3bcfc8 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_ignore_super.txt @@ -0,0 +1,17 @@ +9 +0 1 3 4294967295 4294967295 2 +0 2 5 3 6 4 +0 3 4 0 4294967295 3 +0 4 2 2 6 1 +0 5 6 1 7 5 +0 6 7 4 8 4294967295 +2 4 5 3 7 1 +4 6 5 8 4 6 +4 7 6 4294967295 5 7 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_resolve_all.txt b/CDT/tests/expected/triple-hanging__auto_resolve_all.txt new file mode 100644 index 00000000..5bb2b2c8 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_resolve_all.txt @@ -0,0 +1,25 @@ +17 +0 1 3 4294967295 3 1 +0 3 2 0 6 4294967295 +1 2 7 4294967295 7 5 +1 4 3 4 8 0 +1 6 4 5 8 3 +1 7 6 2 10 4 +2 3 10 1 13 7 +2 10 7 6 16 2 +3 4 6 3 4 10 +3 5 8 11 14 12 +3 6 7 8 5 11 +3 7 5 10 14 9 +3 8 9 9 15 13 +3 9 10 12 16 6 +5 7 8 11 15 9 +7 9 8 16 12 14 +7 10 9 7 13 15 + +1 +3 7 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_resolve_auto.txt b/CDT/tests/expected/triple-hanging__auto_resolve_auto.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_resolve_auto.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_resolve_outer.txt b/CDT/tests/expected/triple-hanging__auto_resolve_outer.txt new file mode 100644 index 00000000..534ffb52 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_resolve_outer.txt @@ -0,0 +1,8 @@ +0 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__auto_resolve_super.txt b/CDT/tests/expected/triple-hanging__auto_resolve_super.txt new file mode 100644 index 00000000..ef3bcfc8 --- /dev/null +++ b/CDT/tests/expected/triple-hanging__auto_resolve_super.txt @@ -0,0 +1,17 @@ +9 +0 1 3 4294967295 4294967295 2 +0 2 5 3 6 4 +0 3 4 0 4294967295 3 +0 4 2 2 6 1 +0 5 6 1 7 5 +0 6 7 4 8 4294967295 +2 4 5 3 7 1 +4 6 5 8 4 6 +4 7 6 4294967295 5 7 + +1 +0 4 + +0 + +0 diff --git a/CDT/tests/expected/triple-hanging__conforming_auto_ignore_auto.txt b/CDT/tests/expected/triple-hanging__conforming_auto_ignore_auto.txt new file mode 100644 index 00000000..05e9935b --- /dev/null +++ b/CDT/tests/expected/triple-hanging__conforming_auto_ignore_auto.txt @@ -0,0 +1,31 @@ +0 + +6 +0 9 +4 11 +8 10 +8 12 +9 10 +11 12 + +0 + +6 +0 9 + 1 + 0 4 +4 11 + 1 + 0 4 +8 10 + 1 + 0 4 +8 12 + 1 + 0 4 +9 10 + 1 + 0 4 +11 12 + 1 + 0 4 diff --git a/CDT/tests/inputs/double-hanging.txt b/CDT/tests/inputs/double-hanging.txt new file mode 100644 index 00000000..f084a98f --- /dev/null +++ b/CDT/tests/inputs/double-hanging.txt @@ -0,0 +1,9 @@ +7 1 +0 40 +20 37 +30 43 +40 37 +60 40 +30 48 +30 55 +0 4 \ No newline at end of file diff --git a/CDT/tests/inputs/issue-142-double-hanging-edge.txt b/CDT/tests/inputs/issue-142-double-hanging-edge.txt new file mode 100644 index 00000000..2efe6959 --- /dev/null +++ b/CDT/tests/inputs/issue-142-double-hanging-edge.txt @@ -0,0 +1,19 @@ +9 9 +2.7145555 -1.5168651 +2.5013921 -1.39569 +3.0311139 -1.6827598 +2.7610707 -1.5269606 +2.7745042 -1.5207595 +2.8049774 -1.4492451 +4.2982483 -2.210517 +2.8477705 -1.6077808 +2.3252072 -1.3108287 +0 1 +1 2 +2 3 +3 4 +4 5 +5 6 +6 7 +7 8 +8 0 \ No newline at end of file diff --git a/CDT/tests/inputs/triple-hanging-flipped.txt b/CDT/tests/inputs/triple-hanging-flipped.txt new file mode 100644 index 00000000..564ced89 --- /dev/null +++ b/CDT/tests/inputs/triple-hanging-flipped.txt @@ -0,0 +1,10 @@ +8 1 +0 -40 +20 -37 +30 -43 +40 -37 +60 -40 +30 -45 +30 -48 +30 -55 +0 4 \ No newline at end of file diff --git a/CDT/tests/inputs/triple-hanging.txt b/CDT/tests/inputs/triple-hanging.txt new file mode 100644 index 00000000..98d9fbde --- /dev/null +++ b/CDT/tests/inputs/triple-hanging.txt @@ -0,0 +1,10 @@ +8 1 +0 40 +20 37 +30 43 +40 37 +60 40 +30 45 +30 48 +30 55 +0 4 \ No newline at end of file diff --git a/visualizer/main.cpp b/visualizer/main.cpp index fe57d922..a67098d3 100644 --- a/visualizer/main.cpp +++ b/visualizer/main.cpp @@ -426,12 +426,12 @@ public slots: void wheelEvent(QWheelEvent* event) { const double newScale = - m_scale * std::max(0.3, (1. + event->delta() * 8e-4)); + m_scale * std::max(0.3, (1. + event->angleDelta().y() * 8e-4)); if(m_scale == newScale) { return; } - const QPointF cursor = event->posF(); + const QPointF cursor = event->position(); const QPointF scenePt = screenToScene(cursor); const QPointF screenCenter = QPointF(width(), height()) / 2.0; m_translation = cursor - newScale * QPointF(scenePt.x(), -scenePt.y()) -