Skip to content

Commit

Permalink
Add duplication check
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-ogre authored and artem-hexagon committed May 3, 2022
1 parent 3f7043d commit 38dbffd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions visualizer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ public slots:
? std::vector<V2d>(&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())
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 38dbffd

Please sign in to comment.