b2dpolypolygontools.cxx (09dbbe93) | b2dpolypolygontools.cxx (4665f8d3) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 249 unchanged lines hidden (view full) --- 258 { 259 B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); 260 aRetval.expand(tools::getRange(aCandidate)); 261 } 262 263 return aRetval; 264 } 265 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 249 unchanged lines hidden (view full) --- 258 { 259 B2DPolygon aCandidate = rCandidate.getB2DPolygon(a); 260 aRetval.expand(tools::getRange(aCandidate)); 261 } 262 263 return aRetval; 264 } 265 |
266 void applyLineDashing(const B2DPolyPolygon& rCandidate, const ::std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget, double fFullDashDotLen) | 266 double getSignedArea(const B2DPolyPolygon& rCandidate) |
267 { | 267 { |
268 double fRetval(0.0); 269 const sal_uInt32 nPolygonCount(rCandidate.count()); 270 271 for(sal_uInt32 a(0L); a < nPolygonCount; a++) 272 { 273 const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a)); 274 275 fRetval += tools::getSignedArea(aCandidate); 276 } 277 278 return fRetval; 279 } 280 281 double getArea(const B2DPolyPolygon& rCandidate) 282 { 283 return fabs(getSignedArea(rCandidate)); 284 } 285 286 void applyLineDashing(const B2DPolyPolygon& rCandidate, const ::std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget, double fFullDashDotLen) 287 { |
|
268 if(0.0 == fFullDashDotLen && rDotDashArray.size()) 269 { 270 // calculate fFullDashDotLen from rDotDashArray 271 fFullDashDotLen = ::std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); 272 } 273 274 if(rCandidate.count() && fFullDashDotLen > 0.0) 275 { --- 306 unchanged lines hidden --- | 288 if(0.0 == fFullDashDotLen && rDotDashArray.size()) 289 { 290 // calculate fFullDashDotLen from rDotDashArray 291 fFullDashDotLen = ::std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); 292 } 293 294 if(rCandidate.count() && fFullDashDotLen > 0.0) 295 { --- 306 unchanged lines hidden --- |