OGS
MeshFromRasterDialog Class Reference

Detailed Description

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

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

21 : QDialog(parent), _mesh_name("mesh"), _array_name("MaterialIDs")
22{
23 setupUi(this);
24
25 this->elevationButton->setChecked(true);
26 this->triButton->setChecked(true);
27 this->mshNameEdit->setText("RasterDataMesh");
28}

◆ ~MeshFromRasterDialog()

MeshFromRasterDialog::~MeshFromRasterDialog ( )
overridedefault

Member Function Documentation

◆ accept

void MeshFromRasterDialog::accept ( )
overrideprivateslot

Instructions if the OK-Button has been pressed.

Definition at line 50 of file MeshFromRasterDialog.cpp.

51{
52 if (this->mshNameEdit->text().isEmpty())
53 {
54 OGSError::box("Please specify a name for the resulting mesh.");
55 return;
56 }
57 _mesh_name = this->mshNameEdit->text().toStdString();
58
60 if (this->materialButton->isChecked())
61 {
63 }
64 else if (this->otherButton->isChecked())
65 {
67 }
68 else if (this->ignoreButton->isChecked())
69 {
71 }
72
74 {
75 if (this->arrayNameEdit->text().isEmpty())
76 {
77 OGSError::box("Please specify a name for the data vector.");
78 return;
79 }
80
81 _array_name = this->arrayNameEdit->text().toStdString();
82 }
84 if (this->quadButton->isChecked())
85 {
87 }
88 else if (this->prismButton->isChecked())
89 {
91 }
92 else if (this->hexButton->isChecked())
93 {
95 }
96
97 this->done(QDialog::Accepted);
98}
MeshLib::MeshElemType _element_selection
MeshLib::UseIntensityAs _intensity_selection
static void box(const QString &e)
Definition OGSError.cpp:23

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 41 of file MeshFromRasterDialog.h.

41{ 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 40 of file MeshFromRasterDialog.h.

40{ return _mesh_name; }

References _mesh_name.

Referenced by VtkVisPipelineView::showImageToMeshConversionDialog().

◆ on_elevationButton_toggled

void MeshFromRasterDialog::on_elevationButton_toggled ( bool isChecked)
privateslot

Definition at line 32 of file MeshFromRasterDialog.cpp.

33{
34 if (isChecked)
35 {
36 if (this->prismButton->isChecked())
37 {
38 this->triButton->setChecked(true);
39 }
40 if (this->hexButton->isChecked())
41 {
42 this->quadButton->setChecked(true);
43 }
44 }
45
46 this->prismButton->setEnabled(!isChecked);
47 this->hexButton->setEnabled(!isChecked);
48}

◆ reject

void MeshFromRasterDialog::reject ( )
overrideprivateslot

Instructions if the Cancel-Button has been pressed.

Definition at line 100 of file MeshFromRasterDialog.cpp.

101{
102 this->done(QDialog::Rejected);
103}

Member Data Documentation

◆ _array_name

std::string MeshFromRasterDialog::_array_name
private

Definition at line 56 of file MeshFromRasterDialog.h.

Referenced by accept(), and getArrayName().

◆ _element_selection

MeshLib::MeshElemType MeshFromRasterDialog::_element_selection
private

Definition at line 57 of file MeshFromRasterDialog.h.

Referenced by accept(), and getElementSelection().

◆ _intensity_selection

MeshLib::UseIntensityAs MeshFromRasterDialog::_intensity_selection
private

Definition at line 58 of file MeshFromRasterDialog.h.

Referenced by accept(), and getIntensitySelection().

◆ _mesh_name

std::string MeshFromRasterDialog::_mesh_name
private

Definition at line 55 of file MeshFromRasterDialog.h.

Referenced by accept(), and getMeshName().


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