OGS
GeoOnMeshMappingDialog Class Reference

Detailed Description

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

Definition at line 29 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 20 of file GeoOnMeshMappingDialog.cpp.

23 : QDialog(parent), _new_geo_name("")
24{
25 setupUi(this);
26
27 for (const auto& mesh : mesh_vec)
28 {
29 this->meshNameComboBox->addItem(
30 QString::fromStdString(mesh->getName()));
31 }
32}

◆ ~GeoOnMeshMappingDialog()

GeoOnMeshMappingDialog::~GeoOnMeshMappingDialog ( )
overridedefault

Member Function Documentation

◆ accept()

void GeoOnMeshMappingDialog::accept ( )
overrideprivate

Instructions if the OK-Button has been pressed.

Definition at line 55 of file GeoOnMeshMappingDialog.cpp.

56{
57 if (this->advancedMappingButton->isChecked())
58 {
59 _new_geo_name = this->geoNameEdit->text().toStdString();
60 if (_new_geo_name.empty())
61 {
62 OGSError::box("Please enter name for new geometry.");
63 return;
64 }
65 }
66 this->done(QDialog::Accepted);
67}
static void box(const QString &e)
Definition: OGSError.cpp:23

References _new_geo_name, and OGSError::box().

◆ getDataSetChoice()

int GeoOnMeshMappingDialog::getDataSetChoice ( ) const

Definition at line 36 of file GeoOnMeshMappingDialog.cpp.

37{
38 return this->meshNameComboBox->currentIndex();
39}

Referenced by MainWindow::mapGeometry().

◆ getNewGeoName()

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

Definition at line 39 of file GeoOnMeshMappingDialog.h.

39{ 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 46 of file GeoOnMeshMappingDialog.h.

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

◆ on_meshNameComboBox_currentIndexChanged()

void GeoOnMeshMappingDialog::on_meshNameComboBox_currentIndexChanged ( int  idx)
private

Definition at line 41 of file GeoOnMeshMappingDialog.cpp.

42{
43 if (idx == 1)
44 {
45 this->normalMappingButton->setChecked(true);
46 }
47
48 bool is_enabled(idx != 1);
49 this->normalMappingButton->setEnabled(is_enabled);
50 this->advancedMappingButton->setEnabled(is_enabled);
51 this->geoNameEdit->setEnabled(is_enabled &&
52 this->advancedMappingButton->isChecked());
53}

◆ reject()

void GeoOnMeshMappingDialog::reject ( )
inlineoverrideprivate

Instructions if the Cancel-Button has been pressed.

Definition at line 54 of file GeoOnMeshMappingDialog.h.

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

Member Data Documentation

◆ _new_geo_name

std::string GeoOnMeshMappingDialog::_new_geo_name
private

Definition at line 43 of file GeoOnMeshMappingDialog.h.

Referenced by accept(), and getNewGeoName().


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