32 #include <svx/strings.hrc>
49 #include <osl/diagnose.h>
53 static sal_uInt16
GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax,
bool bClosed)
64 static sal_uInt16
GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax,
bool bClosed)
67 if (nPnt>nPntMax || (bClosed && nPnt>=nPntMax)) nPnt=0;
80 sal_uInt16 nPointCount;
87 sal_uInt16 nPrevPrevPnt;
88 sal_uInt16 nNextNextPnt;
93 sal_uInt16 nPrevPrevPnt0;
97 sal_uInt16 nNextNextPnt0;
100 bool mbMultiPointDrag;
103 std::vector<SdrHdl*> maHandles;
108 bool IsMultiPointDrag()
const {
return mbMultiPointDrag; }
124 , bPrevIsBegPnt(
false)
125 , bNextIsEndPnt(
false)
129 , bIsNextControl(
false)
130 , bPrevIsControl(
false)
131 , bNextIsControl(
false)
138 , mbMultiPointDrag(bMuPoDr)
139 , maOrig(rPO.GetPathPoly())
149 for(
size_t a = 0;
a < nHdlCount; ++
a)
153 if(pTestHdl && pTestHdl->
IsSelected() && pTestHdl->
GetObj() == pInteractionObject)
155 maHandles.push_back(pTestHdl);
164 sal_uInt16 nPntMax = 0;
167 nPoly=
static_cast<sal_uInt16
>(rHdl.
GetPolyNum());
171 if (nPointCount==0 || (bClosed && nPointCount==1))
return;
172 nPntMax=nPointCount-1;
173 bBegPnt=!bClosed && nPnt==0;
174 bEndPnt=!bClosed && nPnt==nPntMax;
175 if (bClosed && nPointCount<=3) {
176 bBegPnt=(nPointCount<3) || nPnt==0;
177 bEndPnt=(nPointCount<3) || nPnt==nPntMax-1;
181 if (!bBegPnt) nPrevPnt=
GetPrevPnt(nPnt,nPntMax,bClosed);
182 if (!bEndPnt) nNextPnt=
GetNextPnt(nPnt,nPntMax,bClosed);
183 bPrevIsBegPnt=bBegPnt || (!bClosed && nPrevPnt==0);
184 bNextIsEndPnt=bEndPnt || (!bClosed && nNextPnt==nPntMax);
187 if (!bPrevIsBegPnt) nPrevPrevPnt=
GetPrevPnt(nPrevPnt,nPntMax,bClosed);
188 if (!bNextIsEndPnt) nNextNextPnt=
GetNextPnt(nNextPnt,nPntMax,bClosed);
190 bIsNextControl=
false;
191 bPrevIsControl=
false;
192 bNextIsControl=
false;
194 bIsNextControl=!aTmpXP.IsControl(nPrevPnt);
196 bPrevIsControl=!bBegPnt && !bPrevIsBegPnt && aTmpXP.GetFlags(nPrevPnt)==PolyFlags::Control;
197 bNextIsControl=!bEndPnt && !bNextIsEndPnt && aTmpXP.GetFlags(nNextPnt)==PolyFlags::Control;
199 nPrevPrevPnt0=nPrevPrevPnt;
203 nNextNextPnt0=nNextNextPnt;
215 void ImpSdrPathDragData::ResetPoly(
const SdrPathObj& rPO)
218 aXP[0]=aTmpXP[nPrevPrevPnt0]; aXP.
SetFlags(0,aTmpXP.GetFlags(nPrevPrevPnt0));
219 aXP[1]=aTmpXP[nPrevPnt0]; aXP.SetFlags(1,aTmpXP.GetFlags(nPrevPnt0));
220 aXP[2]=aTmpXP[nPnt0]; aXP.SetFlags(2,aTmpXP.GetFlags(nPnt0));
221 aXP[3]=aTmpXP[nNextPnt0]; aXP.SetFlags(3,aTmpXP.GetFlags(nNextPnt0));
222 aXP[4]=aTmpXP[nNextNextPnt0]; aXP.SetFlags(4,aTmpXP.GetFlags(nNextNextPnt0));
253 sal_uInt16 nBezierStartPoint;
258 ImpPathCreateUser(): nCircRadius(0),nCircStAngle(0),nCircRelAngle(0),
262 void ResetFormFlags() { bBezier=
false; bCircle=
false; bLine=
false; bRect=
false; }
263 bool IsFormFlag()
const {
return bBezier || bCircle || bLine || bRect; }
265 void CalcBezier(
const Point& rP1,
const Point& rP2,
const Point& rDir,
bool bMouseDown);
267 void CalcCircle(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView);
269 void CalcLine(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView);
272 void CalcRect(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView);
278 XPolygon ImpPathCreateUser::GetFormPoly()
const
280 if (bBezier)
return GetBezierPoly();
281 if (bCircle)
return GetCirclePoly();
282 if (bLine)
return GetLinePoly();
283 if (bRect)
return GetRectPoly();
287 void ImpPathCreateUser::CalcBezier(
const Point& rP1,
const Point& rP2,
const Point& rDir,
bool bMouseDown)
295 if (!bMouseDown || (0 == aBezEnd.X() && 0 == aBezEnd.Y())) aBezEnd=rP2;
300 XPolygon ImpPathCreateUser::GetBezierPoly()
const
303 aXP[0]=aBezStart; aXP.SetFlags(0,PolyFlags::Smooth);
304 aXP[1]=aBezCtrl1; aXP.SetFlags(1,PolyFlags::Control);
305 aXP[2]=aBezCtrl2; aXP.SetFlags(2,PolyFlags::Control);
310 void ImpPathCreateUser::CalcCircle(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView)
321 bool bRet=nTmpAngle!=9000_deg100 && nTmpAngle!=27000_deg100;
325 double nR=
static_cast<double>(
GetLen(
Point(dx,dy)))/cs/2;
326 nRad=std::abs(
FRound(nR));
328 if (dAngle<18000_deg100) {
331 aCircCenter.AdjustX(
FRound(nRad * cos(
toRadians(nTangAngle + 9000_deg100))));
332 aCircCenter.AdjustY(-(
FRound(nRad * sin(
toRadians(nTangAngle + 9000_deg100)))));
336 aCircCenter.AdjustX(
FRound(nRad * cos(
toRadians(nTangAngle - 9000_deg100))));
337 aCircCenter.AdjustY(-(
FRound(nRad * sin(
toRadians(nTangAngle - 9000_deg100)))));
343 bool bNeg=nCircRelAngle<0_deg100;
344 if (bNeg) nCircRelAngle=-nCircRelAngle;
345 nCircRelAngle+=nSA/2_deg100;
349 if (bNeg) nCircRelAngle=-nCircRelAngle;
353 if (nRad==0 ||
abs(nCircRelAngle).
get()<5) bRet=
false;
357 XPolygon ImpPathCreateUser::GetCirclePoly()
const
359 if (nCircRelAngle>=0_deg100) {
360 XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
361 nCircStAngle, nCircStAngle+nCircRelAngle,
false);
362 aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::Smooth);
363 if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
366 XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
368 sal_uInt16
nCount=aXP.GetPointCount();
369 for (sal_uInt16 nNum=nCount/2; nNum>0;) {
371 sal_uInt16
n2=nCount-nNum-1;
372 Point aPt(aXP[nNum]);
376 aXP[0]=aCircStart; aXP.SetFlags(0,PolyFlags::Smooth);
377 if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
397 if ((l1<=l2) != (pView!=
nullptr && pView->
IsBigOrtho())) {
406 void ImpPathCreateUser::CalcLine(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView)
411 if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bLine=
false;
return; }
412 Point aTmpPt(rP2-rP1);
415 Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt;
tools::Long nQ1=std::abs(aP1.X())+std::abs(aP1.Y());
416 Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt;
tools::Long nQ2=std::abs(aP2.X())+std::abs(aP2.Y());
417 if (pView!=
nullptr && pView->
IsOrtho()) nQ1=0;
427 XPolygon ImpPathCreateUser::GetLinePoly()
const
430 aXP[0]=aLineStart;
if (!bLine90) aXP.SetFlags(0,PolyFlags::Smooth);
435 void ImpPathCreateUser::CalcRect(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView)
440 if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bRect=
false;
return; }
441 Point aTmpPt(rP2-rP1);
458 double nGKathLen=nHypLen*sn;
464 if (pView!=
nullptr && pView->
IsOrtho()) {
469 bool b1MoreThan2=dx1a+dy1a>dx2a+dy2a;
471 tools::Long xtemp=dy2a-dx1a;
if (dx1<0) xtemp=-xtemp;
472 tools::Long ytemp=dx2a-dy1a;
if (dy1<0) ytemp=-ytemp;
473 aRectP2.AdjustX(xtemp );
474 aRectP2.AdjustY(ytemp );
475 aRectP3.AdjustX(xtemp );
476 aRectP3.AdjustY(ytemp );
478 tools::Long xtemp=dy1a-dx2a;
if (dx2<0) xtemp=-xtemp;
479 tools::Long ytemp=dx1a-dy2a;
if (dy2<0) ytemp=-ytemp;
480 aRectP3.AdjustX(xtemp );
481 aRectP3.AdjustY(ytemp );
487 XPolygon ImpPathCreateUser::GetRectPoly()
const
490 aXP[0]=aRectP1; aXP.SetFlags(0,PolyFlags::Smooth);
492 if (aRectP3!=aRectP2) aXP[2]=aRectP3;
501 std::unique_ptr<ImpSdrPathDragData>
536 : mrSdrPathObject(rSdrPathObject),
537 aPathPolygon(rSdrPathObject.GetPathPoly()),
538 meObjectKind(mrSdrPathObject.meKind),
549 bool bMultiPointDrag(
true);
552 bMultiPointDrag =
false;
560 sal_uInt32 nSelectedPoints(0);
562 for(
size_t a = 0;
a < nHdlCount; ++
a)
566 if(pTestHdl && pTestHdl->
IsSelected() && pTestHdl->
GetObj() == pInteractionObject)
572 if(nSelectedPoints <= 1)
573 bMultiPointDrag =
false;
580 OSL_FAIL(
"ImpPathForDragAndCreate::BegDrag(): ImpSdrPathDragData is invalid.");
592 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
600 if(aDelta.X() || aDelta.Y())
604 const sal_uInt16 nPolyIndex(static_cast<sal_uInt16>(pHandle->
GetPolyNum()));
605 const sal_uInt16 nPointIndex(static_cast<sal_uInt16>(pHandle->
GetPointNum()));
609 bool bClosed(rOrig[0] == rOrig[nPointCount-1]);
612 rMove[nPointIndex] = rOrig[nPointIndex] + aDelta;
615 if(nPointCount > 0 && !nPointIndex && bClosed)
617 rMove[nPointCount - 1] = rOrig[nPointCount - 1] + aDelta;
621 if(nPointCount > 1 && rOrig.
IsControl(nPointCount - 2))
622 rMove[nPointCount - 2] = rOrig[nPointCount - 2] + aDelta;
626 if(nPointIndex > 0 && rOrig.
IsControl(nPointIndex - 1))
629 rMove[nPointIndex - 1] = rOrig[nPointIndex - 1] + aDelta;
633 if(nPointIndex + 1 < nPointCount && rOrig.
IsControl(nPointIndex + 1))
636 rMove[nPointIndex + 1] = rOrig[nPointIndex + 1] + aDelta;
666 sal_uInt16 nPnt1=0xFFFF,nPnt2=0xFFFF;
667 Point aNewPos1,aNewPos2;
668 bool bPnt1 =
false, bPnt2 =
false;
670 if (!bBegPnt) nPnt1=nPrevPnt;
671 if (!bEndPnt) nPnt2=nNextPnt;
677 if (nPnt1!=0xFFFF && !bPrevIsControl) {
683 if (!bHLin || !bVLin) {
687 double nXFact=0;
if (!bVLin) nXFact=
static_cast<double>(ndx)/static_cast<double>(ndx0);
688 double nYFact=0;
if (!bHLin) nYFact=
static_cast<double>(ndy)/static_cast<double>(ndy0);
689 bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
690 bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
694 aNewPos1.AdjustX(ndx );
695 aNewPos1.AdjustY(ndy );
698 if (nPnt2!=0xFFFF && !bNextIsControl) {
704 if (!bHLin || !bVLin) {
708 double nXFact=0;
if (!bVLin) nXFact=
static_cast<double>(ndx)/static_cast<double>(ndx0);
709 double nYFact=0;
if (!bHLin) nYFact=
static_cast<double>(ndy)/static_cast<double>(ndy0);
710 bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
711 bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
715 aNewPos2.AdjustX(ndx );
716 aNewPos2.AdjustY(ndy );
719 if (bPnt1 && bPnt2) {
720 BigInt nX1(aNewPos1.X()-aPos.X()); nX1*=nX1;
721 BigInt nY1(aNewPos1.Y()-aPos.Y()); nY1*=nY1;
722 BigInt nX2(aNewPos2.X()-aPos.X()); nX2*=nX2;
723 BigInt nY2(aNewPos2.Y()-aPos.Y()); nY2*=nY2;
727 if (nX1<nX2) bPnt2=
false;
else bPnt1=
false;
729 if (bPnt1) rDrag.
SetNow(aNewPos1);
730 if (bPnt2) rDrag.
SetNow(aNewPos2);
736 !bBegPnt && !bEndPnt && !bPrevIsControl && !bNextIsControl)
777 if (bIsNextControl) {
795 if (bPrevIsControl && !bNextIsControl && !bEndPnt) {
798 if (bNextIsControl && !bPrevIsControl && !bBegPnt) {
805 if (!bBegPnt && !bPrevIsControl && !bPrevIsBegPnt &&
mpSdrPathDragData->aXP.IsSmooth(nPrevPnt)) {
810 if (!bEndPnt && !bNextIsControl && !bNextIsEndPnt &&
mpSdrPathDragData->aXP.IsSmooth(nNextPnt)) {
826 if (bLineGlueMirror) {
834 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
862 sal_uInt32 nPoly,nPnt;
864 if(PolyPolygonEditor::GetRelativePolyPoint(aTempPolyPolygon, rDrag.
GetHdl()->
GetSourceHdlNum(), nPoly, nPnt))
869 if(aCandidate.count() < 2)
871 aTempPolyPolygon.remove(nPoly);
875 aTempPolyPolygon.setB2DPolygon(nPoly, aCandidate);
887 bool bXMirr=(aLinePt1_.X()>aLinePt2_.X())!=(aLinePt1.X()>aLinePt2.X());
888 bool bYMirr=(aLinePt1_.Y()>aLinePt2_.Y())!=(aLinePt1.Y()>aLinePt2.Y());
889 if (bXMirr || bYMirr) {
916 if(bCreateComment && rDrag.
GetUser())
919 const ImpPathCreateUser* pU =
static_cast<const ImpPathCreateUser*
>(rDrag.
GetUser());
948 sal_Int32 nLen(
GetLen(aNow));
973 pDragData =
static_cast<ImpSdrPathDragData*
>(rDrag.
GetUser());
978 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
982 if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
988 OUString aStr2(
SvxResId(STR_EditDelete));
991 aStr2 = aStr2.replaceFirst(
"%1", aStr);
1008 if(!pDragData->IsMultiPointDrag())
1010 sal_uInt16 nPntNum(static_cast<sal_uInt16>(pHdl->
GetPointNum()));
1021 sal_uInt16
nRef(nPntNum);
1028 aNow -= rXPoly[nRef];
1030 sal_Int32 nLen(
GetLen(aNow));
1037 else if(nPointCount > 1)
1039 sal_uInt16 nPntMax(nPointCount - 1);
1041 bool bPt1(nPntNum > 0);
1042 bool bPt2(nPntNum < nPntMax);
1044 if(bIsClosed && nPointCount > 2)
1050 sal_uInt16 nPt1,nPt2;
1057 if(nPntNum < nPntMax)
1071 aPt -= rXPoly[nPt1];
1073 sal_Int32 nLen(
GetLen(aPt));
1089 aPt -= rXPoly[nPt2];
1091 sal_Int32 nLen(
GetLen(aPt));
1109 OSL_FAIL(
"ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
1125 aRetval.
Insert(std::move(aXPoly));
1151 if (bIsNextControl) {
1187 else if (!bBegPnt && !bPrevIsBegPnt &&
mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
1192 if (bBegPnt) aXPoly.
Remove(0,1);
1195 else if (!bEndPnt && !bNextIsEndPnt &&
mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
1211 aRetval.
Insert(std::move(aXPoly));
1228 bool bMakeStartPoint =
true;
1232 bMakeStartPoint =
false;
1236 if (bMakeStartPoint) {
1239 std::unique_ptr<ImpPathCreateUser> pU(
new ImpPathCreateUser);
1247 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;
1312 if (nMinDist<1) nMinDist=1;
1314 Point aPt0(rXPoly[nCurrentPoint-1]);
1316 tools::Long dx=aPt0.X()-aPt1.X();
if (dx<0) dx=-dx;
1317 tools::Long dy=aPt0.Y()-aPt1.Y();
if (dy<0) dy=-dy;
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();
1525 if(pView && pView->IsUseIncompatiblePathCreateInterface())
1528 ImpPathCreateUser* pU =
static_cast<ImpPathCreateUser*
>(rDrag.
GetUser());
1531 if(pU->IsFormFlag() && aNewPolygon.count() > 1)
1536 const sal_uInt32 nChangeIndex(aNewPolygon.count() - 2);
1537 const basegfx::B2DPoint aSavedPrevCtrlPoint(aNewPolygon.getPrevControlPoint(nChangeIndex));
1539 aNewPolygon.remove(nChangeIndex, 2);
1540 aNewPolygon.append(pU->GetFormPoly().getB2DPolygon());
1542 if(nChangeIndex < aNewPolygon.count())
1546 aNewPolygon.setPrevControlPoint(nChangeIndex, aSavedPrevCtrlPoint);
1552 aRetval.setB2DPolygon(aRetval.count() - 1, aNewPolygon);
1556 aRetval.append(aNewPolygon);
1570 const ImpPathCreateUser* pU =
static_cast<const ImpPathCreateUser*
>(rDrag.
GetUser());
1578 aRetval.
append(aHelpline);
1600 return PointerStyle::Cross;
1616 return std::make_unique<sdr::contact::ViewContactOfSdrPathObj>(*this);
1631 meKind(rSource.meKind)
1642 maPathPolygon(rPathPoly),
1759 if(
IsClosed() != rPolygon.isClosed())
1764 if(rPolygon.isClosed())
1846 if(aB2DPoint0 != aB2DPoint1)
1848 if(aB2DPoint0.getY() == aB2DPoint1.getY())
1850 pId = STR_ObjNameSingulLINE_Hori;
1852 else if(aB2DPoint0.getX() == aB2DPoint1.getX())
1854 pId = STR_ObjNameSingulLINE_Vert;
1858 const double fDx(fabs(aB2DPoint0.getX() - aB2DPoint1.getX()));
1859 const double fDy(fabs(aB2DPoint0.getY() - aB2DPoint1.getY()));
1863 pId = STR_ObjNameSingulLINE_Diag;
1880 pId = STR_ObjNameSingulPOLY;
1884 pId = STR_ObjNameSingulPLIN;
1892 sal_uInt32 nPointCount(0);
1896 nPointCount += rPolygon.count();
1901 pId = STR_ObjNameSingulPOLY_PointCount;
1905 pId = STR_ObjNameSingulPLIN_PointCount;
1909 sName =
SvxResId(pId).replaceFirst(
"%2", OUString::number(nPointCount));
1927 if (!aName.isEmpty())
1928 sName +=
" '" + aName +
"'";
1959 sal_uInt32 nRetval(0);
1963 nRetval += rPolygon.count();
1973 sal_uInt16 nPolyCnt=aOldPathPolygon.
Count();
1977 for (sal_uInt16
i=0;
i<nPolyCnt;
i++) {
1980 if (bClosed && nPntCnt>1) nPntCnt--;
1982 for (sal_uInt16 j=0; j<nPntCnt; j++) {
1983 if (rXPoly.
GetFlags(j)!=PolyFlags::Control) {
1984 const Point& rPnt=rXPoly[j];
1986 pHdl->SetPolyNum(
i);
1987 pHdl->SetPointNum(j);
1988 pHdl->Set1PixMore(j==0);
1989 pHdl->SetSourceHdlNum(nIdx);
1991 rHdlList.
AddHdl(std::move(pHdl));
2001 sal_uInt16 nPnt =
static_cast<sal_uInt16
>(rHdl.
GetPointNum());
2002 sal_uInt16 nPolyNum =
static_cast<sal_uInt16
>(rHdl.
GetPolyNum());
2004 if (nPolyNum>=aOldPathPolygon.
Count())
2007 const XPolygon& rXPoly = aOldPathPolygon[nPolyNum];
2017 sal_uInt16 nCnt = 0;
2018 if (rXPoly.
GetFlags(nPnt)!=PolyFlags::Control)
2022 if (nPnt>0 && rXPoly.
GetFlags(nPnt-1)==PolyFlags::Control)
2026 if (nPnt<nPntMax && rXPoly.
GetFlags(nPnt+1)==PolyFlags::Control)
2031 for (sal_uInt32 nPlusNum = 0; nPlusNum < nCnt; ++nPlusNum)
2033 nPnt =
static_cast<sal_uInt16
>(rHdl.
GetPointNum());
2039 if (nPnt>0 && rXPoly.
GetFlags(nPnt-1)==PolyFlags::Control && nPlusNum==0)
2041 pHdl->SetPos(rXPoly[nPnt-1]);
2042 pHdl->SetPointNum(nPnt-1);
2050 pHdl->SetPos(rXPoly[nPnt+1]);
2051 pHdl->SetPointNum(nPnt+1);
2056 pHdl->SetPlusHdl(
true);
2057 rHdlList.
AddHdl(std::move(pHdl));
2122 aRetval =
mpDAC->getSpecialDragComment(rDrag);
2171 if(bRetval &&
mpDAC)
2191 if(aCandidate.
count() > 2)
2197 if(aDistVector.getLength() <=
static_cast<double>(nCloseDist))
2233 aRetval =
mpDAC->TakeObjectPolyPolygon(rDrag);
2247 aRetval =
mpDAC->TakeObjectPolyPolygon(rDrag);
2280 const double fResizeX(xFact);
2281 const double fResizeY(yFact);
2296 double(xFact),
double(yFact), rRef.X(), rRef.Y()) * aTrans;
2328 aTrans.
translate(rRefPnt.X(), rRefPnt.Y());
2337 const double fDiffX(rRefPnt2.X() - rRefPnt1.X());
2338 const double fDiffY(rRefPnt2.Y() - rRefPnt1.Y());
2339 const double fRot(atan2(fDiffY, fDiffX));
2342 aTrans.
scale(1.0, -1.0);
2344 aTrans.
translate(rRefPnt1.X(), rRefPnt1.Y());
2368 rRect.
Move(aTmp.X(),aTmp.Y());
2401 if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
2402 if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
2403 if ( nDivX == nMulX ) { nMulX = 1; nDivX = 1; }
2404 if ( nDivY == nMulY ) { nMulY = 1; nDivY = 1; }
2418 sal_uInt32 nPoly,nPnt;
2419 if(!PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nSnapPnt, nPoly, nPnt))
2421 SAL_WARN(
"svx",
"SdrPathObj::GetSnapPoint: Point nSnapPnt does not exist.");
2435 sal_uInt32 nRetval(0);
2439 nRetval += rPolygon.count();
2448 sal_uInt32 nPoly,nPnt;
2450 if(PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nHdlNum, nPoly, nPnt))
2462 sal_uInt32 nPoly,nPnt;
2464 if(!PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nHdlNum, nPoly, nPnt))
2499 sal_uInt32 nSmallestPolyIndex(0);
2500 sal_uInt32 nSmallestEdgeIndex(0);
2501 double fSmallestCut;
2529 sal_uInt32 nSmallestPolyIndex(0);
2530 sal_uInt32 nSmallestEdgeIndex(0);
2531 double fSmallestCut;
2534 const bool bBefore(!aCandidate.
isClosed() && 0 == nSmallestEdgeIndex && 0.0 == fSmallestCut);
2535 const bool bAfter(!aCandidate.
isClosed() && aCandidate.
count() == nSmallestEdgeIndex + 2 && 1.0 == fSmallestCut);
2540 aCandidate.
insert(0, aTestPoint);
2556 aCandidate.
append(aTestPoint);
2567 nNewHdl = aCandidate.
count() - 1;
2572 bool bSegmentSplit(
false);
2573 const sal_uInt32 nNextIndex((nSmallestEdgeIndex + 1) % aCandidate.
count());
2579 bSegmentSplit =
true;
2594 aBezier.
split(fSmallestCut, &aBezierA, &aBezierB);
2595 aCandidate.
insert(nSmallestEdgeIndex + 1, aTestPoint);
2607 aCandidate.
insert(nSmallestEdgeIndex + 1, aTestPoint);
2610 nNewHdl = nSmallestEdgeIndex + 1;
2616 for(sal_uInt32
a(0);
a < nSmallestPolyIndex;
a++)
2630 sal_uInt32 nPoly, nPnt;
2632 if(PolyPolygonEditor::GetRelativePolyPoint(aLocalPolyPolygon, nHdlNum, nPoly, nPnt))
2637 const sal_uInt32 nPointCount(aCandidate.count());
2650 rNewPt0Index = (nPointCount - nPnt) % nPointCount;
2654 if(nPointCount >= 3 && nPnt != 0 && nPnt + 1 < nPointCount)
2677 const bool bHideContour(
2686 if(pPath->GetPathPoly().areControlPointsUsed())
2702 pRet = std::move(pPath);
2715 return std::make_unique<SdrPathObjGeoData>();
2791 double fRotate(0.0);
2792 double fShearX(0.0);
2810 aScale = aPolyRangeNoCurve.
getRange();
2832 aInvObjectMatrix.
invert();
2833 rPolyPolygon.
transform(aInvObjectMatrix);
2842 aTranslate = aObjectMatrix * aCorrectedRangeNoCurve.
getMinimum();
2843 aScale = aCorrectedRangeNoCurve.
getRange();
2856 aScale = aPolyRangeNoCurve.
getRange();
2865 rPolyPolygon.
transform(aMoveToZeroMatrix);
2900 double fRotate, fShearX;
2901 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2909 fRotate = fmod(fRotate + M_PI, 2 * M_PI);
2954 fScaleX *= fabs(aScale.
getX());
2955 fScaleY *= fabs(aScale.
getY());
2958 if (fScaleX != 1.0 || fScaleY != 1.0)
2959 aTransform.
scale(fScaleX, fScaleY);
2963 aTransform.
shearX(tan(-atan(fShearX)));
2973 aTransform.
rotate(fRotate);
static tools::Rectangle lcl_ImpGetBoundRect(const basegfx::B2DPolyPolygon &rPolyPolygon)
void Insert(XPolygon &&rXPoly)
virtual void NbcShear(const Point &rRefPnt, Degree100 nAngle, double fTan, bool bVShear) override
virtual ~SdrPathObj() override
bool IsEliminatePolyPoints() const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual SdrPathObj * CloneSdrObject(SdrModel &rTargetModel) const override
sal_uInt32 NbcInsPointOld(const Point &rPos, bool bNewObj)
virtual OUString TakeObjNamePlural() const override
void remove(sal_uInt32 nIndex, sal_uInt32 nCount=1)
sal_uInt32 GetPolyNum() const
std::unique_ptr< ImpSdrPathDragData > mpSdrPathDragData
void BrkCreate(SdrDragStat &rStat)
basegfx::B2DPoint getNextControlPoint(sal_uInt32 nIndex) const
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
basegfx::B2DPolyPolygon maPathPolygon
PolyFlags GetFlags(sal_uInt16 nPos) const
get the flags for the point at the given position
const Point & GetStart() const
virtual SdrText * getText(sal_Int32 nIndex) const override
returns the nth available text.
static OUString GetAngleString(Degree100 nAngle)
Degree100 GetEliminatePolyPointLimitAngle() const
B2DPolygon expandToCurve(const B2DPolygon &rCandidate)
static bool lcl_ImpIsLine(const basegfx::B2DPolyPolygon &rPolyPolygon)
void ImpSetClosed(bool bClose)
bool ImpCanConvTextToCurve() const
virtual Point GetPoint(sal_uInt32 nHdlNum) const override
SdrPathObj & mrSdrPathObject
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
double mfSinRotationAngle
bool IsUseIncompatiblePathCreateInterface() const
tools::Long GetLen(const Point &rPnt)
Determine sector within the cartesian coordinate system.
basegfx::B2DPolyPolygon getB2DPolyPolygon() const
void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon &rPolygon)
sal_uInt32 GetPointNum() const
PointerStyle GetCreatePointer() const
bool areControlPointsUsed() const
SdrObject * GetObj() const
B2DVector getRange() const
SdrObjectUniquePtr ImpConvertAddText(SdrObjectUniquePtr pObj, bool bBezier) const
void SetHandleScale(bool bHandleScale)
Scaling is ignored from the transform matrix by default, to not break compatibility.
bool isHideContour() const
void NbcMirrorGluePoints(const Point &rRef1, const Point &rRef2)
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
virtual void BrkCreate(SdrDragStat &rStat) override
SwNodeOffset abs(const SwNodeOffset &a)
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 nHdlNum) override
virtual const tools::Rectangle & GetSnapRect() const override
bool MovCreate(SdrDragStat &rStat)
virtual void NbcResize(const Point &rRefPnt, const Fraction &aXFact, const Fraction &aYFact) override
All geometrical data of an arbitrary object for use in undo/redo.
std::unique_ptr< SdrPathObj, SdrObjectFreeOp > SdrPathObjUniquePtr
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
virtual bool HasText() const override
void SetOrtho8Possible(bool bOn=true)
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
HSLColor interpolate(const HSLColor &rFrom, const HSLColor &rTo, double t, bool bCCW)
constexpr tools::Long Width() const
const SdrHdl * GetHdl() const
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
ImpPathForDragAndCreate(SdrPathObj &rSdrPathObject)
const XPolygon & GetObject(sal_uInt16 nPos) const
virtual bool MovCreate(SdrDragStat &rStat) override
SdrPathObj(SdrModel &rSdrModel, SdrObjKind eNewKind)
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const override
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
bool isPrevControlPointUsed(sal_uInt32 nIndex) const
void CalcTangent(sal_uInt16 nCenter, sal_uInt16 nPrev, sal_uInt16 nNext)
Calculate tangent between two Bézier curves.
OUString SvxResId(TranslateId aId)
const SfxItemSet & GetObjectItemSet() const
void TakeCurrentObj(SdrObjKind &nIdent, SdrInventor &nInvent) const
void insert(sal_uInt32 nIndex, const basegfx::B2DPoint &rPoint, sal_uInt32 nCount=1)
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
SdrObject * RipPoint(sal_uInt32 nHdlNum, sal_uInt32 &rNewPt0Index)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv)
const Point & GetPos0() const
virtual void NbcShear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear) override
OutputDevice * GetFirstOutputDevice() const
tools::Rectangle maSnapRect
virtual ~SdrPathObjGeoData() override
virtual bool IsPolyObj() const override
natural cubic Spline (ni)
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
sal_uInt16 GetFreeHandMinDistPix() const
const B2DPoint & getEndPoint() const
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
sal_uInt16 GetAutoCloseDistPix() const
void SetNoSnap(bool bOn=true)
Polygon/PolyPolygon represented by SdrPathObj.
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)
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
virtual Point GetSnapPoint(sal_uInt32 i) const override
const B2DPoint & getControlPointA() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void rotate(double fRadiant)
SdrObject * GetCreateObj() const
tools::Long FRound(double fVal)
static basegfx::B2DPolyPolygon TakeDragPolyPolygon(const SdrDragStat &rDrag)
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...
SdrPathObjUniquePtr ImpConvertMakeObj(const basegfx::B2DPolyPolygon &rPolyPolygon, bool bClosed, bool bBezier) const
B2DPolygon makeStartPoint(const B2DPolygon &rCandidate, sal_uInt32 nIndexOfNewStatPoint)
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle, such that GetAngle(Point(0,-1))=90 deg.
void NbcSetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
void openWithGeometryChange(B2DPolygon &rCandidate)
std::unique_ptr< ImpPathForDragAndCreate > mpDAC
void BroadcastObjectChange() const
sal_Int32 GetPointCount() const
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
SdrView * GetView() const
bool IsAngleSnapEnabled() const
basegfx::B2DPoint getPrevControlPoint(sal_uInt32 nIndex) const
double getSmallestDistancePointToPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPoint &rTestPoint, sal_uInt32 &rPolygonIndex, sal_uInt32 &rEdgeIndex, double &rCut)
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
static sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed)
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override
void scale(double fX, double fY)
void setNextControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
SdrModel & getSdrModelFromSdrObject() const
SdrObjUserCall * m_pUserCall
void transform(const basegfx::B2DHomMatrix &rMatrix)
static bool IsBezier(SdrObjKind eKind)
bool BckCreate(SdrDragStat const &rStat)
static bool IsFreeHand(SdrObjKind eKind)
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
bool IsCreate1stPointAsCenter() const
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat &rDrag) const
basegfx::B2DPolyPolygon getObjectPolyPolygon(const SdrDragStat &rDrag) const
bool movePathDrag(SdrDragStat &rDrag) const
Degree100 GetSnapAngle() const
virtual void NbcMove(const Size &aSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
bool IsCreateMode() const
virtual SdrObjKind GetObjIdentifier() const override
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
B2DRange getRange(const B2DPolygon &rCandidate)
basegfx::B2DPolyPolygon TakeObjectPolyPolygon(const SdrDragStat &rDrag) const
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
bool endPathDrag(SdrDragStat const &rDrag)
sal_uInt32 NbcInsPoint(const Point &rPos, bool bNewObj)
const Point & GetPrev() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void Insert(sal_uInt16 nPos, const Point &rPt, PolyFlags eFlags)
virtual const tools::Rectangle & GetLogicRect() const override
rectangle (round corners optional)
virtual const tools::Rectangle & GetLastBoundRect() const
size_t GetHdlCount() const
basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
SdrHdl * GetHdl(size_t nNum) const
void setClosed(bool bNew)
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
void SetActionRect(const tools::Rectangle &rR)
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
void closeWithGeometryChange(B2DPolygon &rCandidate)
bool isNextControlPointUsed(sal_uInt32 nIndex) const
void split(double t, B2DCubicBezier *pBezierA, B2DCubicBezier *pBezierB) const
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const override
void Remove(sal_uInt16 nPos, sal_uInt16 nCount)
B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon &rCandidate, double fAngleBound)
virtual void NbcMirror(const Point &rRefPnt1, const Point &rRefPnt2) override
PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
constexpr tools::Long Height() const
bool IsControl(sal_uInt16 nPos) const
short path to read the CONTROL flag directly (TODO: better explain what the sense behind this flag is...
virtual OUString TakeObjNameSingul() const override
ImpPathForDragAndCreate & impGetDAC() const
virtual sal_uInt32 GetPointCount() const override
void SetFlags(sal_uInt16 nPos, PolyFlags eFlags)
set the flags for the point at the given position
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
void SetUser(std::unique_ptr< SdrDragStatUserData > pU)
double mfCosRotationAngle
void SetNow(Point const &pt)
B2DPoint getMinimum() const
XPolyPolygon aPathPolygon
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
virtual sal_uInt32 GetSnapPointCount() const override
snap to special points of an Object (polygon points, center of circle)
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const override
const Point & GetNow() const
bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd)
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
void translate(double fX, double fY)
const Point & GetAnchorPos() const
const basegfx::B2DPolyPolygon & GetPathPoly() const
static sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed)
void BegCreate(SdrDragStat &rStat)
void RotateXPoly(XPolygon &rPoly, const Point &rRef, double sn, double cs)
virtual bool BckCreate(SdrDragStat &rStat) override
const SdrFormTextAttribute & getSdrFormTextAttribute() const
#define SAL_WARN(area, stream)
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const override
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
bool LineGeometryUsageIsNecessary() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
const SdrHdlList & GetHdlList() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
SdrDragStatUserData * GetUser() const
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
sal_uInt16 GetPointCount() const
virtual void SetChanged()
void Remove(sal_uInt16 nPos)
basegfx::B2DPolyPolygon maPathPolygon
void PointsToBezier(sal_uInt16 nFirst)
convert four polygon points into a Bézier curve
void setPrevControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPolyPolygon getModifiedPolyPolygon() const
const OUString & GetName() const
virtual void NbcRotate(const Point &rRefPnt, Degree100 nAngle, double fSin, double fCos) override
sal_uInt32 GetSourceHdlNum() const
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
tools::Rectangle GetBoundRect() const
static bool IsClosed(SdrObjKind eKind)
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
virtual bool IsFontwork() const
const B2DPoint & getControlPointB() const
bool m_bDetectedRangeSegmentation false
OUString getSpecialDragComment(const SdrDragStat &rDrag) const
bool beginPathDrag(SdrDragStat const &rDrag) const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const