diff --git a/FileIO/MeshIO/GMSHInterface.cpp b/FileIO/MeshIO/GMSHInterface.cpp index 3b323e1e8b7d31734dfc0e4dade6f60d5c3e9c6e..32ff2a5e8a3f7082893b2f73b95cefd8013be100 100644 --- a/FileIO/MeshIO/GMSHInterface.cpp +++ b/FileIO/MeshIO/GMSHInterface.cpp @@ -142,7 +142,7 @@ MeshLib::Mesh* GMSHInterface::readGMSHMesh(std::string const& fname) break; case 2: readNodeIDs(in, 3, node_ids, id_map); - elem = new MeshLib::Tri(nodes[node_ids[0]], nodes[node_ids[1]], nodes[node_ids[2]], mat_id); + elem = new MeshLib::Tri(nodes[node_ids[2]], nodes[node_ids[1]], nodes[node_ids[0]], mat_id); break; case 3: readNodeIDs(in, 4, node_ids, id_map); diff --git a/Gui/DataView/GMSHPrefsDialog.cpp b/Gui/DataView/GMSHPrefsDialog.cpp index 19214f864f8f76f6dfcac3ec2620d2f36b6d03d4..c7e85c0a055a4adb884574380b5cf4d47443bb5c 100644 --- a/Gui/DataView/GMSHPrefsDialog.cpp +++ b/Gui/DataView/GMSHPrefsDialog.cpp @@ -63,13 +63,13 @@ GMSHPrefsDialog::GMSHPrefsDialog(const GeoLib::GEOObjects* geoObjects, QDialog* std::vector<std::string> geo_station_names; geoObjects->getStationVectorNames(geo_station_names); - for (size_t k(0); k < geo_station_names.size(); k++) + for (unsigned k(0); k < geo_station_names.size(); ++k) geoNames.push_back (geo_station_names[k]); size_t nGeoObjects(geoNames.size()); QStringList list; - for (size_t i = 0; i < nGeoObjects; i++) + for (unsigned i = 0; i < nGeoObjects; ++i) list.append(QString::fromStdString(geoNames[i])); if (list.empty()) @@ -146,14 +146,14 @@ void GMSHPrefsDialog::accept() } std::vector<std::string> selectedObjects = this->getSelectedObjects(_selGeo->stringList()); - size_t max_number_of_points_in_quadtree_leaf (10); + unsigned max_number_of_points_in_quadtree_leaf (10); double mesh_density_scaling_pnts(0.5); double mesh_density_scaling_stations (0.05); double val4(-1); if (this->radioAdaptive->isChecked()) { - max_number_of_points_in_quadtree_leaf = str2number<size_t> ( + max_number_of_points_in_quadtree_leaf = str2number<unsigned> ( param1->text().toStdString().c_str()); if (max_number_of_points_in_quadtree_leaf == 0) max_number_of_points_in_quadtree_leaf = 10; diff --git a/Gui/DataView/GMSHPrefsDialog.h b/Gui/DataView/GMSHPrefsDialog.h index 756cc5b92fbe1077531eed7cfcff2add67cb1411..8909dbf17d2e94e4f9592b2aad90f4334d3aab5d 100644 --- a/Gui/DataView/GMSHPrefsDialog.h +++ b/Gui/DataView/GMSHPrefsDialog.h @@ -51,7 +51,7 @@ private slots: void reject(); signals: - void requestMeshing(std::vector<std::string> &, std::size_t, double, double, double, bool); + void requestMeshing(std::vector<std::string> &, unsigned, double, double, double, bool); }; #endif //GMSHPREFSDIALOG_H diff --git a/Gui/DataView/MshEditDialog.cpp b/Gui/DataView/MshEditDialog.cpp index e3e89531e1f8336ce85b50a7f08596f1c79de8db..362af0ef8fd1adc088e5391e1a851654893761c0 100644 --- a/Gui/DataView/MshEditDialog.cpp +++ b/Gui/DataView/MshEditDialog.cpp @@ -25,6 +25,7 @@ MshEditDialog::MshEditDialog(const MeshLib::Mesh* mesh, QDialog* parent) : QDialog(parent), _msh(mesh), _noDataDeleteBox(NULL), _nLayerLabel (new QLabel("Please specify the number of layers to add:")), + _nLayerExplanation (new QLabel("(select \"0\" for surface mapping)")), _selectLabel(NULL), _layerEdit (new QLineEdit("0")), _nextButton (new QPushButton("Next")) @@ -32,6 +33,7 @@ MshEditDialog::MshEditDialog(const MeshLib::Mesh* mesh, QDialog* parent) setupUi(this); this->gridLayoutLayerMapping->addWidget(_nLayerLabel, 0, 0, 1, 2); + this->gridLayoutLayerMapping->addWidget(_nLayerExplanation, 1, 0, 1, 2); this->gridLayoutLayerMapping->addWidget(_layerEdit, 0, 2); this->gridLayoutLayerMapping->addWidget(_nextButton, 0, 3); connect(_nextButton, SIGNAL(pressed()), this, SLOT(nextButtonPressed())); @@ -41,6 +43,7 @@ MshEditDialog::~MshEditDialog() { delete _nLayerLabel; + delete _nLayerExplanation; delete _selectLabel; delete _layerEdit; delete _nextButton; @@ -59,10 +62,11 @@ void MshEditDialog::nextButtonPressed() { _layerEdit->setEnabled(false); _nextButton->setEnabled(false); + _nLayerExplanation->setText(""); const unsigned nLayers = _layerEdit->text().toInt(); const QString selectText = (nLayers>0) ? "Please specify a raster file for mapping each layer:" : - "Please specify which rasterfile surface mapping:"; + "Please specify rasterfile for surface mapping:"; _selectLabel = new QLabel(selectText); _selectLabel->setMargin(20); this->gridLayoutLayerMapping->addWidget(_selectLabel, 1, 0, 1, 4); @@ -122,6 +126,7 @@ void MshEditDialog::accept() if (all_paths_set) { + int result(0); const unsigned nLayers = _layerEdit->text().toInt(); MeshLib::Mesh* new_mesh (NULL); @@ -130,7 +135,7 @@ void MshEditDialog::accept() new_mesh = new MeshLib::Mesh(*_msh); const std::string imgPath ( this->_edits[0]->text().toStdString() ); if (!imgPath.empty()) - MshLayerMapper::LayerMapping(new_mesh, imgPath, nLayers, 0, _noDataDeleteBox->isChecked()); + result = MshLayerMapper::LayerMapping(new_mesh, imgPath, nLayers, 0, _noDataDeleteBox->isChecked()); } else { @@ -141,7 +146,7 @@ void MshEditDialog::accept() const std::string imgPath ( this->_edits[i+1]->text().toStdString() ); if (!imgPath.empty()) { - int result = MshLayerMapper::LayerMapping(new_mesh, imgPath, nLayers, i, _noDataDeleteBox->isChecked()); + result = MshLayerMapper::LayerMapping(new_mesh, imgPath, nLayers, i, _noDataDeleteBox->isChecked()); if (result==0) break; } } @@ -155,7 +160,8 @@ void MshEditDialog::accept() if (new_mesh) emit mshEditFinished(new_mesh); - else + + if (!new_mesh || result==0) OGSError::box("Error creating mesh"); this->done(QDialog::Accepted); diff --git a/Gui/DataView/MshEditDialog.h b/Gui/DataView/MshEditDialog.h index 50e6591ff2cca9faec4d48e3c8c513e61678e262..7c531306290255101aafcf46f8e563217d2d1115 100644 --- a/Gui/DataView/MshEditDialog.h +++ b/Gui/DataView/MshEditDialog.h @@ -45,6 +45,7 @@ private: QCheckBox* _noDataDeleteBox; QLabel* _nLayerLabel; + QLabel* _nLayerExplanation; QLabel* _selectLabel; QLineEdit* _layerEdit; QPushButton* _nextButton; diff --git a/Gui/DataView/MshLayerMapper.cpp b/Gui/DataView/MshLayerMapper.cpp index 0a622c7bde07e4e57b349faef0178bce5da943f9..ac93243764a5a26a370f788412c856757e5b102a 100644 --- a/Gui/DataView/MshLayerMapper.cpp +++ b/Gui/DataView/MshLayerMapper.cpp @@ -239,7 +239,9 @@ bool MshLayerMapper::meshFitsImage(const MeshLib::Mesh* msh, if (xMin < xDim.first || xMax > xDim.second || yMin < yDim.first || yMax > yDim.second) { - std::cout << "Warning: Mesh does not fit into given raster file." << std::endl; + std::cout << "Warning: Extension of mesh is larger than extension of given raster file." << std::endl; + std::cout << "Mesh Extend: (" << xMin << ", " << yMin << "):(" << xMax << ", " << yMax << ")" << std::endl; + std::cout << "Raster Extend: (" << xDim.first << ", " << yDim.first << "):(" << xDim.second << ", " << yDim.second << ")" << std::endl; return false; } return true; diff --git a/Gui/VtkVis/VtkSurfacesSource.cpp b/Gui/VtkVis/VtkSurfacesSource.cpp index df515006642702ebc27dc2404c810576e895c685..e11d58dcb21f1ed8d93f581510bda956da5622be 100644 --- a/Gui/VtkVis/VtkSurfacesSource.cpp +++ b/Gui/VtkVis/VtkSurfacesSource.cpp @@ -100,7 +100,7 @@ int VtkSurfacesSource::RequestData( vtkInformation* request, const GeoLib::Triangle* triangle = (**it)[i]; for (size_t j = 0; j < 3; j++) - aPolygon->GetPointIds()->SetId(j, ((*triangle)[2 - j])); + aPolygon->GetPointIds()->SetId(j, ((*triangle)[j])); newPolygons->InsertNextCell(aPolygon); sfcIDs->InsertNextValue(count); aPolygon->Delete(); diff --git a/Gui/mainwindow.cpp b/Gui/mainwindow.cpp index 76278e635c4e0d87238f57883cd24f3eebff2e74..786e9c8bab91fa8dd73b143d48d03f174a0748c3 100644 --- a/Gui/mainwindow.cpp +++ b/Gui/mainwindow.cpp @@ -904,7 +904,7 @@ void MainWindow::exportBoreholesToGMS(std::string listName, } void MainWindow::callGMSH(std::vector<std::string> & selectedGeometries, - size_t param1, double param2, double param3, double param4, + unsigned param1, double param2, double param3, double param4, bool delete_geo_file) { if (!selectedGeometries.empty()) @@ -1088,8 +1088,8 @@ void MainWindow::showLineEditDialog(const std::string &geoName) void MainWindow::showGMSHPrefsDialog() { GMSHPrefsDialog dlg(_geoModels); - connect(&dlg, SIGNAL(requestMeshing(std::vector<std::string> &, size_t, double, double, double, bool)), - this, SLOT(callGMSH(std::vector<std::string> &, size_t, double, double, double, bool))); + connect(&dlg, SIGNAL(requestMeshing(std::vector<std::string> &, unsigned, double, double, double, bool)), + this, SLOT(callGMSH(std::vector<std::string> &, unsigned, double, double, double, bool))); dlg.exec(); } diff --git a/Gui/mainwindow.h b/Gui/mainwindow.h index f1f501d32d062412fa583a76c7abc48159930fb9..28c40b2e87819f10698580fcfa5dd20dcb09b4eb 100644 --- a/Gui/mainwindow.h +++ b/Gui/mainwindow.h @@ -61,11 +61,11 @@ protected slots: void save(); /// Function calls for generating GMSH files from the GUI void callGMSH(std::vector<std::string> & selectedGeometries, - std::size_t param1, - double param2, - double param3, - double param4, - bool delete_geo_file); + unsigned param1, + double param2, + double param3, + double param4, + bool delete_geo_file); /// Function calls for GMS export. void exportBoreholesToGMS(std::string listName, std::string fileName); /// Testing functionality for connection to FEM lib