diff --git a/Applications/DataExplorer/DataView/GEOModels.cpp b/Applications/DataExplorer/DataView/GEOModels.cpp index 952f62457638cb69cc8315f27e9f66adb6494105..b675fd0bff6076d1887a466689f54a157c916296 100644 --- a/Applications/DataExplorer/DataView/GEOModels.cpp +++ b/Applications/DataExplorer/DataView/GEOModels.cpp @@ -39,9 +39,19 @@ GEOModels::~GEOModels() void GEOModels::updateGeometry(const std::string& geo_name) { - GeoLib::PointVec* points(_geo_objects.getPointVecObj(geo_name)); - GeoLib::PolylineVec* lines(_geo_objects.getPolylineVecObj(geo_name)); - GeoLib::SurfaceVec* surfaces(_geo_objects.getSurfaceVecObj(geo_name)); + auto const stations = _geo_objects.getStationVec(geo_name); + if (stations) + { + emit stationVectorRemoved(_stationModel, geo_name); + _stationModel->removeStationList(geo_name); + _stationModel->addStationList(QString::fromStdString(geo_name), stations); + emit stationVectorAdded(_stationModel, geo_name); + return; + } + + auto const points = _geo_objects.getPointVecObj(geo_name); + auto const lines = _geo_objects.getPolylineVecObj(geo_name); + auto const surfaces = _geo_objects.getSurfaceVecObj(geo_name); if (points) { diff --git a/Applications/DataExplorer/DataView/StationTreeView.cpp b/Applications/DataExplorer/DataView/StationTreeView.cpp index 3949001ffdf830e3eeb83b1f7d6036a1ba5c0853..67751b585cf2edbd3c8099a303d82b15eb6c4e6d 100644 --- a/Applications/DataExplorer/DataView/StationTreeView.cpp +++ b/Applications/DataExplorer/DataView/StationTreeView.cpp @@ -104,9 +104,11 @@ void StationTreeView::contextMenuEvent(QContextMenuEvent* event) if (item->childCount() > 0) { QMenu menu; + QAction* mapAction = menu.addAction("Map stations..."); QAction* exportAction = menu.addAction("Export to GMS..."); menu.addSeparator(); + connect(mapAction, SIGNAL(triggered()), this, SLOT(mapStations())); connect(exportAction, SIGNAL(triggered()), this, SLOT(exportList())); menu.exec(event->globalPos()); } @@ -151,6 +153,15 @@ void StationTreeView::setNameForElement() emit requestNameChangeDialog(stn_vec_name, item->row()); } +void StationTreeView::mapStations() +{ + TreeItem const* const item = + static_cast<StationTreeModel*>(model())->getItem( + this->selectionModel()->currentIndex()); + std::string const& geo_name(item->data(0).toString().toStdString()); + emit geometryMappingRequested(geo_name); +} + void StationTreeView::displayStratigraphy() { QModelIndex index = this->selectionModel()->currentIndex(); diff --git a/Applications/DataExplorer/DataView/StationTreeView.h b/Applications/DataExplorer/DataView/StationTreeView.h index 154d74678debc8071b9590d54211cc0e381d41b7..f9ea977edc600270be56e07f0a4d432cf077bfc8 100644 --- a/Applications/DataExplorer/DataView/StationTreeView.h +++ b/Applications/DataExplorer/DataView/StationTreeView.h @@ -59,6 +59,7 @@ private slots: void displayStratigraphy(); void exportList(); void exportStation(); + void mapStations(); void removeStationList(); /// Calls a SetNameDialog. void setNameForElement(); @@ -69,6 +70,7 @@ signals: void enableSaveButton(bool); void enableRemoveButton(bool); void geoItemSelected(const vtkPolyDataAlgorithm*, int); + void geometryMappingRequested(const std::string&); void removeGeoItemSelection(); void itemSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected); diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index f5d42b5196f3f7236d4a79f27e5d3d4db7bb7a92..6c148d1dd0298130e25c657c28b148e87c6cf49c 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -141,6 +141,9 @@ MainWindow::MainWindow(QWidget* parent /* = 0*/) : QMainWindow(parent) connect(stationTabWidget->treeView, SIGNAL(requestNameChangeDialog(const std::string&, std::size_t)), this, SLOT(showStationNameDialog(const std::string&, std::size_t))); + connect(stationTabWidget->treeView, + SIGNAL(geometryMappingRequested(const std::string&)), this, + SLOT(mapGeometry(const std::string&))); connect(stationTabWidget->treeView, SIGNAL(diagramRequested(QModelIndex&)), this, SLOT(showDiagramPrefsDialog( diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 1cef01614cfa2b9f175b7a96e1bda88f4e65ce92..1785814235579f30e3d767ade724fb5ba9b9ddc7 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -156,6 +156,7 @@ void GeoMapper::mapStationData(std::vector<GeoLib::Point*> const& points) if (!GeoLib::isBorehole(pnt)) { + (*pnt)[2] = offset; continue; } auto const& layers =