18 const std::vector<std::size_t>& dis_nodes,
19 const std::vector<double>& dis_values,
21 : QDialog(parent), _line(line)
28 const std::vector<double>& dis_values)
31 this->tableWidget->setRowCount(nPoints);
32 QList<QString> indexlist;
34 for (std::size_t i = 0; i < nPoints; i++)
36 indexlist.push_back(QString::number(i));
37 QTableWidgetItem* newItem =
new QTableWidgetItem(
"");
38 tableWidget->setItem(i, 0, newItem);
40 QStringList vHeaders(indexlist);
41 tableWidget->setVerticalHeaderLabels(vHeaders);
43 std::size_t nValues(dis_values.size());
44 for (std::size_t i = 0; i < nValues; i++)
46 tableWidget->item(
static_cast<int>(dis_nodes[i]), 0)
47 ->setText(QString::number(dis_values[i]));
57 std::size_t nRows = tableWidget->rowCount();
58 for (std::size_t i = 0; i < nRows; i++)
60 tableWidget->item(i, 0)->setText(
68 std::vector<std::pair<std::size_t, double>> linear_values;
70 std::size_t nRows = tableWidget->rowCount();
71 for (std::size_t i = 0; i < nRows; i++)
73 QString row_text(tableWidget->item(i, 0)->text());
74 if (row_text.length() > 0)
76 linear_values.emplace_back(i, row_text.toDouble());
81 this->done(QDialog::Accepted);
86 this->done(QDialog::Rejected);
Definition of the LinearEditDialog class.
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
std::size_t getNumberOfPoints() const
const Point * getPoint(std::size_t i) const
returns the i-th point contained in the polyline
void reject() override
Instructions if the Cancel-Button has been pressed.
const GeoLib::Polyline _line
~LinearEditDialog() override
void on_comboBox_currentIndexChanged(int index)
void setupDialog(const std::vector< std::size_t > &dis_nodes, const std::vector< double > &dis_values)
void accept() override
Instructions if the OK-Button has been pressed.
LinearEditDialog(const GeoLib::Polyline &line, const std::vector< std::size_t > &dis_nodes, const std::vector< double > &dis_values, QDialog *parent=nullptr)
void transmitDisValues(std::vector< std::pair< std::size_t, double > >)