https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 01bf7817631fce275cb24eff6f2a7adbb421ef51 authored by Lars Bilke on 01 November 2021, 08:35:14 UTC
Revert "[ci] Disable frontend job during EVE maintenance."
Tip revision: 01bf781
AutoCheckGenerators.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#include "Tests/GeoLib/AutoCheckGenerators.h"

namespace autocheck
{
// reflect point p on the point c in x-y plane
MathLib::Point3d reflect(MathLib::Point3d const& c, MathLib::Point3d const& p)
{
    return MathLib::Point3d(
        std::array<double, 3>{{2 * c[0] - p[0], 2 * c[1] - p[1], 0.0}});
}

GeoLib::LineSegment translate(Eigen::Vector3d const& translation,
                              GeoLib::LineSegment const& line_seg)
{
    auto a = std::make_unique<GeoLib::Point>(line_seg.getBeginPoint());
    auto b = std::make_unique<GeoLib::Point>(line_seg.getEndPoint());
    for (std::size_t k(0); k < 3; ++k)
    {
        (*a)[k] += translation[k];
    }
    for (std::size_t k(0); k < 3; ++k)
    {
        (*b)[k] += translation[k];
    }
    return GeoLib::LineSegment{a.release(), b.release(), true};
}

}  // namespace autocheck
back to top