mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -70,8 +70,11 @@ UNIT_TEST(ScreenBase_3dTransform)
|
||||
|
||||
p3d = m2::PointD(screen.PixelRectIn3d().SizeX() / 2.0, screen.PixelRectIn3d().SizeY() / 2.0);
|
||||
pp = screen.P3dtoP(p3d);
|
||||
TEST(pp.EqualDxDy(m2::PointD(screen.PixelRect().SizeX() / 2.0,
|
||||
screen.PixelRect().SizeY() - screen.PixelRectIn3d().SizeY() / (2.0 * cos(rotationAngle))), kEps), ());
|
||||
TEST(
|
||||
pp.EqualDxDy(m2::PointD(screen.PixelRect().SizeX() / 2.0,
|
||||
screen.PixelRect().SizeY() - screen.PixelRectIn3d().SizeY() / (2.0 * cos(rotationAngle))),
|
||||
kEps),
|
||||
());
|
||||
|
||||
p3d = m2::PointD(0, 0);
|
||||
pp = screen.P3dtoP(p3d);
|
||||
@@ -147,12 +150,10 @@ UNIT_TEST(ScreenBase_CalcTransform)
|
||||
double dx = 1;
|
||||
double dy = 2;
|
||||
double s1, a1, dx1, dy1;
|
||||
math::Matrix<double, 3, 3> m = ScreenBase::CalcTransform(
|
||||
m2::PointD(0, 1), m2::PointD(1, 1),
|
||||
m2::PointD( s * sin(a) + dx, s * cos(a) + dy),
|
||||
m2::PointD(s * cos(a) + s * sin(a) + dx, -s * sin(a) + s * cos(a) + dy),
|
||||
true /* allow rotate */,
|
||||
true /* allow scale*/);
|
||||
math::Matrix<double, 3, 3> m =
|
||||
ScreenBase::CalcTransform(m2::PointD(0, 1), m2::PointD(1, 1), m2::PointD(s * sin(a) + dx, s * cos(a) + dy),
|
||||
m2::PointD(s * cos(a) + s * sin(a) + dx, -s * sin(a) + s * cos(a) + dy),
|
||||
true /* allow rotate */, true /* allow scale*/);
|
||||
|
||||
ScreenBase::ExtractGtoPParams(m, a1, s1, dx1, dy1);
|
||||
|
||||
@@ -194,26 +195,18 @@ UNIT_TEST(ScreenBase_CombineTransforms)
|
||||
|
||||
{
|
||||
// GtoP matrix for scale only.
|
||||
math::Matrix<double, 3, 3> m =
|
||||
math::Shift(
|
||||
math::Scale(math::Identity<double, 3>(),
|
||||
1.0 / fixedScale, -1.0 / fixedScale),
|
||||
sCopy.PixelRect().Center());
|
||||
math::Matrix<double, 3, 3> m = math::Shift(
|
||||
math::Scale(math::Identity<double, 3>(), 1.0 / fixedScale, -1.0 / fixedScale), sCopy.PixelRect().Center());
|
||||
|
||||
TEST(is_equal(sCopy.GtoP(g1), g1 * m), ());
|
||||
TEST(is_equal(sCopy.GtoP(g2), g2 * m), ());
|
||||
}
|
||||
|
||||
// GtoP matrix to make full final transformation.
|
||||
math::Matrix<double, 3, 3> m =
|
||||
math::Shift(
|
||||
math::Scale(
|
||||
math::Rotate(
|
||||
math::Shift(math::Identity<double, 3>(),
|
||||
-sCopy.PixelRect().Center()),
|
||||
angle),
|
||||
fixedScale / scale, fixedScale / scale),
|
||||
org);
|
||||
math::Matrix<double, 3, 3> m = math::Shift(
|
||||
math::Scale(math::Rotate(math::Shift(math::Identity<double, 3>(), -sCopy.PixelRect().Center()), angle),
|
||||
fixedScale / scale, fixedScale / scale),
|
||||
org);
|
||||
|
||||
m2::PointD pp1 = sCopy.GtoP(g1) * m;
|
||||
m2::PointD pp2 = sCopy.GtoP(g2) * m;
|
||||
@@ -221,4 +214,4 @@ UNIT_TEST(ScreenBase_CombineTransforms)
|
||||
TEST(is_equal(p1, pp1), (p1, pp1));
|
||||
TEST(is_equal(p2, pp2), (p2, pp2));
|
||||
}
|
||||
} // namespace screen_test
|
||||
} // namespace screen_test
|
||||
|
||||
Reference in New Issue
Block a user