A dialog window for creating linear boundary conditions on polylines.
Definition at line 25 of file LinearEditDialog.h.
#include <LinearEditDialog.h>
|
void | setupDialog (const std::vector< std::size_t > &dis_nodes, const std::vector< double > &dis_values) |
|
◆ LinearEditDialog()
LinearEditDialog::LinearEditDialog |
( |
const GeoLib::Polyline & |
line, |
|
|
const std::vector< std::size_t > & |
dis_nodes, |
|
|
const std::vector< double > & |
dis_values, |
|
|
QDialog * |
parent = nullptr |
|
) |
| |
Definition at line 17 of file LinearEditDialog.cpp.
21 : QDialog(parent),
_line(line)
const GeoLib::Polyline _line
void setupDialog(const std::vector< std::size_t > &dis_nodes, const std::vector< double > &dis_values)
References setupDialog().
◆ ~LinearEditDialog()
LinearEditDialog::~LinearEditDialog |
( |
| ) |
|
|
overridedefault |
◆ accept
void LinearEditDialog::accept |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the OK-Button has been pressed.
Definition at line 66 of file LinearEditDialog.cpp.
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);
void transmitDisValues(std::vector< std::pair< std::size_t, double > >)
References transmitDisValues().
◆ on_comboBox_currentIndexChanged
void LinearEditDialog::on_comboBox_currentIndexChanged |
( |
int |
index | ) |
|
|
privateslot |
Definition at line 53 of file LinearEditDialog.cpp.
57 std::size_t nRows = tableWidget->rowCount();
58 for (std::size_t i = 0; i < nRows; i++)
60 tableWidget->item(i, 0)->setText(
const Point * getPoint(std::size_t i) const
returns the i-th point contained in the polyline
References _line, and GeoLib::Polyline::getPoint().
◆ reject
void LinearEditDialog::reject |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the Cancel-Button has been pressed.
Definition at line 84 of file LinearEditDialog.cpp.
86 this->done(QDialog::Rejected);
◆ setupDialog()
void LinearEditDialog::setupDialog |
( |
const std::vector< std::size_t > & |
dis_nodes, |
|
|
const std::vector< double > & |
dis_values |
|
) |
| |
|
private |
Definition at line 27 of file LinearEditDialog.cpp.
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]));
std::size_t getNumberOfPoints() const
References _line, and GeoLib::Polyline::getNumberOfPoints().
Referenced by LinearEditDialog().
◆ transmitDisValues
void LinearEditDialog::transmitDisValues |
( |
std::vector< std::pair< std::size_t, double > > |
| ) |
|
|
signal |
◆ _line
The documentation for this class was generated from the following files: