From 38dbffdbcd7155837a9baec3e785ec580f6125b2 Mon Sep 17 00:00:00 2001 From: artem-ogre Date: Tue, 26 Apr 2022 20:41:09 +0200 Subject: [PATCH] Add duplication check --- visualizer/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/visualizer/main.cpp b/visualizer/main.cpp index 9ac28f56..003a9fbd 100644 --- a/visualizer/main.cpp +++ b/visualizer/main.cpp @@ -196,6 +196,12 @@ public slots: ? std::vector(&m_points[0], &m_points[m_ptLimit]) : m_points; const CDT::DuplicatesInfo duplInfo = CDT::RemoveDuplicates(pts); + if(!duplInfo.duplicates.empty()) + { + QMessageBox errBox; + errBox.setText(QStringLiteral("Triangulation has duplicates")); + errBox.exec(); + } m_cdt.insertVertices(pts); if(m_ptLimit >= m_points.size() && !m_edges.empty()) @@ -339,6 +345,7 @@ public slots: } if(m_isDisplayIndices) { + int iT = 0; for(TCit t = m_cdt.triangles.begin(); t != m_cdt.triangles.end(); ++t, ++iT) {