| 89 | } |
| 90 | |
| 91 | void QmitkEditPointDialog::OnOkButtonClicked(bool) |
| 92 | { |
| 93 | if (d->m_PointSet == nullptr) |
| 94 | { |
| 95 | MITK_WARN << "Pointset is 0."; |
| 96 | this->reject(); |
| 97 | } |
| 98 | // check if digits of input value exceed double precision |
| 99 | auto x = d->m_XCoord->text().toDouble(); |
| 100 | auto y = d->m_YCoord->text().toDouble(); |
| 101 | auto z = d->m_ZCoord->text().toDouble(); |
| 102 | |
| 103 | if (ValidateCoordinate("X", x) && ValidateCoordinate("Y", y) && ValidateCoordinate("Z", z)) |
| 104 | { |
| 105 | auto point = d->m_PointSet->GetPoint(d->m_PointId, d->m_Timestep); |
| 106 | point.SetElement(0, x); |
| 107 | point.SetElement(1, y); |
| 108 | point.SetElement(2, z); |
| 109 | d->m_PointSet->SetPoint(d->m_PointId, point); |
| 110 | this->accept(); |
| 111 | } |
| 112 | } |