Revision 7d3e1e745356cd3f2235c2b40526187c0c486053 authored by Norbert Grunwald on 17 June 2021, 19:04:54 UTC, committed by Dmitri Naumov on 04 July 2021, 12:22:40 UTC
1 parent f44c0e5
TestDividedByPlane.cpp
/**
* \file
* \author Karsten Rink
* \date 2014-02-26
*
* \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 <gtest/gtest.h>
#include "MathLib/GeometricBasics.h"
#include "MathLib/Point3d.h"
TEST(MathLib, TestDividedByPlane)
{
// xy plane
MathLib::Point3d a(std::array<double, 3>{{0, 0, 0}});
MathLib::Point3d b(std::array<double, 3>{{1, 0, 0}});
MathLib::Point3d c(std::array<double, 3>{{0, 1, 0}});
MathLib::Point3d d(std::array<double, 3>{{1, 1, 0}});
bool result = MathLib::dividedByPlane(a, d, b, c);
ASSERT_TRUE(result);
result = MathLib::dividedByPlane(b, c, a, d);
ASSERT_TRUE(result);
d = MathLib::Point3d(std::array<double, 3>{{0.1, 0.1, 0}});
result = MathLib::dividedByPlane(b, c, a, d);
ASSERT_FALSE(result);
// xz plane
c = MathLib::Point3d(std::array<double, 3>{{0, 0, 1}});
d = MathLib::Point3d(std::array<double, 3>{{1, 0, 1}});
result = MathLib::dividedByPlane(a, d, b, c);
ASSERT_TRUE(result);
// yz plane
b = MathLib::Point3d(std::array<double, 3>{{0, 1, 0}});
d = MathLib::Point3d(std::array<double, 3>{{0, 1, 1}});
result = MathLib::dividedByPlane(a, d, b, c);
ASSERT_TRUE(result);
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...