diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2015-05-08 15:40:38 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2015-05-08 15:40:38 +0000 |
| commit | e18021588feee8f6872fd362b9f4ba5902ef1da9 (patch) | |
| tree | 69ed79fee65afb2a0294c1a4071909573400794f /src | |
| parent | Remove round_rectangle_outwards from helper/geom.h (diff) | |
| download | inkscape-e18021588feee8f6872fd362b9f4ba5902ef1da9.tar.gz inkscape-e18021588feee8f6872fd362b9f4ba5902ef1da9.zip | |
More helper/geom.h pruning.
Remove transform_equalp, translate_equalp and matrix_equalp.
(bzr r14059.2.10)
Diffstat (limited to 'src')
| -rw-r--r-- | src/helper/geom.cpp | 23 | ||||
| -rw-r--r-- | src/helper/geom.h | 5 | ||||
| -rw-r--r-- | src/sp-gradient-test.h | 14 |
3 files changed, 7 insertions, 35 deletions
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp index 0e97265d1..42d1a3150 100644 --- a/src/helper/geom.cpp +++ b/src/helper/geom.cpp @@ -855,29 +855,6 @@ recursive_bezier4(const double x1, const double y1, recursive_bezier4(x1234, y1234, x234, y234, x34, y34, x4, y4, m_points, level + 1); } - -namespace Geom { - -bool transform_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon) { - return - Geom::are_near(m0[0], m1[0], epsilon) && - Geom::are_near(m0[1], m1[1], epsilon) && - Geom::are_near(m0[2], m1[2], epsilon) && - Geom::are_near(m0[3], m1[3], epsilon); -} - - -bool translate_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon) { - return Geom::are_near(m0[4], m1[4], epsilon) && Geom::are_near(m0[5], m1[5], epsilon); -} - - -bool matrix_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon) { - return transform_equalp(m0, m1, epsilon) && translate_equalp(m0, m1, epsilon); -} - -} //end namespace Geom - /* Local Variables: mode:c++ diff --git a/src/helper/geom.h b/src/helper/geom.h index 22d770040..d49e2070c 100644 --- a/src/helper/geom.h +++ b/src/helper/geom.h @@ -33,11 +33,6 @@ void recursive_bezier4(const double x1, const double y1, const double x2, const std::vector<Geom::Point> &pointlist, int level); -namespace Geom{ -bool transform_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon); -bool translate_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon); -bool matrix_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon); -} #endif // INKSCAPE_HELPER_GEOM_H /* diff --git a/src/sp-gradient-test.h b/src/sp-gradient-test.h index 696072929..578d0c5c0 100644 --- a/src/sp-gradient-test.h +++ b/src/sp-gradient-test.h @@ -102,10 +102,10 @@ public: Geom::Affine const g2d(sp_gradient_get_g2d_matrix(gr, Geom::identity(), unit_rect)); Geom::Affine const gs2d(sp_gradient_get_gs2d_matrix(gr, Geom::identity(), unit_rect)); TS_ASSERT_EQUALS( g2d, Geom::identity() ); - TS_ASSERT( Geom::matrix_equalp(gs2d, gr->gradientTransform * g2d, 1e-12) ); + TS_ASSERT( Geom::are_near(gs2d, gr->gradientTransform * g2d, 1e-12) ); sp_gradient_set_gs2d_matrix(gr, Geom::identity(), unit_rect, gs2d); - TS_ASSERT( Geom::matrix_equalp(gr->gradientTransform, grXform, 1e-12) ); + TS_ASSERT( Geom::are_near(gr->gradientTransform, grXform, 1e-12) ); } gr->gradientTransform = grXform; @@ -116,10 +116,10 @@ public: Geom::Affine const g2d(sp_gradient_get_g2d_matrix(gr, funny, unit_rect)); Geom::Affine const gs2d(sp_gradient_get_gs2d_matrix(gr, funny, unit_rect)); TS_ASSERT_EQUALS( g2d, funny ); - TS_ASSERT( Geom::matrix_equalp(gs2d, gr->gradientTransform * g2d, 1e-12) ); + TS_ASSERT( Geom::are_near(gs2d, gr->gradientTransform * g2d, 1e-12) ); sp_gradient_set_gs2d_matrix(gr, funny, unit_rect, gs2d); - TS_ASSERT( Geom::matrix_equalp(gr->gradientTransform, grXform, 1e-12) ); + TS_ASSERT( Geom::are_near(gr->gradientTransform, grXform, 1e-12) ); } gr->gradientTransform = grXform; @@ -130,16 +130,16 @@ public: TS_ASSERT_EQUALS( g2d, Geom::Affine(3, 0, 0, 4, 5, 6) * funny ); - TS_ASSERT( Geom::matrix_equalp(gs2d, gr->gradientTransform * g2d, 1e-12) ); + TS_ASSERT( Geom::are_near(gs2d, gr->gradientTransform * g2d, 1e-12) ); sp_gradient_set_gs2d_matrix(gr, funny, larger_rect, gs2d); - TS_ASSERT( Geom::matrix_equalp(gr->gradientTransform, grXform, 1e-12) ); + TS_ASSERT( Geom::are_near(gr->gradientTransform, grXform, 1e-12) ); SP_OBJECT(gr)->setKeyValue( SP_ATTR_GRADIENTUNITS, "userSpaceOnUse"); Geom::Affine const user_g2d(sp_gradient_get_g2d_matrix(gr, funny, larger_rect)); Geom::Affine const user_gs2d(sp_gradient_get_gs2d_matrix(gr, funny, larger_rect)); TS_ASSERT_EQUALS( user_g2d, funny ); - TS_ASSERT( Geom::matrix_equalp(user_gs2d, gr->gradientTransform * user_g2d, 1e-12) ); + TS_ASSERT( Geom::are_near(user_gs2d, gr->gradientTransform * user_g2d, 1e-12) ); } g_object_unref(gr); } |
