OGS
GeoOnMeshMappingDialog Class Reference

Detailed Description

A dialog window for creating DIRECT boundary conditions from raster files.

Definition at line 18 of file GeoOnMeshMappingDialog.h.

#include <GeoOnMeshMappingDialog.h>

Inheritance diagram for GeoOnMeshMappingDialog:
[legend]
Collaboration diagram for GeoOnMeshMappingDialog:
[legend]

Public Member Functions

 GeoOnMeshMappingDialog (std::vector< std::unique_ptr< MeshLib::Mesh > > const &mesh_vec, QDialog *parent=nullptr)
 ~GeoOnMeshMappingDialog () override
std::string const & getNewGeoName () const
int getDataSetChoice () const

Private Slots

void on_advancedMappingButton_toggled (bool isSelected)

Private Member Functions

void on_meshNameComboBox_currentIndexChanged (int idx)
void accept () override
 Instructions if the OK-Button has been pressed.
void reject () override
 Instructions if the Cancel-Button has been pressed.

Private Attributes

std::string _new_geo_name

Constructor & Destructor Documentation

◆ GeoOnMeshMappingDialog()

GeoOnMeshMappingDialog::GeoOnMeshMappingDialog ( std::vector< std::unique_ptr< MeshLib::Mesh > > const & mesh_vec,
QDialog * parent = nullptr )
explicit

Definition at line 9 of file GeoOnMeshMappingDialog.cpp.

12 : QDialog(parent), _new_geo_name("")
13{
14 setupUi(this);
15
16 for (const auto& mesh : mesh_vec)
17 {
18 this->meshNameComboBox->addItem(
19 QString::fromStdString(mesh->getName()));
20 }
21}

References _new_geo_name.

◆ ~GeoOnMeshMappingDialog()

GeoOnMeshMappingDialog::~GeoOnMeshMappingDialog ( )
overridedefault

Member Function Documentation

◆ accept()

void GeoOnMeshMappingDialog::accept ( )
overrideprivate

Instructions if the OK-Button has been pressed.

Definition at line 44 of file GeoOnMeshMappingDialog.cpp.

45{
46 if (this->advancedMappingButton->isChecked())
47 {
48 _new_geo_name = this->geoNameEdit->text().toStdString();
49 if (_new_geo_name.empty())
50 {
51 OGSError::box("Please enter name for new geometry.");
52 return;
53 }
54 }
55 this->done(QDialog::Accepted);
56}
static void box(const QString &e)
Definition OGSError.cpp:13

References _new_geo_name, and OGSError::box().

◆ getDataSetChoice()

int GeoOnMeshMappingDialog::getDataSetChoice ( ) const

Definition at line 25 of file GeoOnMeshMappingDialog.cpp.

26{
27 return this->meshNameComboBox->currentIndex();
28}

Referenced by MainWindow::mapGeometry().

◆ getNewGeoName()

std::string const & GeoOnMeshMappingDialog::getNewGeoName ( ) const
inline

Definition at line 28 of file GeoOnMeshMappingDialog.h.

28{ return _new_geo_name; };

References _new_geo_name.

Referenced by MainWindow::mapGeometry().

◆ on_advancedMappingButton_toggled

void GeoOnMeshMappingDialog::on_advancedMappingButton_toggled ( bool isSelected)
inlineprivateslot

Definition at line 35 of file GeoOnMeshMappingDialog.h.

35{ this->geoNameEdit->setEnabled(isSelected); };

◆ on_meshNameComboBox_currentIndexChanged()

void GeoOnMeshMappingDialog::on_meshNameComboBox_currentIndexChanged ( int idx)
private

Definition at line 30 of file GeoOnMeshMappingDialog.cpp.

31{
32 if (idx == 1)
33 {
34 this->normalMappingButton->setChecked(true);
35 }
36
37 bool is_enabled(idx != 1);
38 this->normalMappingButton->setEnabled(is_enabled);
39 this->advancedMappingButton->setEnabled(is_enabled);
40 this->geoNameEdit->setEnabled(is_enabled &&
41 this->advancedMappingButton->isChecked());
42}

◆ reject()

void GeoOnMeshMappingDialog::reject ( )
inlineoverrideprivate

Instructions if the Cancel-Button has been pressed.

Definition at line 43 of file GeoOnMeshMappingDialog.h.

43{ this->done(QDialog::Rejected); };

Member Data Documentation

◆ _new_geo_name

std::string GeoOnMeshMappingDialog::_new_geo_name
private

Definition at line 32 of file GeoOnMeshMappingDialog.h.

Referenced by GeoOnMeshMappingDialog(), accept(), and getNewGeoName().


The documentation for this class was generated from the following files: