b3dpolypolygontools.cxx (09dbbe93) | b3dpolypolygontools.cxx (5aaf853b) |
---|---|
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 --- 20 unchanged lines hidden (view full) --- 29#include <basegfx/polygon/b3dpolygon.hxx> 30#include <basegfx/polygon/b3dpolygontools.hxx> 31#include <numeric> 32#include <basegfx/matrix/b3dhommatrix.hxx> 33#include <basegfx/numeric/ftools.hxx> 34#include <osl/mutex.hxx> 35 36////////////////////////////////////////////////////////////////////////////// | 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 --- 20 unchanged lines hidden (view full) --- 29#include <basegfx/polygon/b3dpolygon.hxx> 30#include <basegfx/polygon/b3dpolygontools.hxx> 31#include <numeric> 32#include <basegfx/matrix/b3dhommatrix.hxx> 33#include <basegfx/numeric/ftools.hxx> 34#include <osl/mutex.hxx> 35 36////////////////////////////////////////////////////////////////////////////// |
37// predefines 38#define nMinSegments sal_uInt32(1) 39#define nMaxSegments sal_uInt32(512) |
|
37 | 40 |
41////////////////////////////////////////////////////////////////////////////// 42 |
|
38namespace basegfx 39{ 40 namespace tools 41 { 42 // B3DPolyPolygon tools 43 B3DRange getRange(const B3DPolyPolygon& rCandidate) 44 { 45 B3DRange aRetval; --- 217 unchanged lines hidden (view full) --- 263 B3DPolyPolygon aRetval; 264 sal_uInt32 a, b; 265 266 if(!nHorSeg) 267 { 268 nHorSeg = fround(fabs(fHorStop - fHorStart) / (F_2PI / 24.0)); 269 } 270 | 43namespace basegfx 44{ 45 namespace tools 46 { 47 // B3DPolyPolygon tools 48 B3DRange getRange(const B3DPolyPolygon& rCandidate) 49 { 50 B3DRange aRetval; --- 217 unchanged lines hidden (view full) --- 268 B3DPolyPolygon aRetval; 269 sal_uInt32 a, b; 270 271 if(!nHorSeg) 272 { 273 nHorSeg = fround(fabs(fHorStop - fHorStart) / (F_2PI / 24.0)); 274 } 275 |
271 if(!nHorSeg) 272 { 273 nHorSeg = 1L; 274 } | 276 // min/max limitations 277 nHorSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments, nHorSeg)); |
275 276 if(!nVerSeg) 277 { 278 nVerSeg = fround(fabs(fVerStop - fVerStart) / (F_2PI / 24.0)); 279 } 280 | 278 279 if(!nVerSeg) 280 { 281 nVerSeg = fround(fabs(fVerStop - fVerStart) / (F_2PI / 24.0)); 282 } 283 |
281 if(!nVerSeg) 282 { 283 nVerSeg = 1L; 284 } | 284 // min/max limitations 285 nVerSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments, nVerSeg)); |
285 286 // create constants 287 const double fVerDiffPerStep((fVerStop - fVerStart) / (double)nVerSeg); 288 const double fHorDiffPerStep((fHorStop - fHorStart) / (double)nHorSeg); 289 bool bHorClosed(fTools::equal(fHorStop - fHorStart, F_2PI)); 290 bool bVerFromTop(fTools::equal(fVerStart, F_PI2)); 291 bool bVerToBottom(fTools::equal(fVerStop, -F_PI2)); 292 --- 73 unchanged lines hidden (view full) --- 366 { 367 B3DPolyPolygon aRetval; 368 369 if(!nHorSeg) 370 { 371 nHorSeg = fround(fabs(fHorStop - fHorStart) / (F_2PI / 24.0)); 372 } 373 | 286 287 // create constants 288 const double fVerDiffPerStep((fVerStop - fVerStart) / (double)nVerSeg); 289 const double fHorDiffPerStep((fHorStop - fHorStart) / (double)nHorSeg); 290 bool bHorClosed(fTools::equal(fHorStop - fHorStart, F_2PI)); 291 bool bVerFromTop(fTools::equal(fVerStart, F_PI2)); 292 bool bVerToBottom(fTools::equal(fVerStop, -F_PI2)); 293 --- 73 unchanged lines hidden (view full) --- 367 { 368 B3DPolyPolygon aRetval; 369 370 if(!nHorSeg) 371 { 372 nHorSeg = fround(fabs(fHorStop - fHorStart) / (F_2PI / 24.0)); 373 } 374 |
374 if(!nHorSeg) 375 { 376 nHorSeg = 1L; 377 } | 375 // min/max limitations 376 nHorSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments, nHorSeg)); |
378 379 if(!nVerSeg) 380 { 381 nVerSeg = fround(fabs(fVerStop - fVerStart) / (F_2PI / 24.0)); 382 } 383 | 377 378 if(!nVerSeg) 379 { 380 nVerSeg = fround(fabs(fVerStop - fVerStart) / (F_2PI / 24.0)); 381 } 382 |
384 if(!nVerSeg) 385 { 386 nVerSeg = 1L; 387 } | 383 // min/max limitations 384 nVerSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments, nVerSeg)); |
388 389 // vertical loop 390 for(sal_uInt32 a(0L); a < nVerSeg; a++) 391 { 392 const double fVer(fVerStart + (((fVerStop - fVerStart) * a) / nVerSeg)); 393 const double fVer2(fVerStart + (((fVerStop - fVerStart) * (a + 1)) / nVerSeg)); 394 395 // horizontal loop --- 157 unchanged lines hidden --- | 385 386 // vertical loop 387 for(sal_uInt32 a(0L); a < nVerSeg; a++) 388 { 389 const double fVer(fVerStart + (((fVerStop - fVerStart) * a) / nVerSeg)); 390 const double fVer2(fVerStart + (((fVerStop - fVerStart) * (a + 1)) / nVerSeg)); 391 392 // horizontal loop --- 157 unchanged lines hidden --- |