fixed cylces output and remove step

This commit is contained in:
incredibleLeitman 2020-11-30 00:23:21 +01:00
parent abcce8cbd4
commit d1efc75f21

View File

@ -203,7 +203,7 @@ void Display::update ()
{ {
std::cout << "## no more open lines -> fin!" << std::endl; std::cout << "## no more open lines -> fin!" << std::endl;
m_points.clear(); m_points.clear();
m_textStatus.setString(text + "finished calculating convex hull in " + std::to_string(m_step / 5) + " cycles"); if (m_points.size() == 0) m_textStatus.setString(text + "finished calculating convex hull in " + std::to_string((m_step / 4 + 1)) + " cycles");
return; return;
} }
@ -290,7 +290,7 @@ void Display::update ()
m_textStatus.setString(text + "remove inner points..."); m_textStatus.setString(text + "remove inner points...");
size_t lines = m_lines.size() - 1; size_t lines = m_lines.size() - 1;
if (lines > 2) if (lines > 0)
{ {
// assure clockwise order // assure clockwise order
Point pt1 = m_lines[lines - 1].from(); Point pt1 = m_lines[lines - 1].from();
@ -326,7 +326,7 @@ void Display::update ()
m_curLineIdx = -1; m_curLineIdx = -1;
//m_curLine = m_lines[lines - 1]; //m_curLine = m_lines[lines - 1];
if (m_points.size() == 0) m_textStatus.setString(text + "finished calculating convex hull in " + std::to_string(m_step/5) + " cycles"); if (m_points.size() == 0) m_textStatus.setString(text + "finished calculating convex hull in " + std::to_string((m_step / 4 + 1)) + " cycles");
else m_textStatus.setString(text + "adding new hull point..."); else m_textStatus.setString(text + "adding new hull point...");
} }
else if (m_step > 0) m_textStatus.setString(text + "invalid status!"); else if (m_step > 0) m_textStatus.setString(text + "invalid status!");