31 : QDialog(parent), _mesh_model(mesh_model), _geo_models(geo_models)
39 for (
auto const& name : geoNames)
41 dataList.append(QString::fromStdString(name));
49 dataList.append(QString::fromStdString(mesh->getName()));
54 this->selectDataButton->setDisabled(
true);
55 this->deselectDataButton->setDisabled(
true);
56 dataList.append(
"[No data available.]");
60 this->allDataView->setModel(&
_allData);
61 this->selectedDataView->setModel(&
_selData);
75 std::string
const& name)
77 std::vector<GeoLib::Point*>
const* point_vec =
79 if (point_vec ==
nullptr)
92 std::string
const& name)
102 mesh->
getNodes().end(), displacement);
114 QString
const xinput = this->xlineEdit->text();
115 QString
const yinput = this->ylineEdit->text();
116 QString
const zinput = this->zlineEdit->text();
119 if (!xinput.toDouble(&ok) or !yinput.toDouble(&ok) or !zinput.toDouble(&ok))
122 "If the x/y/z-input is 0, not specified or not a real number, it "
126 Eigen::Vector3d
const displacement{xinput.toDouble(), yinput.toDouble(),
129 INFO(
"translate model ({:f}, {:f}, {:f}).",
134 std::vector<std::string>
const selectedData =
139 for (
auto const& data_name : selectedData)
141 if (std::find(std::begin(geoNames), std::end(geoNames), data_name) !=
150 this->done(QDialog::Accepted);
Definition of the AABB class.
Definition of the GEOModels class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the MeshModel class.
Definition of the Mesh class.
Definition of the Node class.
Implementation of the StrictDoubleValidator class.
Definition of the TranslateDataDialog class.
GEOModels connects the data management class GEOObjects and the GUI. It inherits from GeoLib::GEOObje...
std::vector< std::string > getGeometryNames() const
const std::vector< GeoLib::Point * > * getPointVec(const std::string &name) const
void updateGeometry(const std::string &geo_name)
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
const MeshLib::Mesh * getMesh(const QModelIndex &idx) const
Returns the mesh with the given index.
void updateMesh(MeshLib::Mesh *)
Updates the model/view for a mesh.
static void box(const QString &e)
void accept() override
Instructions if the OK-Button has been pressed.
QStringListModel _allData
QStringListModel _selData
void moveGeometry(Eigen::Vector3d const &displacement, std::string const &name)
TranslateDataDialog(MeshModel *mesh_model, GEOModels *geo_models, QDialog *parent=nullptr)
void moveMesh(Eigen::Vector3d const &displacement, std::string const &name)
void on_deselectDataButton_pressed()
Instructions if the "<<-button" has been pressed.
void on_selectDataButton_pressed()
Instructions if the ">>-button" has been pressed.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Functionality to move mesh nodes using a given displacement vec.
std::vector< std::string > getSelectedObjects(QStringList const &list)
void moveSelectedItems(QListView *sourceView, QStringListModel &sourceModel, QStringListModel &targetModel)