23 #include <rtl/ustrbuf.hxx>
33 #include <svx/strings.hrc>
50 #include <osl/diagnose.h>
54 static sal_uInt16
GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax,
bool bClosed)
65 static 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());
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;
216 void 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),
261 bMixedCreate(false),nBezierStartPoint(0),eStartKind(
OBJ_NONE),eCurrentKind(
OBJ_NONE) { }
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);
268 void CalcCircle(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView);
270 void CalcLine(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView);
273 void CalcRect(
const Point& rP1,
const Point& rP2,
const Point& rDir,
SdrView const * pView);
279 XPolygon ImpPathCreateUser::GetFormPoly()
const
281 if (bBezier)
return GetBezierPoly();
282 if (bCircle)
return GetCirclePoly();
283 if (bLine)
return GetLinePoly();
284 if (bRect)
return GetRectPoly();
288 void ImpPathCreateUser::CalcBezier(
const Point& rP1,
const Point& rP2,
const Point& rDir,
bool bMouseDown)
296 if (!bMouseDown || (0 == aBezEnd.X() && 0 == aBezEnd.Y())) aBezEnd=rP2;
301 XPolygon 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);
311 void 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((nTangAngle.
get() + 9000) * F_PI18000)));
333 aCircCenter.AdjustY(-(
FRound(nRad * sin((nTangAngle.
get() + 9000) * F_PI18000))));
337 aCircCenter.AdjustX(
FRound(nRad * cos((nTangAngle.
get() - 9000) * F_PI18000)));
338 aCircCenter.AdjustY(-(
FRound(nRad * sin((nTangAngle.
get() - 9000) * F_PI18000))));
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;
358 XPolygon 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;) {
372 sal_uInt16
n2=nCount-nNum-1;
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())) {
407 void 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;
428 XPolygon ImpPathCreateUser::GetLinePoly()
const
431 aXP[0]=aLineStart;
if (!bLine90) aXP.SetFlags(0,PolyFlags::Smooth);
436 void 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 );
488 XPolygon 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);
695 aNewPos1.AdjustX(ndx );
696 aNewPos1.AdjustY(ndy );
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);
716 aNewPos2.AdjustX(ndx );
717 aNewPos2.AdjustY(ndy );
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);
876 aTempPolyPolygon.setB2DPolygon(nPoly, aCandidate);
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());
1275 pU->eCurrentKind=eNewKind;
1276 pU->bMixedCreate=
true;
1278 if (pU->nBezierStartPoint>0) pU->nBezierStartPoint--;
1287 rXPoly[1]=rStat.
GetNow();
1290 if (nCurrentPoint==0) {
1292 }
else nCurrentPoint--;
1296 rXPoly[nCurrentPoint]=rStat.
GetNow();
1307 if (pU->nBezierStartPoint>nCurrentPoint) pU->nBezierStartPoint=nCurrentPoint;
1313 if (nMinDist<1) nMinDist=1;
1315 Point aPt0(rXPoly[nCurrentPoint-1]);
1317 tools::Long dx=aPt0.X()-aPt1.X();
if (dx<0) dx=-dx;
1318 tools::Long dy=aPt0.Y()-aPt1.Y();
if (dy<0) dy=-dy;
1319 if (dx<nMinDist && dy<nMinDist)
return false;
1324 if (nCurrentPoint-pU->nBezierStartPoint>=3 && ((nCurrentPoint-pU->nBezierStartPoint)%3)==0) {
1326 rXPoly.
SetFlags(nCurrentPoint-1,PolyFlags::Control);
1327 rXPoly.
SetFlags(nCurrentPoint-2,PolyFlags::Control);
1329 if (nCurrentPoint>=6 && rXPoly.
IsControl(nCurrentPoint-4)) {
1330 rXPoly.
CalcTangent(nCurrentPoint-3,nCurrentPoint-4,nCurrentPoint-2);
1331 rXPoly.
SetFlags(nCurrentPoint-3,PolyFlags::Smooth);
1334 rXPoly[nCurrentPoint+1]=rStat.
GetNow();
1337 pU->nBezierStartPoint=nCurrentPoint;
1341 pU->ResetFormFlags();
1343 if (nCurrentPoint>=2) {
1344 pU->CalcBezier(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],rStat.
IsMouseDown());
1345 }
else if (pU->bBezHasCtrl0) {
1346 pU->CalcBezier(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],pU->aBezControl0-rXPoly[nCurrentPoint-1],rStat.
IsMouseDown());
1349 if (pU->eCurrentKind==
OBJ_CARC && nCurrentPoint>=2) {
1350 pU->CalcCircle(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView);
1352 if (pU->eCurrentKind==
OBJ_LINE && nCurrentPoint>=2) {
1353 pU->CalcLine(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView);
1355 if (pU->eCurrentKind==
OBJ_RECT && nCurrentPoint>=2) {
1356 pU->CalcRect(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView);
1364 ImpPathCreateUser* pU=
static_cast<ImpPathCreateUser*
>(rStat.
GetUser());
1370 rXPoly[nCurrentPoint]=rStat.
GetNow();
1371 if (!pU->bMixedCreate && pU->eStartKind==
OBJ_LINE) {
1381 if (!pU->bMixedCreate &&
IsFreeHand(pU->eStartKind)) {
1392 if (nCurrentPoint==0 || rStat.
GetNow()!=rXPoly[nCurrentPoint-1]) {
1394 if (pU->nBezierStartPoint>nCurrentPoint) pU->nBezierStartPoint=nCurrentPoint;
1395 if (
IsBezier(pU->eCurrentKind) && nCurrentPoint-pU->nBezierStartPoint>=3 && ((nCurrentPoint-pU->nBezierStartPoint)%3)==0) {
1397 rXPoly.
SetFlags(nCurrentPoint-1,PolyFlags::Control);
1398 rXPoly.
SetFlags(nCurrentPoint-2,PolyFlags::Control);
1400 if (nCurrentPoint>=6 && rXPoly.
IsControl(nCurrentPoint-4)) {
1401 rXPoly.
CalcTangent(nCurrentPoint-3,nCurrentPoint-4,nCurrentPoint-2);
1402 rXPoly.
SetFlags(nCurrentPoint-3,PolyFlags::Smooth);
1406 if (nCurrentPoint==1 &&
IsBezier(pU->eCurrentKind) && !pU->bBezHasCtrl0) {
1407 pU->aBezControl0=rStat.
GetNow();
1408 pU->bBezHasCtrl0=
true;
1411 if (pU->IsFormFlag()) {
1413 rXPoly.
Remove(nCurrentPoint-1,2);
1416 for (sal_uInt16
i=nPointCount0+1;
i<nPointCount1-1;
i++) {
1423 rXPoly[nCurrentPoint]=rStat.
GetNow();
1427 pU->bBezHasCtrl0=
false;
1429 rXPoly[nCurrentPoint]=rXPoly[0];
1438 if (nPolyCount!=0) {
1443 if (nPointCount>=2) {
1445 if (rXP[nPointCount-1]==rXP[nPointCount-2]) {
1446 rXP.
Remove(nPointCount-1,1);
1449 if (rXP[nPointCount-3]==rXP[nPointCount-2]) {
1450 rXP.
Remove(nPointCount-3,3);
1455 for (sal_uInt16 nPolyNum=nPolyCount; nPolyNum>0;) {
1465 pU->ResetFormFlags();
1476 ImpPathCreateUser* pU=
static_cast<ImpPathCreateUser*
>(rStat.
GetUser());
1480 if (nCurrentPoint>0) {
1483 rXPoly.
Remove(nCurrentPoint,1);
1484 if (nCurrentPoint>=3 && rXPoly.
IsControl(nCurrentPoint-1)) {
1486 rXPoly.
Remove(nCurrentPoint-1,1);
1487 if (rXPoly.
IsControl(nCurrentPoint-2)) rXPoly.
Remove(nCurrentPoint-2,1);
1491 if (nCurrentPoint>=4) {
1493 if (rXPoly.
IsControl(nCurrentPoint-1)) {
1494 rXPoly.
Remove(nCurrentPoint-1,1);
1495 if (rXPoly.
IsControl(nCurrentPoint-2)) rXPoly.
Remove(nCurrentPoint-2,1);
1504 if (nLocalCurrentPoint>0) {
1505 nLocalCurrentPoint--;
1506 rLocalXPoly[nLocalCurrentPoint]=rStat.
GetNow();
1510 pU->ResetFormFlags();
1526 if(pView && pView->IsUseIncompatiblePathCreateInterface())
1529 ImpPathCreateUser* pU =
static_cast<ImpPathCreateUser*
>(rDrag.
GetUser());
1532 if(pU->IsFormFlag() && aNewPolygon.count() > 1)
1537 const sal_uInt32 nChangeIndex(aNewPolygon.count() - 2);
1538 const basegfx::B2DPoint aSavedPrevCtrlPoint(aNewPolygon.getPrevControlPoint(nChangeIndex));
1540 aNewPolygon.remove(nChangeIndex, 2);
1541 aNewPolygon.append(pU->GetFormPoly().getB2DPolygon());
1543 if(nChangeIndex < aNewPolygon.count())
1547 aNewPolygon.setPrevControlPoint(nChangeIndex, aSavedPrevCtrlPoint);
1553 aRetval.setB2DPolygon(aRetval.count() - 1, aNewPolygon);
1557 aRetval.append(aNewPolygon);
1571 const ImpPathCreateUser* pU =
static_cast<const ImpPathCreateUser*
>(rDrag.
GetUser());
1579 aRetval.
append(aHelpline);
1588 case OBJ_LINE :
return PointerStyle::DrawLine;
1589 case OBJ_POLY :
return PointerStyle::DrawPolygon;
1590 case OBJ_PLIN :
return PointerStyle::DrawPolygon;
1601 return PointerStyle::Cross;
1617 return std::make_unique<sdr::contact::ViewContactOfSdrPathObj>(*this);
1632 meKind(rSource.meKind)
1643 maPathPolygon(rPathPoly),
1760 if(
IsClosed() != rPolygon.isClosed())
1765 if(rPolygon.isClosed())
1835 OUStringBuffer
sName;
1839 const char* pId(STR_ObjNameSingulLINE);
1847 if(aB2DPoint0 != aB2DPoint1)
1849 if(aB2DPoint0.getY() == aB2DPoint1.getY())
1851 pId = STR_ObjNameSingulLINE_Hori;
1853 else if(aB2DPoint0.getX() == aB2DPoint1.getX())
1855 pId = STR_ObjNameSingulLINE_Vert;
1859 const double fDx(fabs(aB2DPoint0.getX() - aB2DPoint1.getX()));
1860 const double fDy(fabs(aB2DPoint0.getY() - aB2DPoint1.getY()));
1864 pId = STR_ObjNameSingulLINE_Diag;
1875 const char* pId(
nullptr);
1881 pId = STR_ObjNameSingulPOLY;
1885 pId = STR_ObjNameSingulPLIN;
1893 sal_uInt32 nPointCount(0);
1897 nPointCount += rPolygon.count();
1902 pId = STR_ObjNameSingulPOLY_PointCount;
1906 pId = STR_ObjNameSingulPLIN_PointCount;
1911 sName.append(sTemp.replaceFirst(
"%2", OUString::number(nPointCount)));
1929 if (!aName.isEmpty())
1933 sName.append(aName);
1937 return sName.makeStringAndClear();
1966 sal_uInt32 nRetval(0);
1970 nRetval += rPolygon.count();
1980 sal_uInt16 nPolyCnt=aOldPathPolygon.
Count();
1984 for (sal_uInt16
i=0;
i<nPolyCnt;
i++) {
1987 if (bClosed && nPntCnt>1) nPntCnt--;
1989 for (sal_uInt16 j=0; j<nPntCnt; j++) {
1990 if (rXPoly.
GetFlags(j)!=PolyFlags::Control) {
1991 const Point& rPnt=rXPoly[j];
1993 pHdl->SetPolyNum(
i);
1994 pHdl->SetPointNum(j);
1995 pHdl->Set1PixMore(j==0);
1996 pHdl->SetSourceHdlNum(nIdx);
1998 rHdlList.
AddHdl(std::move(pHdl));
2008 sal_uInt16 nPnt =
static_cast<sal_uInt16
>(rHdl.
GetPointNum());
2009 sal_uInt16 nPolyNum =
static_cast<sal_uInt16
>(rHdl.
GetPolyNum());
2011 if (nPolyNum>=aOldPathPolygon.
Count())
2014 const XPolygon& rXPoly = aOldPathPolygon[nPolyNum];
2024 sal_uInt16 nCnt = 0;
2025 if (rXPoly.
GetFlags(nPnt)!=PolyFlags::Control)
2029 if (nPnt>0 && rXPoly.
GetFlags(nPnt-1)==PolyFlags::Control)
2033 if (nPnt<nPntMax && rXPoly.
GetFlags(nPnt+1)==PolyFlags::Control)
2038 for (sal_uInt32 nPlusNum = 0; nPlusNum < nCnt; ++nPlusNum)
2040 nPnt =
static_cast<sal_uInt16
>(rHdl.
GetPointNum());
2046 if (nPnt>0 && rXPoly.
GetFlags(nPnt-1)==PolyFlags::Control && nPlusNum==0)
2048 pHdl->SetPos(rXPoly[nPnt-1]);
2049 pHdl->SetPointNum(nPnt-1);
2057 pHdl->SetPos(rXPoly[nPnt+1]);
2058 pHdl->SetPointNum(nPnt+1);
2063 pHdl->SetPlusHdl(
true);
2064 rHdlList.
AddHdl(std::move(pHdl));
2116 aRetval =
mpDAC->getSpecialDragComment(rDrag);
2165 if(bRetval &&
mpDAC)
2185 if(aCandidate.
count() > 2)
2191 if(aDistVector.getLength() <=
static_cast<double>(nCloseDist))
2227 aRetval =
mpDAC->TakeObjectPolyPolygon(rDrag);
2241 aRetval =
mpDAC->TakeObjectPolyPolygon(rDrag);
2274 const double fResizeX(xFact);
2275 const double fResizeY(yFact);
2290 double(xFact),
double(yFact), rRef.X(), rRef.Y()) * aTrans;
2322 aTrans.
translate(rRefPnt.X(), rRefPnt.Y());
2331 const double fDiffX(rRefPnt2.X() - rRefPnt1.X());
2332 const double fDiffY(rRefPnt2.Y() - rRefPnt1.Y());
2333 const double fRot(atan2(fDiffY, fDiffX));
2336 aTrans.
scale(1.0, -1.0);
2338 aTrans.
translate(rRefPnt1.X(), rRefPnt1.Y());
2362 rRect.
Move(aTmp.X(),aTmp.Y());
2395 if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
2396 if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
2397 if ( nDivX == nMulX ) { nMulX = 1; nDivX = 1; }
2398 if ( nDivY == nMulY ) { nMulY = 1; nDivY = 1; }
2412 sal_uInt32 nPoly,nPnt;
2413 if(!PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nSnapPnt, nPoly, nPnt))
2415 SAL_WARN(
"svx",
"SdrPathObj::GetSnapPoint: Point nSnapPnt does not exist.");
2429 sal_uInt32 nRetval(0);
2433 nRetval += rPolygon.count();
2442 sal_uInt32 nPoly,nPnt;
2444 if(PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nHdlNum, nPoly, nPnt))
2456 sal_uInt32 nPoly,nPnt;
2458 if(!PolyPolygonEditor::GetRelativePolyPoint(
GetPathPoly(), nHdlNum, nPoly, nPnt))
2493 sal_uInt32 nSmallestPolyIndex(0);
2494 sal_uInt32 nSmallestEdgeIndex(0);
2495 double fSmallestCut;
2523 sal_uInt32 nSmallestPolyIndex(0);
2524 sal_uInt32 nSmallestEdgeIndex(0);
2525 double fSmallestCut;
2528 const bool bBefore(!aCandidate.
isClosed() && 0 == nSmallestEdgeIndex && 0.0 == fSmallestCut);
2529 const bool bAfter(!aCandidate.
isClosed() && aCandidate.
count() == nSmallestEdgeIndex + 2 && 1.0 == fSmallestCut);
2534 aCandidate.
insert(0, aTestPoint);
2550 aCandidate.
append(aTestPoint);
2561 nNewHdl = aCandidate.
count() - 1;
2566 bool bSegmentSplit(
false);
2567 const sal_uInt32 nNextIndex((nSmallestEdgeIndex + 1) % aCandidate.
count());
2573 bSegmentSplit =
true;
2588 aBezier.
split(fSmallestCut, &aBezierA, &aBezierB);
2589 aCandidate.
insert(nSmallestEdgeIndex + 1, aTestPoint);
2601 aCandidate.
insert(nSmallestEdgeIndex + 1, aTestPoint);
2604 nNewHdl = nSmallestEdgeIndex + 1;
2610 for(sal_uInt32 a(0); a < nSmallestPolyIndex; a++)
2624 sal_uInt32 nPoly, nPnt;
2626 if(PolyPolygonEditor::GetRelativePolyPoint(aLocalPolyPolygon, nHdlNum, nPoly, nPnt))
2631 const sal_uInt32 nPointCount(aCandidate.count());
2644 rNewPt0Index = (nPointCount - nPnt) % nPointCount;
2648 if(nPointCount >= 3 && nPnt != 0 && nPnt + 1 < nPointCount)
2671 const bool bHideContour(
2680 if(pPath->GetPathPoly().areControlPointsUsed())
2696 pRet = std::move(pPath);
2709 return std::make_unique<SdrPathObjGeoData>();
2785 double fRotate(0.0);
2786 double fShearX(0.0);
2804 aScale = aPolyRangeNoCurve.
getRange();
2826 aInvObjectMatrix.
invert();
2827 rPolyPolygon.
transform(aInvObjectMatrix);
2836 aTranslate = aObjectMatrix * aCorrectedRangeNoCurve.
getMinimum();
2837 aScale = aCorrectedRangeNoCurve.
getRange();
2850 aScale = aPolyRangeNoCurve.
getRange();
2859 rPolyPolygon.
transform(aMoveToZeroMatrix);
2894 double fRotate, fShearX;
2895 rMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
2948 fScaleX *= fabs(aScale.
getX());
2949 fScaleY *= fabs(aScale.
getY());
2952 if (fScaleX != 1.0 || fScaleY != 1.0)
2953 aTransform.
scale(fScaleX, fScaleY);
2957 aTransform.
shearX(tan(-atan(fShearX)));
2967 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
const size_t count(pCandidateA->getBorderLines().size())
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
Polygon/PolyPolygon represented by SdrPathObj.
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
rectangle (round corners optional)
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...
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
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)
OUString SvxResId(const char *pId)
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.
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)
Degree100 NormAngle36000(Degree100 deg100)
Normalize angle to -180.00..179.99.
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
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
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)
UNDERLYING_TYPE get() const
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
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
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
Point PixelToLogic(const Point &rDevicePt) const
natural cubic Spline (ni)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void Insert(sal_uInt16 nPos, const Point &rPt, PolyFlags eFlags)
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...
OUString ImpGetDescriptionStr(const char *pStrCacheID) const
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
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
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
Degree100 abs(Degree100 x)
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
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
OUString getSpecialDragComment(const SdrDragStat &rDrag) const
bool beginPathDrag(SdrDragStat const &rDrag) const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const