OGS
MeshFromRasterDialog Class Reference

Detailed Description

A dialog for specifying the parameters to construct a mesh based on a raster.

Definition at line 20 of file MeshFromRasterDialog.h.

#include <MeshFromRasterDialog.h>

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

Public Member Functions

 MeshFromRasterDialog (QDialog *parent=nullptr)
 Constructor.
 ~MeshFromRasterDialog () override
std::string getMeshName () const
std::string getArrayName () const
MeshLib::MeshElemType getElementSelection () const
MeshLib::UseIntensityAs getIntensitySelection () const

Private Slots

void on_elevationButton_toggled (bool isChecked)
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 _mesh_name
std::string _array_name
MeshLib::MeshElemType _element_selection
MeshLib::UseIntensityAs _intensity_selection

Constructor & Destructor Documentation

◆ MeshFromRasterDialog()

MeshFromRasterDialog::MeshFromRasterDialog ( QDialog * parent = nullptr)
explicit

Constructor.

Definition at line 9 of file MeshFromRasterDialog.cpp.

10 : QDialog(parent), _mesh_name("mesh"), _array_name("MaterialIDs")
11{
12 setupUi(this);
13
14 this->elevationButton->setChecked(true);
15 this->triButton->setChecked(true);
16 this->mshNameEdit->setText("RasterDataMesh");
17}

References _array_name, and _mesh_name.

◆ ~MeshFromRasterDialog()

MeshFromRasterDialog::~MeshFromRasterDialog ( )
overridedefault

Member Function Documentation

◆ accept

void MeshFromRasterDialog::accept ( )
overrideprivateslot

Instructions if the OK-Button has been pressed.

Definition at line 39 of file MeshFromRasterDialog.cpp.

40{
41 if (this->mshNameEdit->text().isEmpty())
42 {
43 OGSError::box("Please specify a name for the resulting mesh.");
44 return;
45 }
46 _mesh_name = this->mshNameEdit->text().toStdString();
47
49 if (this->materialButton->isChecked())
50 {
52 }
53 else if (this->otherButton->isChecked())
54 {
56 }
57 else if (this->ignoreButton->isChecked())
58 {
60 }
61
63 {
64 if (this->arrayNameEdit->text().isEmpty())
65 {
66 OGSError::box("Please specify a name for the data vector.");
67 return;
68 }
69
70 _array_name = this->arrayNameEdit->text().toStdString();
71 }
73 if (this->quadButton->isChecked())
74 {
76 }
77 else if (this->prismButton->isChecked())
78 {
80 }
81 else if (this->hexButton->isChecked())
82 {
84 }
85
86 this->done(QDialog::Accepted);
87}
MeshLib::MeshElemType _element_selection
MeshLib::UseIntensityAs _intensity_selection
static void box(const QString &e)
Definition OGSError.cpp:13

References _array_name, _element_selection, _intensity_selection, _mesh_name, OGSError::box(), MeshLib::DATAVECTOR, MeshLib::ELEVATION, MeshLib::HEXAHEDRON, MeshLib::MATERIALS, MeshLib::NONE, MeshLib::PRISM, MeshLib::QUAD, and MeshLib::TRIANGLE.

◆ getArrayName()

std::string MeshFromRasterDialog::getArrayName ( ) const
inline

Definition at line 30 of file MeshFromRasterDialog.h.

30{ return _array_name; }

References _array_name.

Referenced by VtkVisPipelineView::showImageToMeshConversionDialog().

◆ getElementSelection()

MeshLib::MeshElemType MeshFromRasterDialog::getElementSelection ( ) const
inline

◆ getIntensitySelection()

MeshLib::UseIntensityAs MeshFromRasterDialog::getIntensitySelection ( ) const
inline

◆ getMeshName()

std::string MeshFromRasterDialog::getMeshName ( ) const
inline

Definition at line 29 of file MeshFromRasterDialog.h.

29{ return _mesh_name; }

References _mesh_name.

Referenced by VtkVisPipelineView::showImageToMeshConversionDialog().

◆ on_elevationButton_toggled

void MeshFromRasterDialog::on_elevationButton_toggled ( bool isChecked)
privateslot

Definition at line 21 of file MeshFromRasterDialog.cpp.

22{
23 if (isChecked)
24 {
25 if (this->prismButton->isChecked())
26 {
27 this->triButton->setChecked(true);
28 }
29 if (this->hexButton->isChecked())
30 {
31 this->quadButton->setChecked(true);
32 }
33 }
34
35 this->prismButton->setEnabled(!isChecked);
36 this->hexButton->setEnabled(!isChecked);
37}

◆ reject

void MeshFromRasterDialog::reject ( )
overrideprivateslot

Instructions if the Cancel-Button has been pressed.

Definition at line 89 of file MeshFromRasterDialog.cpp.

90{
91 this->done(QDialog::Rejected);
92}

Member Data Documentation

◆ _array_name

std::string MeshFromRasterDialog::_array_name
private

Definition at line 45 of file MeshFromRasterDialog.h.

Referenced by MeshFromRasterDialog(), accept(), and getArrayName().

◆ _element_selection

MeshLib::MeshElemType MeshFromRasterDialog::_element_selection
private

Definition at line 46 of file MeshFromRasterDialog.h.

Referenced by accept(), and getElementSelection().

◆ _intensity_selection

MeshLib::UseIntensityAs MeshFromRasterDialog::_intensity_selection
private

Definition at line 47 of file MeshFromRasterDialog.h.

Referenced by accept(), and getIntensitySelection().

◆ _mesh_name

std::string MeshFromRasterDialog::_mesh_name
private

Definition at line 44 of file MeshFromRasterDialog.h.

Referenced by MeshFromRasterDialog(), accept(), and getMeshName().


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