OGS
MeshNodeSearcher.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7#include <vector>
8
10#include "GeoLib/Grid.h"
14
15// forward declaration
16namespace GeoLib
17{
18struct GeoObject;
19class Point;
20class Polyline;
21class Surface;
22}
23
24namespace MeshLib
25{
26class Mesh;
27class Node;
28}
29
30namespace MeshGeoToolsLib
31{
35}
36
37namespace MeshGeoToolsLib
38{
39
46{
47public:
58 std::unique_ptr<MeshGeoToolsLib::SearchLength>&&
59 search_length_algorithm,
60 SearchAllNodes search_all_nodes);
61
62 virtual ~MeshNodeSearcher();
63
69 std::vector<std::size_t> getMeshNodeIDs(
70 GeoLib::GeoObject const& geoObj) const;
71
77 std::vector<std::size_t> getMeshNodeIDs(
78 std::vector<MathLib::Point3dWithID*> const& points) const;
79
85 static MeshNodeSearcher const&
87 std::unique_ptr<MeshGeoToolsLib::SearchLength>&&
88 search_length_algorithm);
89
90private:
93 std::unique_ptr<MeshGeoToolsLib::SearchLength> _search_length_algorithm;
95 // with newer compiler we can omit to use a pointer here
96 mutable std::vector<MeshNodesOnPoint*> _mesh_nodes_on_points;
97 mutable std::vector<MeshNodesAlongPolyline*> _mesh_nodes_along_polylines;
98 mutable std::vector<MeshNodesAlongSurface*> _mesh_nodes_along_surfaces;
99
101 static std::vector<std::unique_ptr<MeshNodeSearcher>> _mesh_node_searchers;
102};
103
104} // end namespace MeshGeoToolsLib
#define OGS_NO_DANGLING
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
Definition Polyline.h:29
A Surface is represented by Triangles. It consists of a reference to a vector of (pointers to) points...
std::vector< MeshNodesOnPoint * > _mesh_nodes_on_points
std::vector< std::size_t > getMeshNodeIDs(GeoLib::GeoObject const &geoObj) const
GeoLib::Grid< MeshLib::Node > _mesh_grid
static std::vector< std::unique_ptr< MeshNodeSearcher > > _mesh_node_searchers
Mesh node searcher for the meshes indexed by the meshs' ids.
std::unique_ptr< MeshGeoToolsLib::SearchLength > _search_length_algorithm
std::vector< MeshNodesAlongSurface * > _mesh_nodes_along_surfaces
static OGS_NO_DANGLING MeshNodeSearcher const & getMeshNodeSearcher(MeshLib::Mesh const &mesh, std::unique_ptr< MeshGeoToolsLib::SearchLength > &&search_length_algorithm)
std::vector< MeshNodesAlongPolyline * > _mesh_nodes_along_polylines
MeshNodeSearcher(MeshLib::Mesh const &mesh, std::unique_ptr< MeshGeoToolsLib::SearchLength > &&search_length_algorithm, SearchAllNodes search_all_nodes)