diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp index b0d8a80d744f2a114d938482e02b6a3116432a98..773e8c4b71979cabf1688215870d9e02535ef5b9 100644 --- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp +++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp @@ -215,9 +215,9 @@ int main (int argc, char* argv[]) MeshGeoToolsLib::MeshNodeSearcher mesh_searcher( *surface_mesh, std::move(search_length_strategy), MeshGeoToolsLib::SearchAllNodes::Yes); - for(std::size_t k(0); k<plys->size(); k++) { - std::vector<std::size_t> ids - (mesh_searcher.getMeshNodeIDsAlongPolyline(*((*plys)[k]))); + for (std::size_t k(0); k < plys->size(); k++) + { + auto const& ids = mesh_searcher.getMeshNodeIDs(*((*plys)[k])); if (ids.empty()) { continue; diff --git a/MeshGeoToolsLib/MeshNodeSearcher.cpp b/MeshGeoToolsLib/MeshNodeSearcher.cpp index 1e8feca4bf03f2ef1a38583ac03af24f02049082..0a039904a46e0a8762b0a892266d36b99c68dc98 100644 --- a/MeshGeoToolsLib/MeshNodeSearcher.cpp +++ b/MeshGeoToolsLib/MeshNodeSearcher.cpp @@ -133,24 +133,6 @@ std::vector<std::size_t> MeshNodeSearcher::getMeshNodeIDs( std::vector<std::size_t> const& MeshNodeSearcher::getMeshNodeIDsForPoint( GeoLib::Point const& pnt) const -{ - return getMeshNodesOnPoint(pnt).getNodeIDs(); -} - -std::vector<std::size_t> const& MeshNodeSearcher::getMeshNodeIDsAlongPolyline( - GeoLib::Polyline const& ply) const -{ - return getMeshNodesAlongPolyline(ply).getNodeIDs(); -} - -std::vector<std::size_t> const& MeshNodeSearcher::getMeshNodeIDsAlongSurface( - GeoLib::Surface const& sfc) const -{ - return getMeshNodesAlongSurface(sfc).getNodeIDs(); -} - -MeshNodesOnPoint& MeshNodeSearcher::getMeshNodesOnPoint( - GeoLib::Point const& pnt) const { if (auto const it = find_if( cbegin(_mesh_nodes_on_points), @@ -158,7 +140,7 @@ MeshNodesOnPoint& MeshNodeSearcher::getMeshNodesOnPoint( [&](auto const& nodes) { return &(nodes->getPoint()) == &pnt; }); it != cend(_mesh_nodes_on_points)) { - return **it; + return (*it)->getNodeIDs(); } _mesh_nodes_on_points.push_back( @@ -167,10 +149,10 @@ MeshNodesOnPoint& MeshNodeSearcher::getMeshNodesOnPoint( pnt, _search_length_algorithm->getSearchLength(), _search_all_nodes)); - return *_mesh_nodes_on_points.back(); + return _mesh_nodes_on_points.back()->getNodeIDs(); } -MeshNodesAlongPolyline& MeshNodeSearcher::getMeshNodesAlongPolyline( +std::vector<std::size_t> const& MeshNodeSearcher::getMeshNodeIDsAlongPolyline( GeoLib::Polyline const& ply) const { if (auto const it = find_if( @@ -179,17 +161,17 @@ MeshNodesAlongPolyline& MeshNodeSearcher::getMeshNodesAlongPolyline( [&](auto const& nodes) { return &(nodes->getPolyline()) == &ply; }); it != cend(_mesh_nodes_along_polylines)) { - return **it; + return (*it)->getNodeIDs(); } // compute nodes (and supporting points) along polyline _mesh_nodes_along_polylines.push_back(new MeshNodesAlongPolyline( _mesh, ply, _search_length_algorithm->getSearchLength(), _search_all_nodes)); - return *_mesh_nodes_along_polylines.back(); + return _mesh_nodes_along_polylines.back()->getNodeIDs(); } -MeshNodesAlongSurface& MeshNodeSearcher::getMeshNodesAlongSurface( +std::vector<std::size_t> const& MeshNodeSearcher::getMeshNodeIDsAlongSurface( GeoLib::Surface const& sfc) const { if (auto const it = find_if( @@ -198,7 +180,7 @@ MeshNodesAlongSurface& MeshNodeSearcher::getMeshNodesAlongSurface( [&](auto const& nodes) { return &(nodes->getSurface()) == &sfc; }); it != cend(_mesh_nodes_along_surfaces)) { - return **it; + return (*it)->getNodeIDs(); } // compute nodes (and supporting points) on surface @@ -207,7 +189,7 @@ MeshNodesAlongSurface& MeshNodeSearcher::getMeshNodesAlongSurface( sfc, _search_length_algorithm->getSearchLength(), _search_all_nodes)); - return *_mesh_nodes_along_surfaces.back(); + return _mesh_nodes_along_surfaces.back()->getNodeIDs(); } MeshNodeSearcher const& MeshNodeSearcher::getMeshNodeSearcher( diff --git a/MeshGeoToolsLib/MeshNodeSearcher.h b/MeshGeoToolsLib/MeshNodeSearcher.h index bc16bc881d44d9d0eda8ef0da36f91fb81132408..f7924ea18e52eceb16e568be59e167e3e3f86929 100644 --- a/MeshGeoToolsLib/MeshNodeSearcher.h +++ b/MeshGeoToolsLib/MeshNodeSearcher.h @@ -118,29 +118,6 @@ public: std::vector<std::size_t> const& getMeshNodeIDsAlongSurface( GeoLib::Surface const& sfc) const; - /** - * Return a MeshNodesOnPoint object for the given GeoLib::Point object. - * @param pnt the GeoLib::Point the nearest mesh nodes are searched for - * @return a reference to a MeshNodesOnPoint object - */ - MeshNodesOnPoint& getMeshNodesOnPoint(GeoLib::Point const& pnt) const; - - /** - * Return a MeshNodesAlongPolyline object for the given GeoLib::Polyline object. - * @param ply the GeoLib::Polyline the nearest mesh nodes are searched for - * @return a reference to a MeshNodesAlongPolyline object - */ - MeshNodesAlongPolyline& getMeshNodesAlongPolyline( - GeoLib::Polyline const& ply) const; - - /** - * Return a MeshNodesAlongSurface object for the given GeoLib::Surface object. - * @param sfc the GeoLib::Surface the nearest mesh nodes are searched for - * @return a reference to a MeshNodesAlongSurface object - */ - MeshNodesAlongSurface& getMeshNodesAlongSurface( - GeoLib::Surface const& sfc) const; - /** * Returns a (possibly new) mesh node searcher for the mesh. * A new one will be created, if it does not already exists.