diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-17 01:45:58 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-17 02:41:13 +1000 |
commit | 2024224a4ee351841f50a6f7b8a267f605a17096 (patch) | |
tree | f6f3ff8343609ccb1707b141c3deefff413018ac /tools | |
parent | e1f9e73893e3d5760dab45b9322eca9fb8ce7ac4 (diff) |
Move bezier functions
Move ImplSubdivideBezier(Polygon) to Polygon as a static function.
Move ImplSubdivideBezier(PolyPolygon) to PolyPolygon as a static function.
Change-Id: I0d006a8a2d3a8d9ba1aec913ceecb38507e4dd2f
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/poly.cxx | 12 | ||||
-rw-r--r-- | tools/source/generic/poly2.cxx | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index c2377953d5e4..f9a23a91f694 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -277,6 +277,18 @@ void ImplPolygon::ImplCreateFlagArray() } } + +Polygon Polygon::SubdivideBezier( const Polygon& rPoly ) +{ + Polygon aPoly; + + // #100127# Use adaptive subdivide instead of fixed 25 segments + rPoly.AdaptiveSubdivide( aPoly ); + + return aPoly; +} + + inline void Polygon::ImplMakeUnique() { // copy references if any exist diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index 3804cdb29114..4bff3622518d 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -295,6 +295,17 @@ void PolyPolygon::AdaptiveSubdivide( PolyPolygon& rResult, const double d ) cons } } +PolyPolygon PolyPolygon::SubdivideBezier( const PolyPolygon& rPolyPoly ) +{ + sal_uInt16 i, nPolys = rPolyPoly.Count(); + PolyPolygon aPolyPoly( nPolys ); + for( i=0; i<nPolys; ++i ) + aPolyPoly.Insert( Polygon::SubdivideBezier( rPolyPoly.GetObject(i) ) ); + + return aPolyPoly; +} + + void PolyPolygon::GetIntersection( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const { ImplDoOperation( rPolyPoly, rResult, POLY_CLIP_INT ); |