https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: b4c3947e34b8be928424f7e548e572c4c03cafc2 authored by Christoph Lehmann on 28 March 2023, 15:14:29 UTC
Merge branch 'strong-type' into 'master'
Tip revision: b4c3947
ProjectPointOnMesh.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2023, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#pragma once

#include <vector>
#include "MeshLib/Node.h"
#include "MeshLib/Elements/Element.h"

namespace MeshLib
{
namespace ProjectPointOnMesh
{

/// Returns the element in which the given node is located when projected onto a
/// mesh, or nullptr if no such element was found.
Element const* getProjectedElement(std::vector<const Element*> const& elements,
                                   MathLib::Point3d const& node);

/// Returns the z-coordinate of a point projected onto the plane defined by a
/// mesh element.
double getElevation(Element const& element, MathLib::Point3d const& node);

}  // namespace ProjectPointOnMesh

}  // end namespace MeshLib
back to top