32#include <svx/strings.hrc>
50#include <osl/diagnose.h>
54static sal_uInt16
GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax,
bool bClosed)
65static sal_uInt16
GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax,
bool bClosed)
68 if (nPnt>nPntMax || (bClosed && nPnt>=nPntMax)) nPnt=0;
81 sal_uInt16 nPointCount;
88 sal_uInt16 nPrevPrevPnt;
89 sal_uInt16 nNextNextPnt;
94 sal_uInt16 nPrevPrevPnt0;
98 sal_uInt16 nNextNextPnt0;
101 bool mbMultiPointDrag;
104 std::vector<SdrHdl*> maHandles;
109 bool IsMultiPointDrag()
const {
return mbMultiPointDrag; }
125 , bPrevIsBegPnt(false)
126 , bNextIsEndPnt(false)
130 , bIsNextControl(false)
131 , bPrevIsControl(false)
132 , bNextIsControl(false)
139 , mbMultiPointDrag(bMuPoDr)
140 , maOrig(rPO.GetPathPoly())
150 for(
size_t a = 0;
a < nHdlCount; ++
a)
154 if(pTestHdl && pTestHdl->
IsSelected() && pTestHdl->
GetObj() == pInteractionObject)
156 maHandles.push_back(pTestHdl);
165 sal_uInt16 nPntMax = 0;
168 nPoly=
static_cast<sal_uInt16
>(rHdl.
GetPolyNum());
171 nPointCount=aTmpXP.GetPointCount();
172 if (nPointCount==0 || (bClosed && nPointCount==1))
return;
173 nPntMax=nPointCount-1;
174 bBegPnt=!bClosed && nPnt==0;
175 bEndPnt=!bClosed && nPnt==nPntMax;
176 if (bClosed && nPointCount<=3) {
177 bBegPnt=(nPointCount<3) || nPnt==0;
178 bEndPnt=(nPointCount<3) || nPnt==nPntMax-1;
182 if (!bBegPnt) nPrevPnt=
GetPrevPnt(nPnt,nPntMax,bClosed);
183 if (!bEndPnt) nNextPnt=
GetNextPnt(nPnt,nPntMax,bClosed);
184 bPrevIsBegPnt=bBegPnt || (!bClosed && nPrevPnt==0);
185 bNextIsEndPnt=bEndPnt || (!bClosed && nNextPnt==nPntMax);
188 if (!bPrevIsBegPnt) nPrevPrevPnt=
GetPrevPnt(nPrevPnt,nPntMax,bClosed);
189 if (!bNextIsEndPnt) nNextNextPnt=
GetNextPnt(nNextPnt,nPntMax,bClosed);
191 bIsNextControl=
false;
192 bPrevIsControl=
false;
193 bNextIsControl=
false;
195 bIsNextControl=!aTmpXP.IsControl(nPrevPnt);
197 bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==PolyFlags::Control;
198 bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==PolyFlags::Control;
200 nPrevPrevPnt0=nPrevPrevPnt;
204 nNextNextPnt0=nNextNextPnt;
216void ImpSdrPathDragData::ResetPoly(
const SdrPathObj& rPO)
219 aXP[0]=aTmpXP[nPrevPrevPnt0]; aXP.SetFlags(0,aTmpXP.GetFlags(nPrevPrevPnt0));
220 aXP[1]=aTmpXP[nPrevPnt0]; aXP.SetFlags(1,aTmpXP.GetFlags(nPrevPnt0));
221 aXP[2]=aTmpXP[nPnt0]; aXP.SetFlags(2,aTmpXP.GetFlags(nPnt0));
222 aXP[3]=aTmpXP[nNextPnt0]; aXP.SetFlags(3,aTmpXP.GetFlags(nNextPnt0));
223 aXP[4]=aTmpXP[nNextNextPnt0]; aXP.SetFlags(4,aTmpXP.GetFlags(nNextNextPnt0));
254 sal_uInt16 nBezierStartPoint;
259 ImpPathCreateUser(): nCircRadius(0),nCircStAngle(0),nCircRelAngle(0),
260 bBezier(false),bBezHasCtrl0(false),bCircle(false),bAngleSnap(false),bLine(false),bLine90(false),bRect(false),
263 void ResetFormFlags() { bBezier=
false; bCircle=
false; bLine=
false; bRect=
false; }
264 bool IsFormFlag()
const {
return bBezier || bCircle || bLine || bRect; }
266 void CalcBezier(
const Point& rP1,
const Point& rP2,
const Point& rDir,
bool bMouseDown);
279XPolygon ImpPathCreateUser::GetFormPoly()
const
281 if (bBezier)
return GetBezierPoly();
282 if (bCircle)
return GetCirclePoly();
283 if (bLine)
return GetLinePoly();
284 if (bRect)
return GetRectPoly();
288void ImpPathCreateUser::CalcBezier(
const Point& rP1,
const Point& rP2,
const Point& rDir,
bool bMouseDown)
296 if (!bMouseDown || (0 == aBezEnd.X() && 0 == aBezEnd.Y())) aBezEnd=rP2;
301XPolygon ImpPathCreateUser::GetBezierPoly()
const
304 aXP[0]=aBezStart; aXP.SetFlags(0,PolyFlags::Smooth);
305 aXP[1]=aBezCtrl1; aXP.SetFlags(1,PolyFlags::Control);
306 aXP[2]=aBezCtrl2; aXP.SetFlags(2,PolyFlags::Control);
311void ImpPathCreateUser::CalcCircle(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView)
322 bool bRet=nTmpAngle!=9000_deg100 && nTmpAngle!=27000_deg100;
326 double nR=
static_cast<double>(
GetLen(
Point(dx,dy)))/cs/2;
327 nRad=std::abs(
FRound(nR));
329 if (dAngle<18000_deg100) {
332 aCircCenter.AdjustX(
FRound(nRad * cos(
toRadians(nTangAngle + 9000_deg100))));
333 aCircCenter.AdjustY(-(
FRound(nRad * sin(
toRadians(nTangAngle + 9000_deg100)))));
337 aCircCenter.AdjustX(
FRound(nRad * cos(
toRadians(nTangAngle - 9000_deg100))));
338 aCircCenter.AdjustY(-(
FRound(nRad * sin(
toRadians(nTangAngle - 9000_deg100)))));
344 bool bNeg=nCircRelAngle<0_deg100;
345 if (bNeg) nCircRelAngle=-nCircRelAngle;
346 nCircRelAngle+=nSA/2_deg100;
350 if (bNeg) nCircRelAngle=-nCircRelAngle;
354 if (nRad==0 ||
abs(nCircRelAngle).
get()<5) bRet=
false;
358XPolygon ImpPathCreateUser::GetCirclePoly()
const
360 if (nCircRelAngle>=0_deg100) {
361 XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
362 nCircStAngle, nCircStAngle+nCircRelAngle,
false);
363 aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::Smooth);
364 if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
367 XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
369 sal_uInt16
nCount=aXP.GetPointCount();
370 for (sal_uInt16 nNum=nCount/2; nNum>0;) {
373 Point aPt(aXP[nNum]);
377 aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::Smooth);
378 if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
398 if ((l1<=l2) != (pView!=
nullptr && pView->
IsBigOrtho())) {
407void ImpPathCreateUser::CalcLine(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView)
412 if (rP1==rP2 || (rDir.
X()==0 && rDir.
Y()==0)) { bLine=
false;
return; }
413 Point aTmpPt(rP2-rP1);
416 Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt;
tools::Long nQ1=std::abs(aP1.X())+std::abs(aP1.Y());
417 Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt;
tools::Long nQ2=std::abs(aP2.X())+std::abs(aP2.Y());
418 if (pView!=
nullptr && pView->
IsOrtho()) nQ1=0;
428XPolygon ImpPathCreateUser::GetLinePoly()
const
431 aXP[0]=aLineStart;
if (!bLine90) aXP.SetFlags(0,PolyFlags::Smooth);
436void ImpPathCreateUser::CalcRect(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView)
441 if (rP1==rP2 || (rDir.
X()==0 && rDir.
Y()==0)) { bRect=
false;
return; }
442 Point aTmpPt(rP2-rP1);
459 double nGKathLen=nHypLen*sn;
465 if (pView!=
nullptr && pView->
IsOrtho()) {
470 bool b1MoreThan2=dx1a+dy1a>dx2a+dy2a;
472 tools::Long xtemp=dy2a-dx1a;
if (dx1<0) xtemp=-xtemp;
473 tools::Long ytemp=dx2a-dy1a;
if (dy1<0) ytemp=-ytemp;
474 aRectP2.AdjustX(xtemp );
475 aRectP2.AdjustY(ytemp );
476 aRectP3.AdjustX(xtemp );
477 aRectP3.AdjustY(ytemp );
479 tools::Long xtemp=dy1a-dx2a;
if (dx2<0) xtemp=-xtemp;
480 tools::Long ytemp=dx1a-dy2a;
if (dy2<0) ytemp=-ytemp;
481 aRectP3.AdjustX(xtemp );
482 aRectP3.AdjustY(ytemp );
488XPolygon ImpPathCreateUser::GetRectPoly()
const
491 aXP[0]=aRectP1; aXP.SetFlags(0,PolyFlags::Smooth);
493 if (aRectP3!=aRectP2) aXP[2]=aRectP3;
502 std::unique_ptr<ImpSdrPathDragData>
537: mrSdrPathObject(rSdrPathObject),
538 aPathPolygon(rSdrPathObject.GetPathPoly()),
539 meObjectKind(mrSdrPathObject.meKind),
550 bool bMultiPointDrag(
true);
553 bMultiPointDrag =
false;
561 sal_uInt32 nSelectedPoints(0);
563 for(
size_t a = 0;
a < nHdlCount; ++
a)
567 if(pTestHdl && pTestHdl->
IsSelected() && pTestHdl->
GetObj() == pInteractionObject)
573 if(nSelectedPoints <= 1)
574 bMultiPointDrag =
false;
581 OSL_FAIL(
"ImpPathForDragAndCreate::BegDrag(): ImpSdrPathDragData is invalid.");
593 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
601 if(aDelta.
X() || aDelta.
Y())
605 const sal_uInt16 nPolyIndex(
static_cast<sal_uInt16
>(pHandle->
GetPolyNum()));
606 const sal_uInt16 nPointIndex(
static_cast<sal_uInt16
>(pHandle->
GetPointNum()));
610 bool bClosed(rOrig[0] == rOrig[nPointCount-1]);
613 rMove[nPointIndex] = rOrig[nPointIndex] + aDelta;
616 if(nPointCount > 0 && !nPointIndex && bClosed)
618 rMove[nPointCount - 1] = rOrig[nPointCount - 1] + aDelta;
622 if(nPointCount > 1 && rOrig.
IsControl(nPointCount - 2))
623 rMove[nPointCount - 2] = rOrig[nPointCount - 2] + aDelta;
627 if(nPointIndex > 0 && rOrig.
IsControl(nPointIndex - 1))
630 rMove[nPointIndex - 1] = rOrig[nPointIndex - 1] + aDelta;
634 if(nPointIndex + 1 < nPointCount && rOrig.
IsControl(nPointIndex + 1))
637 rMove[nPointIndex + 1] = rOrig[nPointIndex + 1] + aDelta;
667 sal_uInt16 nPnt1=0xFFFF,nPnt2=0xFFFF;
668 Point aNewPos1,aNewPos2;
669 bool bPnt1 =
false, bPnt2 =
false;
671 if (!bBegPnt) nPnt1=nPrevPnt;
672 if (!bEndPnt) nPnt2=nNextPnt;
678 if (nPnt1!=0xFFFF && !bPrevIsControl) {
684 if (!bHLin || !bVLin) {
688 double nXFact=0;
if (!bVLin) nXFact=
static_cast<double>(ndx)/
static_cast<double>(ndx0);
689 double nYFact=0;
if (!bHLin) nYFact=
static_cast<double>(ndy)/
static_cast<double>(ndy0);
690 bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
691 bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
699 if (nPnt2!=0xFFFF && !bNextIsControl) {
705 if (!bHLin || !bVLin) {
709 double nXFact=0;
if (!bVLin) nXFact=
static_cast<double>(ndx)/
static_cast<double>(ndx0);
710 double nYFact=0;
if (!bHLin) nYFact=
static_cast<double>(ndy)/
static_cast<double>(ndy0);
711 bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
712 bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
720 if (bPnt1 && bPnt2) {
721 BigInt nX1(aNewPos1.
X()-aPos.
X()); nX1*=nX1;
722 BigInt nY1(aNewPos1.
Y()-aPos.
Y()); nY1*=nY1;
723 BigInt nX2(aNewPos2.
X()-aPos.
X()); nX2*=nX2;
724 BigInt nY2(aNewPos2.
Y()-aPos.
Y()); nY2*=nY2;
728 if (nX1<nX2) bPnt2=
false;
else bPnt1=
false;
730 if (bPnt1) rDrag.
SetNow(aNewPos1);
731 if (bPnt2) rDrag.
SetNow(aNewPos2);
737 !bBegPnt && !bEndPnt && !bPrevIsControl && !bNextIsControl)
778 if (bIsNextControl) {
796 if (bPrevIsControl && !bNextIsControl && !bEndPnt) {
799 if (bNextIsControl && !bPrevIsControl && !bBegPnt) {
806 if (!bBegPnt && !bPrevIsControl && !bPrevIsBegPnt &&
mpSdrPathDragData->aXP.IsSmooth(nPrevPnt)) {
811 if (!bEndPnt && !bNextIsControl && !bNextIsEndPnt &&
mpSdrPathDragData->aXP.IsSmooth(nNextPnt)) {
827 if (bLineGlueMirror) {
835 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
863 sal_uInt32 nPoly,nPnt;
865 if(PolyPolygonEditor::GetRelativePolyPoint(aTempPolyPolygon, rDrag.
GetHdl()->
GetSourceHdlNum(), nPoly, nPnt))
870 if(aCandidate.
count() < 2)
872 aTempPolyPolygon.
remove(nPoly);
888 bool bXMirr=(aLinePt1_.
X()>aLinePt2_.
X())!=(aLinePt1.
X()>aLinePt2.
X());
889 bool bYMirr=(aLinePt1_.
Y()>aLinePt2_.
Y())!=(aLinePt1.
Y()>aLinePt2.
Y());
890 if (bXMirr || bYMirr) {
917 if(bCreateComment && rDrag.
GetUser())
920 const ImpPathCreateUser* pU =
static_cast<const ImpPathCreateUser*
>(rDrag.
GetUser());
949 sal_Int32 nLen(
GetLen(aNow));
974 pDragData =
static_cast<ImpSdrPathDragData*
>(rDrag.
GetUser());
979 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
983 if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
989 OUString aStr2(
SvxResId(STR_EditDelete));
992 aStr2 = aStr2.replaceFirst(
"%1",
aStr);
1009 if(!pDragData->IsMultiPointDrag())
1011 sal_uInt16 nPntNum(
static_cast<sal_uInt16
>(pHdl->
GetPointNum()));
1022 sal_uInt16
nRef(nPntNum);
1029 aNow -= rXPoly[
nRef];
1031 sal_Int32 nLen(
GetLen(aNow));
1038 else if(nPointCount > 1)
1040 sal_uInt16 nPntMax(nPointCount - 1);
1042 bool bPt1(nPntNum > 0);
1043 bool bPt2(nPntNum < nPntMax);
1045 if(bIsClosed && nPointCount > 2)
1051 sal_uInt16 nPt1,nPt2;
1058 if(nPntNum < nPntMax)
1072 aPt -= rXPoly[nPt1];
1074 sal_Int32 nLen(
GetLen(aPt));
1090 aPt -= rXPoly[nPt2];
1092 sal_Int32 nLen(
GetLen(aPt));
1110 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
1126 aRetval.
Insert(std::move(aXPoly));
1152 if (bIsNextControl) {
1188 else if (!bBegPnt && !bPrevIsBegPnt &&
mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
1193 if (bBegPnt) aXPoly.
Remove(0,1);
1196 else if (!bEndPnt && !bNextIsEndPnt &&
mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
1212 aRetval.
Insert(std::move(aXPoly));
1229 bool bMakeStartPoint =
true;
1233 bMakeStartPoint =
false;
1237 if (bMakeStartPoint) {
1240 std::unique_ptr<ImpPathCreateUser> pU(
new ImpPathCreateUser);
1248 ImpPathCreateUser* pU=
static_cast<ImpPathCreateUser*
>(rStat.
GetUser());
1274 pU->eCurrentKind=eNewKind;
1275 pU->bMixedCreate=
true;
1277 if (pU->nBezierStartPoint>0) pU->nBezierStartPoint--;
1286 rXPoly[1]=rStat.
GetNow();
1289 if (nCurrentPoint==0) {
1291 }
else nCurrentPoint--;
1295 rXPoly[nCurrentPoint]=rStat.
GetNow();
1306 if (pU->nBezierStartPoint>nCurrentPoint) pU->nBezierStartPoint=nCurrentPoint;
1311 if (
pOut!=
nullptr) nMinDist=
pOut->PixelToLogic(
Size(nMinDist,0)).Width();
1312 if (nMinDist<1) nMinDist=1;
1314 Point aPt0(rXPoly[nCurrentPoint-1]);
1318 if (dx<nMinDist && dy<nMinDist)
return false;
1323 if (nCurrentPoint-pU->nBezierStartPoint>=3 && ((nCurrentPoint-pU->nBezierStartPoint)%3)==0) {
1325 rXPoly.
SetFlags(nCurrentPoint-1,PolyFlags::Control);
1326 rXPoly.
SetFlags(nCurrentPoint-2,PolyFlags::Control);
1328 if (nCurrentPoint>=6 && rXPoly.
IsControl(nCurrentPoint-4)) {
1329 rXPoly.
CalcTangent(nCurrentPoint-3,nCurrentPoint-4,nCurrentPoint-2);
1330 rXPoly.
SetFlags(nCurrentPoint-3,PolyFlags::Smooth);
1333 rXPoly[nCurrentPoint+1]=rStat.
GetNow();
1336 pU->nBezierStartPoint=nCurrentPoint;
1340 pU->ResetFormFlags();
1342 if (nCurrentPoint>=2) {
1343 pU->CalcBezier(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],rStat.
IsMouseDown());
1344 }
else if (pU->bBezHasCtrl0) {
1345 pU->CalcBezier(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],pU->aBezControl0-rXPoly[nCurrentPoint-1],rStat.
IsMouseDown());
1349 pU->CalcCircle(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView);
1352 pU->CalcLine(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView);
1355 pU->CalcRect(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView);
1363 ImpPathCreateUser* pU=
static_cast<ImpPathCreateUser*
>(rStat.
GetUser());
1369 rXPoly[nCurrentPoint]=rStat.
GetNow();
1380 if (!pU->bMixedCreate &&
IsFreeHand(pU->eStartKind)) {
1391 if (nCurrentPoint==0 || rStat.
GetNow()!=rXPoly[nCurrentPoint-1]) {
1393 if (pU->nBezierStartPoint>nCurrentPoint) pU->nBezierStartPoint=nCurrentPoint;
1394 if (
IsBezier(pU->eCurrentKind) && nCurrentPoint-pU->nBezierStartPoint>=3 && ((nCurrentPoint-pU->nBezierStartPoint)%3)==0) {
1396 rXPoly.
SetFlags(nCurrentPoint-1,PolyFlags::Control);
1397 rXPoly.
SetFlags(nCurrentPoint-2,PolyFlags::Control);
1399 if (nCurrentPoint>=6 && rXPoly.
IsControl(nCurrentPoint-4)) {
1400 rXPoly.
CalcTangent(nCurrentPoint-3,nCurrentPoint-4,nCurrentPoint-2);
1401 rXPoly.
SetFlags(nCurrentPoint-3,PolyFlags::Smooth);
1405 if (nCurrentPoint==1 &&
IsBezier(pU->eCurrentKind) && !pU->bBezHasCtrl0) {
1406 pU->aBezControl0=rStat.
GetNow();
1407 pU->bBezHasCtrl0=
true;
1410 if (pU->IsFormFlag()) {
1412 rXPoly.
Remove(nCurrentPoint-1,2);
1415 for (sal_uInt16
i=nPointCount0+1;
i<nPointCount1-1;
i++) {
1422 rXPoly[nCurrentPoint]=rStat.
GetNow();
1426 pU->bBezHasCtrl0=
false;
1428 rXPoly[nCurrentPoint]=rXPoly[0];
1437 if (nPolyCount!=0) {
1442 if (nPointCount>=2) {
1444 if (rXP[nPointCount-1]==rXP[nPointCount-2]) {
1445 rXP.
Remove(nPointCount-1,1);
1448 if (rXP[nPointCount-3]==rXP[nPointCount-2]) {
1449 rXP.
Remove(nPointCount-3,3);
1454 for (sal_uInt16 nPolyNum=nPolyCount; nPolyNum>0;) {
1464 pU->ResetFormFlags();
1475 ImpPathCreateUser* pU=
static_cast<ImpPathCreateUser*
>(rStat.
GetUser());
1479 if (nCurrentPoint>0) {
1482 rXPoly.
Remove(nCurrentPoint,1);
1483 if (nCurrentPoint>=3 && rXPoly.
IsControl(nCurrentPoint-1)) {
1485 rXPoly.
Remove(nCurrentPoint-1,1);
1486 if (rXPoly.
IsControl(nCurrentPoint-2)) rXPoly.
Remove(nCurrentPoint-2,1);
1490 if (nCurrentPoint>=4) {
1492 if (rXPoly.
IsControl(nCurrentPoint-1)) {
1493 rXPoly.
Remove(nCurrentPoint-1,1);
1494 if (rXPoly.
IsControl(nCurrentPoint-2)) rXPoly.
Remove(nCurrentPoint-2,1);
1503 if (nLocalCurrentPoint>0) {
1504 nLocalCurrentPoint--;
1505 rLocalXPoly[nLocalCurrentPoint]=rStat.
GetNow();
1509 pU->ResetFormFlags();
1528 ImpPathCreateUser* pU =
static_cast<ImpPathCreateUser*
>(rDrag.
GetUser());
1531 if(pU->IsFormFlag() && aNewPolygon.
count() > 1)
1536 const sal_uInt32 nChangeIndex(aNewPolygon.
count() - 2);
1539 aNewPolygon.
remove(nChangeIndex, 2);
1540 aNewPolygon.
append(pU->GetFormPoly().getB2DPolygon());
1542 if(nChangeIndex < aNewPolygon.
count())
1556 aRetval.
append(aNewPolygon);
1570 const ImpPathCreateUser* pU =
static_cast<const ImpPathCreateUser*
>(rDrag.
GetUser());
1578 aRetval.
append(aHelpline);
1598 return PointerStyle::Cross;
1614 return std::make_unique<sdr::contact::ViewContactOfSdrPathObj>(*
this);
1629 meKind(rSource.meKind)
1640 maPathPolygon(
std::move(aPathPoly)),
1757 if(
IsClosed() != rPolygon.isClosed())
1762 if(rPolygon.isClosed())
1842 if(aB2DPoint0 != aB2DPoint1)
1844 if(aB2DPoint0.
getY() == aB2DPoint1.
getY())
1846 pId = STR_ObjNameSingulLINE_Hori;
1848 else if(aB2DPoint0.
getX() == aB2DPoint1.
getX())
1850 pId = STR_ObjNameSingulLINE_Vert;
1854 const double fDx(fabs(aB2DPoint0.
getX() - aB2DPoint1.
getX()));
1855 const double fDy(fabs(aB2DPoint0.
getY() - aB2DPoint1.
getY()));
1859 pId = STR_ObjNameSingulLINE_Diag;
1876 pId = STR_ObjNameSingulPOLY;
1880 pId = STR_ObjNameSingulPLIN;
1888 sal_uInt32 nPointCount(0);
1892 nPointCount += rPolygon.count();
1897 pId = STR_ObjNameSingulPOLY_PointCount;
1901 pId = STR_ObjNameSingulPLIN_PointCount;
1905 sName =
SvxResId(pId).replaceFirst(
"%2", OUString::number(nPointCount));
1921 if (!
aName.isEmpty())
1951 sal_uInt32 nRetval(0);
1955 nRetval += rPolygon.count();
1965 sal_uInt16 nPolyCnt=aOldPathPolygon.
Count();
1969 for (sal_uInt16
i=0;
i<nPolyCnt;
i++) {
1972 if (bClosed && nPntCnt>1) nPntCnt--;
1974 for (sal_uInt16 j=0; j<nPntCnt; j++) {
1975 if (rXPoly.
GetFlags(j)!=PolyFlags::Control) {
1976 const Point& rPnt=rXPoly[j];
1978 pHdl->SetPolyNum(
i);
1979 pHdl->SetPointNum(j);
1980 pHdl->Set1PixMore(j==0);
1981 pHdl->SetSourceHdlNum(nIdx);
1983 rHdlList.
AddHdl(std::move(pHdl));
1993 sal_uInt16 nPnt =
static_cast<sal_uInt16
>(rHdl.
GetPointNum());
1994 sal_uInt16 nPolyNum =
static_cast<sal_uInt16
>(rHdl.
GetPolyNum());
1996 if (nPolyNum>=aOldPathPolygon.
Count())
1999 const XPolygon& rXPoly = aOldPathPolygon[nPolyNum];
2009 sal_uInt16 nCnt = 0;
2010 if (rXPoly.
GetFlags(nPnt)!=PolyFlags::Control)
2014 if (nPnt>0 && rXPoly.
GetFlags(nPnt-1)==PolyFlags::Control)
2018 if (nPnt<nPntMax && rXPoly.
GetFlags(nPnt+1)==PolyFlags::Control)
2023 for (sal_uInt32 nPlusNum = 0; nPlusNum < nCnt; ++nPlusNum)
2025 nPnt =
static_cast<sal_uInt16
>(rHdl.
GetPointNum());
2031 if (nPnt>0 && rXPoly.
GetFlags(nPnt-1)==PolyFlags::Control && nPlusNum==0)
2033 pHdl->SetPos(rXPoly[nPnt-1]);
2034 pHdl->SetPointNum(nPnt-1);
2042 pHdl->SetPos(rXPoly[nPnt+1]);
2043 pHdl->SetPointNum(nPnt+1);
2048 pHdl->SetPlusHdl(
true);
2049 rHdlList.
AddHdl(std::move(pHdl));
2114 aRetval =
mpDAC->getSpecialDragComment(rDrag);
2163 if(bRetval &&
mpDAC)
2183 if(aCandidate.
count() > 2)
2189 if(aDistVector.
getLength() <=
static_cast<double>(nCloseDist))
2225 aRetval =
mpDAC->TakeObjectPolyPolygon(rDrag);
2239 aRetval =
mpDAC->TakeObjectPolyPolygon(rDrag);
2272 const double fResizeX(xFact);
2273 const double fResizeY(yFact);
2288 double(xFact),
double(yFact), rRef.
X(), rRef.
Y()) * aTrans;
2329 const double fDiffX(rRefPnt2.
X() - rRefPnt1.
X());
2330 const double fDiffY(rRefPnt2.
Y() - rRefPnt1.
Y());
2331 const double fRot(atan2(fDiffY, fDiffX));
2334 aTrans.
scale(1.0, -1.0);
2360 rRect.
Move(aTmp.
X(),aTmp.
Y());
2393 if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
2394 if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
2395 if ( nDivX == nMulX ) { nMulX = 1; nDivX = 1; }
2396 if ( nDivY == nMulY ) { nMulY = 1; nDivY = 1; }
2410 sal_uInt32 nPoly,nPnt;
2411 if(!PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nSnapPnt, nPoly, nPnt))
2413 SAL_WARN(
"svx",
"SdrPathObj::GetSnapPoint: Point nSnapPnt does not exist.");
2427 sal_uInt32 nRetval(0);
2431 nRetval += rPolygon.count();
2440 sal_uInt32 nPoly,nPnt;
2442 if(PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nHdlNum, nPoly, nPnt))
2454 sal_uInt32 nPoly,nPnt;
2456 if(!PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nHdlNum, nPoly, nPnt))
2491 sal_uInt32 nSmallestPolyIndex(0);
2492 sal_uInt32 nSmallestEdgeIndex(0);
2493 double fSmallestCut;
2521 sal_uInt32 nSmallestPolyIndex(0);
2522 sal_uInt32 nSmallestEdgeIndex(0);
2523 double fSmallestCut;
2526 const bool bBefore(!aCandidate.
isClosed() && 0 == nSmallestEdgeIndex && 0.0 == fSmallestCut);
2527 const bool bAfter(!aCandidate.
isClosed() && aCandidate.
count() == nSmallestEdgeIndex + 2 && 1.0 == fSmallestCut);
2532 aCandidate.
insert(0, aTestPoint);
2548 aCandidate.
append(aTestPoint);
2559 nNewHdl = aCandidate.
count() - 1;
2564 bool bSegmentSplit(
false);
2565 const sal_uInt32 nNextIndex((nSmallestEdgeIndex + 1) % aCandidate.
count());
2571 bSegmentSplit =
true;
2586 aBezier.
split(fSmallestCut, &aBezierA, &aBezierB);
2587 aCandidate.
insert(nSmallestEdgeIndex + 1, aTestPoint);
2599 aCandidate.
insert(nSmallestEdgeIndex + 1, aTestPoint);
2602 nNewHdl = nSmallestEdgeIndex + 1;
2608 for(sal_uInt32
a(0);
a < nSmallestPolyIndex;
a++)
2622 sal_uInt32 nPoly, nPnt;
2624 if(PolyPolygonEditor::GetRelativePolyPoint(aLocalPolyPolygon, nHdlNum, nPoly, nPnt))
2629 const sal_uInt32 nPointCount(aCandidate.
count());
2642 rNewPt0Index = (nPointCount - nPnt) % nPointCount;
2646 if(nPointCount >= 3 && nPnt != 0 && nPnt + 1 < nPointCount)
2669 const bool bHideContour(
2678 if(pPath->GetPathPoly().areControlPointsUsed())
2694 pRet = std::move(pPath);
2707 return std::make_unique<SdrPathObjGeoData>();
2783 double fRotate(0.0);
2784 double fShearX(0.0);
2802 aScale = aPolyRangeNoCurve.
getRange();
2824 aInvObjectMatrix.
invert();
2825 rPolyPolygon.
transform(aInvObjectMatrix);
2834 aTranslate = aObjectMatrix * aCorrectedRangeNoCurve.
getMinimum();
2835 aScale = aCorrectedRangeNoCurve.
getRange();
2848 aScale = aPolyRangeNoCurve.
getRange();
2857 rPolyPolygon.
transform(aMoveToZeroMatrix);
2892 double fRotate, fShearX;
2893 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2901 fRotate = fmod(fRotate + M_PI, 2 * M_PI);
2946 fScaleX *= fabs(aScale.
getX());
2947 fScaleY *= fabs(aScale.
getY());
2950 if (fScaleX != 1.0 || fScaleY != 1.0)
2951 aTransform.
scale(fScaleX, fScaleY);
2955 aTransform.
shearX(tan(-atan(fShearX)));
2965 aTransform.
rotate(fRotate);
double mfCosRotationAngle
double mfSinRotationAngle
Degree100 m_nRotationAngle
std::unique_ptr< ImpSdrPathDragData > mpSdrPathDragData
static basegfx::B2DPolyPolygon TakeDragPolyPolygon(const SdrDragStat &rDrag)
SdrPathObj & mrSdrPathObject
static bool IsFreeHand(SdrObjKind eKind)
static bool IsBezier(SdrObjKind eKind)
bool MovCreate(SdrDragStat &rStat)
ImpPathForDragAndCreate(SdrPathObj &rSdrPathObject)
bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
void BegCreate(SdrDragStat &rStat)
bool beginPathDrag(SdrDragStat const &rDrag) const
XPolyPolygon aPathPolygon
bool movePathDrag(SdrDragStat &rDrag) const
bool BckCreate(SdrDragStat const &rStat)
void BrkCreate(SdrDragStat &rStat)
static bool IsClosed(SdrObjKind eKind)
bool endPathDrag(SdrDragStat const &rDrag)
OUString getSpecialDragComment(const SdrDragStat &rDrag) const
PointerStyle GetCreatePointer() const
basegfx::B2DPolyPolygon TakeObjectPolyPolygon(const SdrDragStat &rDrag) const
basegfx::B2DPolyPolygon getModifiedPolyPolygon() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
virtual const tools::Rectangle & GetSnapRect() const override
tools::Rectangle maSnapRect
bool IsUseIncompatiblePathCreateInterface() const
void TakeCurrentObj(SdrObjKind &nIdent, SdrInventor &nInvent) const
sal_uInt16 GetAutoCloseDistPix() const
bool IsCreate1stPointAsCenter() const
SdrObject * GetCreateObj() const
sal_uInt16 GetFreeHandMinDistPix() const
void SetNow(Point const &pt)
const Point & GetPos0() const
void SetUser(std::unique_ptr< SdrDragStatUserData > pU)
void SetActionRect(const tools::Rectangle &rR)
sal_Int32 GetPointCount() const
SdrDragStatUserData * GetUser() const
const Point & GetStart() const
SdrView * GetView() const
const SdrHdl * GetHdl() const
const Point & GetNow() const
void SetNoSnap(bool bOn=true)
void SetOrtho8Possible(bool bOn=true)
const Point & GetPrev() const
size_t GetHdlCount() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdl * GetHdl(size_t nNum) const
sal_uInt32 GetSourceHdlNum() const
sal_uInt32 GetPolyNum() const
SdrObject * GetObj() const
sal_uInt32 GetPointNum() const
const SdrHdlList & GetHdlList() const
bool IsCreateMode() const
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
static OUString GetAngleString(Degree100 nAngle)
All geometrical data of an arbitrary object for use in undo/redo.
const Point & GetAnchorPos() const
bool LineGeometryUsageIsNecessary() const
void BroadcastObjectChange() const
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
static rtl::Reference< T > Clone(T const &rObj, SdrModel &rTargetModel)
SdrModel & getSdrModelFromSdrObject() const
SdrObjUserCall * m_pUserCall
virtual const OUString & GetName() const
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
virtual void SetChanged()
virtual const tools::Rectangle & GetLastBoundRect() const
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
const SfxItemSet & GetObjectItemSet() const
OutputDevice * GetFirstOutputDevice() const
virtual ~SdrPathObjGeoData() override
basegfx::B2DPolyPolygon maPathPolygon
PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
basegfx::B2DPolyPolygon maPathPolygon
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
virtual bool MovCreate(SdrDragStat &rStat) override
virtual ~SdrPathObj() override
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
void NbcSetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
virtual void NbcRotate(const Point &rRefPnt, Degree100 nAngle, double fSin, double fCos) override
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
rtl::Reference< SdrPathObj > RipPoint(sal_uInt32 nHdlNum, sal_uInt32 &rNewPt0Index)
virtual void NbcResize(const Point &rRefPnt, const Fraction &aXFact, const Fraction &aYFact) override
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const override
void SetHandleScale(bool bHandleScale)
Scaling is ignored from the transform matrix by default, to not break compatibility.
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const override
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
virtual void BrkCreate(SdrDragStat &rStat) override
virtual Point GetPoint(sal_uInt32 nHdlNum) const override
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
sal_uInt32 NbcInsPoint(const Point &rPos, bool bNewObj)
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
basegfx::B2DPolyPolygon getObjectPolyPolygon(const SdrDragStat &rDrag) const
sal_uInt32 NbcInsPointOld(const Point &rPos, bool bNewObj)
basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat &rDrag) const
virtual OUString TakeObjNamePlural() const override
virtual sal_uInt32 GetPointCount() const override
std::unique_ptr< ImpPathForDragAndCreate > mpDAC
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
virtual OUString TakeObjNameSingul() const override
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
virtual void NbcShear(const Point &rRefPnt, Degree100 nAngle, double fTan, bool bVShear) override
virtual SdrObjKind GetObjIdentifier() const override
virtual bool BckCreate(SdrDragStat &rStat) override
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const override
virtual bool IsPolyObj() const override
const basegfx::B2DPolyPolygon & GetPathPoly() const
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 nHdlNum) override
virtual void NbcMirror(const Point &rRefPnt1, const Point &rRefPnt2) override
ImpPathForDragAndCreate & impGetDAC() const
void ImpSetClosed(bool bClose)
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
virtual const tools::Rectangle & GetLogicRect() const override
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const override
virtual Point GetSnapPoint(sal_uInt32 i) const override
virtual void NbcMove(const Size &aSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
virtual sal_uInt32 GetSnapPointCount() const override
snap to special points of an Object (polygon points, center of circle)
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
SdrPathObj(SdrModel &rSdrModel, SdrObjKind eNewKind)
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Degree100 GetEliminatePolyPointLimitAngle() const
bool IsAngleSnapEnabled() const
Degree100 GetSnapAngle() const
bool IsEliminatePolyPoints() const
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
rtl::Reference< SdrPathObj > ImpConvertMakeObj(const basegfx::B2DPolyPolygon &rPolyPolygon, bool bClosed, bool bBezier) const
bool ImpCanConvTextToCurve() const
virtual bool IsFontwork() const
virtual bool HasText() const override
virtual SdrText * getText(sal_Int32 nIndex) const override
returns the nth available text.
rtl::Reference< SdrObject > ImpConvertAddText(rtl::Reference< SdrObject > pObj, bool bBezier) const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
void setRectangle(tools::Rectangle const &rRectangle)
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
constexpr tools::Long Height() const
constexpr tools::Long Width() const
tools::Rectangle GetBoundRect() const
void Remove(sal_uInt16 nPos)
basegfx::B2DPolyPolygon getB2DPolyPolygon() const
void Insert(XPolygon &&rXPoly)
const XPolygon & GetObject(sal_uInt16 nPos) const
void Remove(sal_uInt16 nPos, sal_uInt16 nCount)
bool IsControl(sal_uInt16 nPos) const
short path to read the CONTROL flag directly (TODO: better explain what the sense behind this flag is...
sal_uInt16 GetPointCount() const
void Insert(sal_uInt16 nPos, const Point &rPt, PolyFlags eFlags)
void SetFlags(sal_uInt16 nPos, PolyFlags eFlags)
set the flags for the point at the given position
void PointsToBezier(sal_uInt16 nFirst)
convert four polygon points into a Bézier curve
void CalcTangent(sal_uInt16 nCenter, sal_uInt16 nPrev, sal_uInt16 nNext)
Calculate tangent between two Bézier curves.
PolyFlags GetFlags(sal_uInt16 nPos) const
get the flags for the point at the given position
const B2DPoint & getControlPointB() const
void split(double t, B2DCubicBezier *pBezierA, B2DCubicBezier *pBezierB) const
const B2DPoint & getEndPoint() const
const B2DPoint & getControlPointA() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void rotate(double fRadiant)
void translate(double fX, double fY)
void scale(double fX, double fY)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon &rPolygon)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void remove(sal_uInt32 nIndex, sal_uInt32 nCount=1)
bool isPrevControlPointUsed(sal_uInt32 nIndex) const
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
bool isNextControlPointUsed(sal_uInt32 nIndex) const
void insert(sal_uInt32 nIndex, const basegfx::B2DPoint &rPoint, sal_uInt32 nCount=1)
void setPrevControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void setNextControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint getPrevControlPoint(sal_uInt32 nIndex) const
bool areControlPointsUsed() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void remove(sal_uInt32 nIndex, sal_uInt32 nCount=1)
basegfx::B2DPoint getNextControlPoint(sal_uInt32 nIndex) const
B2DVector getRange() const
B2DPoint getMinimum() const
bool isHideContour() const
const SdrFormTextAttribute & getSdrFormTextAttribute() const
OUString SvxResId(TranslateId aId)
tools::Long FRound(double fVal)
#define SAL_WARN(area, stream)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DPolygon expandToCurve(const B2DPolygon &rCandidate)
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon &rCandidate, double fAngleBound)
void closeWithGeometryChange(B2DPolygon &rCandidate)
void openWithGeometryChange(B2DPolygon &rCandidate)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2DPolygon makeStartPoint(const B2DPolygon &rCandidate, sal_uInt32 nIndexOfNewStatPoint)
B2DRange getRange(const B2DPolygon &rCandidate)
double getSmallestDistancePointToPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPoint &rTestPoint, sal_uInt32 &rPolygonIndex, sal_uInt32 &rEdgeIndex, double &rCut)
attribute::SdrTextAttribute createNewSdrTextAttribute(const SfxItemSet &rSet, const SdrText &rText, const sal_Int32 *pLeft, const sal_Int32 *pUpper, const sal_Int32 *pRight, const sal_Int32 *pLower)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
HSLColor interpolate(const HSLColor &rFrom, const HSLColor &rTo, double t, bool bCCW)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwNodeOffset abs(const SwNodeOffset &a)
@ PathFill
open Bezier-curve
@ FreehandLine
closed Bezier-curve
@ CircleOrEllipse
rectangle (round corners optional)
@ PathPolyLine
Polygon/PolyPolygon represented by SdrPathObj.
@ CircleSection
circle, ellipse
@ CircleArc
circle section
@ PolyLine
polygon, PolyPolygon
@ FreehandFill
open free-hand line
static sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed)
static sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed)
static bool lcl_ImpIsLine(const basegfx::B2DPolyPolygon &rPolyPolygon)
static tools::Rectangle lcl_ImpGetBoundRect(const basegfx::B2DPolyPolygon &rPolyPolygon)
void RotateXPoly(XPolygon &rPoly, const Point &rRef, double sn, double cs)
Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle,...
tools::Long GetLen(const Point &rPnt)
Determine sector within the cartesian coordinate system.
tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv)
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)