24 #include <osl/diagnose.h>
36 #include <svx/strings.hrc>
75 : mbAddToTransparent(
false)
85 : maOriginalPolyPolygon(rOriginalPolyPolygon)
185 : maPrimitive2DSequence(
std::move(rSequence))
207 : maPositions(
std::move(rPositions)),
208 mbIsPointDrag(bIsPointDrag)
236 std::vector< basegfx::B2DPoint > aTransformedPositions;
238 aTransformedPositions.
reserve(aTransformed.count());
240 for(sal_uInt32
a = 0;
a < aTransformed.count();
a++)
242 aTransformedPositions.push_back(aTransformed.getB2DPoint(
a));
329 std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject,
340 rOverlayManager.
add(*pOverlayObject);
347 if(!rNewRange.isEmpty())
354 pOverlayObject->setOffset(aOffset);
371 for(
size_t a = 0;
a < nMarkCount; ++
a)
392 bool bAddWireframe(bSuppressFullDrag);
397 bAddWireframe =
true;
400 if(!bSuppressFullDrag)
427 sal_uInt32 nPointCount(0);
429 for(
size_t a = 0; !bNoPolygons &&
a < nMarkCount; ++
a)
437 for(
auto const& rPolygon : aNewPolyPolygon)
439 nPointCount += rPolygon.
count();
449 aResult.
append(aNewPolyPolygon);
472 std::vector< basegfx::B2DPoint > aPositions;
474 for(
size_t nm = 0; nm < nMarkCount; ++nm)
493 for(
const sal_uInt16 nObjPt : rPts)
495 sal_uInt32 nPolyNum, nPointNum;
508 if(!aPositions.empty())
517 std::vector< basegfx::B2DPoint > aPositions;
519 for(
size_t nm = 0; nm < nMarkCount; ++nm)
534 for(
const sal_uInt16 nObjPt : rPts)
540 const Point aPoint((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
541 aPositions.emplace_back(aPoint.X(), aPoint.Y());
549 if(!aPositions.empty())
612 -aPolyRange.getMinX(),
613 -aPolyRange.getMinY()));
614 aPolyTransform.
scale(fScaleX, fScaleY);
617 aObjectPolyPolygon.
transform(aPolyTransform);
630 : mrSdrDragView(rNewView),
632 mbSolidDraggingActive(getSdrDragView().IsSolidDragging()),
633 mbShiftPressed(
false)
694 std::vector< SdrEdgeObj* > aEdges;
702 if(pSdrDragEntrySdrObject)
710 aEdges.push_back(pSdrEdgeObj);
713 if(pSdrDragEntrySdrObject->
getClone())
715 aOriginalAndClones[&pSdrDragEntrySdrObject->
getOriginal()] = pSdrDragEntrySdrObject->
getClone();
727 SdrObjectAndCloneMap::iterator aEntry = aOriginalAndClones.find(pConnectedTo);
729 if(aEntry != aOriginalAndClones.end())
739 SdrObjectAndCloneMap::iterator aEntry = aOriginalAndClones.find(pConnectedTo);
741 if(aEntry != aOriginalAndClones.end())
752 for(
auto & pCandidate: maSdrDragEntries)
756 if(!aCandidateResult.empty())
758 if(pCandidate->getAddToTransparent())
760 aResultTransparent.
append(aCandidateResult);
764 aResult.
append(aCandidateResult);
773 if(!aConnectorOverlays.empty())
776 aResultTransparent.
append(aConnectorOverlays);
782 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
784 std::move(aResult)));
787 std::move(pNewOverlayObject),
792 if(!aResultTransparent.empty())
797 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
799 std::move(aResultTransparent)));
802 std::move(pNewOverlayObject),
817 std::unique_ptr<sdr::overlay::OverlayRollingRectangleStriped> pNew(
851 dynamic_cast<const SdrDragMove*
>(
this) !=
nullptr || dynamic_cast<const SdrDragResize*>(
this) !=
nullptr ||
852 dynamic_cast<const SdrDragRotate*
>(
this) !=
nullptr || dynamic_cast<const SdrDragMirror*>(
this) != nullptr ))
858 if( dynamic_cast< const SdrDragObjOwn* >(
this) !=
nullptr ||
dynamic_cast< const SdrDragMovHdl*
>(
this) !=
nullptr )
884 if(aEdgePolygon.
count())
891 if(bUseSolidDragging)
896 bUseSolidDragging =
false;
900 if(bUseSolidDragging)
933 aEdgePolygon, aColA, aColB, fStripeLength));
934 aRetval.push_back(aPolyPolygonMarkerPrimitive2D);
976 if (pH1==
nullptr || pH2==
nullptr)
978 OSL_FAIL(
"SdrDragMovHdl::BeginSdrDrag(): Moving the axis of reflection: reference handles not found.");
995 Point aPnt(rNoSnapPnt);
1005 if (pH1==
nullptr || pH2==
nullptr)
1012 bool bXSnapped=
false;
1013 bool bYSnapped=
false;
1017 aPnt.AdjustX(nBestXSnap );
1018 aPnt.AdjustY(nBestYSnap );
1069 nNewAngle+=nSA/2_deg100;
1079 if (nSA==9000_deg100)
1081 if (nNewAngle==0_deg100 || nNewAngle==18000_deg100) aPnt.setY(aRef.Y() );
1082 if (nNewAngle==9000_deg100 || nNewAngle==27000_deg100) aPnt.setX(aRef.X() );
1085 if (nSA==4500_deg100)
1155 return PointerStyle::RefHand;
1181 bool bAddWireframe(
true);
1192 bAddWireframe =
false;
1202 bAddWireframe =
true;
1209 aDragPolyPolygon =
mxClone->TakeXorPoly();
1215 if(aSpecialDragPolyPolygon.count())
1217 aDragPolyPolygon.
append(aSpecialDragPolyPolygon);
1220 if(aDragPolyPolygon.
count())
1277 Point aPnt(rNoSnapPnt);
1294 else if (
DragStat().IsOrtho4Possible())
1300 if (!
DragStat().CheckMinMoved(rNoSnapPnt))
1328 if (bOldAutoGrowWidth != bNewAutoGrowWidth)
1339 std::vector< std::unique_ptr<SdrUndoAction> > vConnectorUndoActions;
1345 std::unique_ptr<SdrUndoAction> pUndo;
1346 std::unique_ptr<SdrUndoAction> pUndo2;
1358 if (
DragStat().IsEndDragChangesGeoAndAttributes())
1395 if (
DragStat().IsEndDragChangesLayout())
1440 return PointerStyle::Move;
1451 std::unique_ptr<SdrDragEntry>(
1453 std::move(xRetval))));
1485 aStr +=
SvxResId(STR_EditWithCopy);
1549 Point aNoSnapPnt(rNoSnapPnt_);
1553 Point aLO(aSR.
TopLeft()); aLO.AdjustX(nMovedx ); aLO.AdjustY(nMovedy );
1554 Point aRU(aSR.
BottomRight()); aRU.AdjustX(nMovedx ); aRU.AdjustY(nMovedy );
1555 Point aLU(aLO.X(),aRU.Y());
1556 Point aRO(aRU.X(),aLO.Y());
1572 if (!
DragStat().CheckMinMoved(aNoSnapPnt))
1577 bool bWorkArea=!aLR.
IsEmpty();
1580 if (bDragLimit || bWorkArea)
1597 aSR2.
Move(aD.X(),0);
1601 aPt1.AdjustX( -(aSR2.
Left()-aLR.
Left()) );
1613 aSR2.
Move(0,aD.Y());
1615 if (aSR2.
Top()<aLR.
Top())
1617 aPt1.AdjustY( -(aSR2.
Top()-aLR.
Top()) );
1634 for (
size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1645 for (sal_uInt16
nId : rPts)
1651 Point aPt((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
1653 if (aPt.X()<aBound.Left() ) aPt1.AdjustX( -(aPt.X()-aBound.Left()) ) ;
1654 if (aPt.X()>aBound.Right() ) aPt1.AdjustX( -(aPt.X()-aBound.Right()) ) ;
1655 if (aPt.Y()<aBound.Top() ) aPt1.AdjustY( -(aPt.Y()-aBound.Top()) ) ;
1656 if (aPt.Y()>aBound.Bottom()) aPt1.AdjustY( -(aPt.Y()-aBound.Bottom()) );
1706 return PointerStyle::MovePoint;
1710 return PointerStyle::Move;
1728 sal_Int32 nXDiv(aStart.X() - aRef.X());
1733 sal_Int32 nYDiv(aStart.Y() - aRef.Y());
1738 bool bX(
aXFact != aFact1 && std::abs(nXDiv) > 1);
1739 bool bY(
aYFact != aFact1 && std::abs(nYDiv) > 1);
1766 aStr +=
SvxResId(STR_EditWithCopy);
1800 if (pRef1!=
nullptr && pRef2!=
nullptr)
1832 bool bWorkArea=!aLR.
IsEmpty();
1835 if (bDragLimit || bWorkArea)
1849 if (aPnt.X()<aLR.
Left())
1850 aPnt.setX(aLR.
Left() );
1851 else if (aPnt.X()>aLR.
Right())
1852 aPnt.setX(aLR.
Right() );
1854 if (aPnt.Y()<aLR.
Top())
1855 aPnt.setY(aLR.
Top() );
1856 else if (aPnt.Y()>aLR.
Bottom())
1857 aPnt.setY(aLR.
Bottom() );
1859 if (aRef.X()>aSR.
Left())
1867 if (aRef.X()<aSR.
Right())
1875 if (aRef.Y()>aSR.
Top())
1883 if (aRef.Y()<aSR.
Bottom())
1892 tools::Long nXDiv=aStart.X()-aRef.X();
if (nXDiv==0) nXDiv=1;
1893 tools::Long nYDiv=aStart.Y()-aRef.Y();
if (nYDiv==0) nYDiv=1;
1909 bool bXNeg=nXMul<0;
if (bXNeg) nXMul=-nXMul;
1910 bool bYNeg=nYMul<0;
if (bYNeg) nYMul=-nYMul;
1915 if (std::abs(nXDiv)<=1 || std::abs(nYDiv)<=1)
1973 if (aNewXFact>aMaxFact)
1979 if (aNewYFact>aMaxFact)
2040 return PointerStyle::Move;
2067 nTmpAngle -= 36000_deg100;
2073 aStr +=
SvxResId(STR_EditWithCopy);
2101 OSL_FAIL(
"SdrDragRotate::BeginSdrDrag(): No reference point handle found.");
2115 if (!
DragStat().CheckMinMoved(aPnt))
2129 nNewAngle += nSA / 2_deg100;
2142 if (nSekt0==0 && nSekt1==3)
2145 if (nSekt0==3 && nSekt1==0)
2150 double nSin1=sin(a);
2151 double nCos1=cos(a);
2183 return PointerStyle::Rotate;
2208 nTmpAngle += 18000_deg100;
2215 aStr +=
SvxResId(STR_EditWithCopy);
2236 if (pRefHdl!=
nullptr)
2243 OSL_FAIL(
"SdrDragShear::BeginSdrDrag(): No reference point handle for shearing found.");
2277 if (!
DragStat().CheckMinMoved(rPnt))
2291 if (nSA==0_deg100 && !
bSlant)
2297 aPnt.setX(aP0.X() );
2299 aPnt.setY(aP0.Y() );
2303 Point aDif(aPnt-aRef);
2321 if (nNewAngle<
Degree100(-9000) || nNewAngle>9000_deg100)
2333 aNewFract=
Fraction(aPt2.X()-aRef.X(),aP0.X()-aRef.X());
2337 aNewFract=
Fraction(aPt2.Y()-aRef.Y(),aP0.Y()-aRef.Y());
2342 bool bNeg=nNewAngle<0_deg100;
2345 nNewAngle=-nNewAngle;
2349 nNewAngle += nSA / 2_deg100;
2355 bUpSideDown=nNewAngle>9000_deg100 && nNewAngle<27000_deg100;
2362 if (bNeg) nTmpAngle=-nTmpAngle;
2368 if (nNewAngle > 8900_deg100)
2369 nNewAngle = 8900_deg100;
2372 nNewAngle=-nNewAngle;
2379 double nTan1=tan(a);
2421 aStr +=
SvxResId(STR_EditWithCopy);
2457 return PointerStyle::VShear;
2459 return PointerStyle::HShear;
2485 return nAngle1<18000_deg100;
2493 else if (
aDif.Y()==0)
2495 else if (std::abs(
aDif.X()) == std::abs(
aDif.Y()))
2510 if (pH1!=
nullptr && pH2!=
nullptr)
2517 bool b90=(
aDif.X()==0) ||
aDif.Y()==0;
2518 bool b45=b90 || (std::abs(
aDif.X()) == std::abs(
aDif.Y()));
2533 OSL_FAIL(
"SdrDragMirror::BeginSdrDrag(): Axis of reflection not found.");
2546 const double fRotation(atan2(fDeltaY, fDeltaX));
2549 aRetval.
rotate(-fRotation);
2550 aRetval.
scale(1.0, -1.0);
2551 aRetval.
rotate(fRotation);
2560 if (!
DragStat().CheckMinMoved(rPnt))
2564 bool bNewMirrored=
bSide0!=bNewSide;
2589 return PointerStyle::Mirror;
2595 pIAOHandle(nullptr),
2610 bool bRetval(
false);
2644 if(!bHit && pColHdl)
2671 OSL_FAIL(
"SdrDragGradient::BeginSdrDrag(): IAOGradient not found.");
2747 return PointerStyle::RefHand;
2754 bContortionAllowed(
false),
2755 bNoContortionAllowed(
false),
2757 bResizeAllowed(
false),
2759 bRotateAllowed(
false),
2787 nVal = std::abs(nVal);
2792 aStr +=
SvxResId(STR_EditWithCopy);
2798 #define DRAG_CROOK_RASTER_MINIMUM (4)
2799 #define DRAG_CROOK_RASTER_MAXIMUM (15)
2800 #define DRAG_CROOK_RASTER_DISTANCE (30)
2823 const double fXLen(rMarkRect.
GetWidth() /
static_cast<double>(nHorDiv));
2824 const double fYLen(rMarkRect.
GetHeight() /
static_cast<double>(nVerDiv));
2825 double fYPos(rMarkRect.
Top());
2828 for(a = 0; a <= nVerDiv; a++)
2831 for(b = 0; b < nHorDiv; b++)
2835 const double fNewX(rMarkRect.
Left() + (b * fXLen));
2841 aRetval.
append(aHorLineSegment);
2848 double fXPos(rMarkRect.
Left());
2850 for(a = 0; a <= nHorDiv; a++)
2853 for(b = 0; b < nVerDiv; b++)
2857 const double fNewY(rMarkRect.
Top() + (b * fYLen));
2863 aRetval.
append(aVerLineSegment);
2881 if(aDragRaster.
count())
2926 sal_uInt16 nPolyCount=aTempPolyPoly.
Count();
2930 sal_uInt16 n1st=0,nLast=0;
2933 while (n1st<nPolyCount)
2936 while (nLast<nPolyCount && aTempPolyPoly[nLast].GetPointCount()!=0) nLast++;
2940 for (i=n1st+1; i<nLast; i++)
2942 aBound.
Union(aTempPolyPoly[n1st].GetBoundRect());
2963 double nSin=0,nCos=0;
2979 for (i=n1st; i<nLast; i++)
2986 aTempPolyPoly[i].Move(aCtr1.X(),aCtr1.Y());
2996 for (j=0; j<nPolyCount; j++)
3002 while (i<nPointCount)
3004 Point* pPnt=&aPol[i];
3008 if (i+1<nPointCount && aPol.
IsControl(i))
3035 bool bC1=pC1!=
nullptr;
3036 bool bC2=pC2!=
nullptr;
3080 if (!
DragStat().CheckMinMoved(rPnt))
3096 aNewCenter.setX(
aStart.X() );
3126 bValid = std::abs(dx1)*100>std::abs(dy1);
3128 bValid = std::abs(dy1)*100>std::abs(dx1);
3141 a=
static_cast<double>(dy1)/static_cast<double>(dx1);
3143 aNewCenter.AdjustX(nNewRad );
3144 nPntAngle=
GetAngle(aPnt-aNewCenter);
3148 a=
static_cast<double>(dx1)/static_cast<double>(dy1);
3150 aNewCenter.AdjustY(nNewRad );
3151 nPntAngle=
GetAngle(aPnt-aNewCenter)-9000_deg100;
3158 if (
bRgt) nPntAngle += 18000_deg100;
3159 if (
bLft) nPntAngle = 18000_deg100 - nPntAngle;
3160 if (
bLwr) nPntAngle =- nPntAngle;
3164 if (
bRgt) nPntAngle = -nPntAngle;
3165 if (
bUpr) nPntAngle = 18000_deg100 - nPntAngle;
3166 if (
bLwr) nPntAngle += 18000_deg100;
3173 if (nNewRad<0) nPntAngle += 18000_deg100;
3174 if (
bVertical) nPntAngle = 18000_deg100 - nPntAngle;
3176 nPntAngle =
abs(nPntAngle);
3179 double nCircumference = 2 * std::abs(nNewRad) * M_PI;
3200 if (
nAngle==0_deg100 || nNewRad==0)
3218 nMul = std::abs(nMul);
3246 if (!(bDoCrook || bDoResize))
3278 Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
3317 aStr +=
SvxResId(STR_EditWithCopy);
3340 for (
size_t nm=0; nm<nMarkCount; ++nm)
3352 Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
3378 return PointerStyle::Crook;
3385 bContortionAllowed(
false),
3386 bNoContortionAllowed(
false),
3401 aStr +=
SvxResId(STR_EditWithCopy);
3412 if(aDragRaster.
count())
3465 aDragPolygon =
basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
3466 rTarget = aDragPolygon;
3472 if (!
DragStat().CheckMinMoved(rPnt))
3508 return PointerStyle::RefHand;
3546 aStr +=
SvxResId(STR_EditWithCopy);
3589 bool bExternal(
false);
3594 if (
nullptr != pSdrObject && dynamic_cast< const SdrGrafObj* >(pSdrObject) ==
nullptr)
3603 if(dynamic_cast< SdrGrafObj* >(pFullDragClone.get()))
3606 pExternalSdrObject = pSdrObject;
3607 pSdrObject = pFullDragClone.get();
3620 const bool bUndo(!bExternal &&
getSdrDragView().IsUndoEnabled());
3635 bool bShearCorrected(
false);
3643 bShearCorrected =
true;
3655 bool bOnAxis(
false);
3681 aLocalCurrent.
setX(aLocalStart.
getX());
3685 aLocalCurrent.
setY(aLocalStart.
getY());
3694 if(aLocalStart.
getX() < 0.5)
3696 aDiscreteChangeMatrix.
scale(aLocalCurrent.
getX(), 1.0);
3700 aDiscreteChangeMatrix.
scale(1.0 - aLocalCurrent.
getX(), 1.0);
3707 if(aLocalStart.
getY() < 0.5)
3709 aDiscreteChangeMatrix.
scale(1.0, aLocalCurrent.
getY());
3713 aDiscreteChangeMatrix.
scale(1.0, 1.0 - aLocalCurrent.
getY());
3733 aRangeOriginalNoShearNoRotate.
transform(aOriginalMatrixNoShearNoRotate);
3734 aRangeNewNoShearNoRotate.
transform(aOriginalMatrixNoShearNoRotate * aDiscreteChangeMatrix);
3742 const double fScaleX(aRangeNewNoShearNoRotate.
getWidth() / aRangeOriginalNoShearNoRotate.
getWidth());
3743 const double fScaleY(aRangeNewNoShearNoRotate.
getHeight() / aRangeOriginalNoShearNoRotate.
getHeight());
3745 pExternalSdrObject->
Crop(
3802 Size aGraphicSize(rGraphicObject.GetPrefSize());
3804 if(MapUnit::MapPixel == rGraphicObject.GetPrefMapMode().GetMapUnit())
3813 if(0 == aGraphicSize.Width() || 0 == aGraphicSize.Height())
3819 double fScaleX = ( aGraphicSize.Width() - rOldCrop.GetLeft() - rOldCrop.GetRight() ) / static_cast<double>(aOldRect.
GetWidth());
3820 double fScaleY = ( aGraphicSize.Height() - rOldCrop.GetTop() - rOldCrop.GetBottom() ) / static_cast<double>(aOldRect.
GetHeight());
3822 sal_Int32 nDiffLeft = aNewRect.
Left() - aOldRect.
Left();
3823 sal_Int32 nDiffTop = aNewRect.
Top() - aOldRect.
Top();
3824 sal_Int32 nDiffRight = aNewRect.
Right() - aOldRect.
Right();
3825 sal_Int32 nDiffBottom = aNewRect.
Bottom() - aOldRect.
Bottom();
3831 sal_Int32 nTmp(nDiffLeft);
3832 nDiffLeft = -nDiffRight;
3836 sal_Int32 nLeftCrop =
static_cast<sal_Int32
>( rOldCrop.GetLeft() + nDiffLeft * fScaleX );
3837 sal_Int32 nTopCrop =
static_cast<sal_Int32
>( rOldCrop.GetTop() + nDiffTop * fScaleY );
3838 sal_Int32 nRightCrop =
static_cast<sal_Int32
>( rOldCrop.GetRight() - nDiffRight * fScaleX );
3839 sal_Int32 nBottomCrop =
static_cast<sal_Int32
>( rOldCrop.GetBottom() - nDiffBottom * fScaleY );
3843 aSet.
Put( SdrGrafCropItem( nLeftCrop, nTopCrop, nRightCrop, nBottomCrop ) );
3857 return PointerStyle::Crop;
const SdrMarkList & GetMarkedObjectList()
virtual void Shear(const Point &rRef, Degree100 nAngle, double tn, bool bVShear)
virtual void MoveSdrDrag(const Point &rPnt) override
const SdrUShortCont & GetMarkedGluePoints() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
SdrObjectUniquePtr mxClone
void createSdrDragEntries_SolidDrag()
SdrHdlColor * GetColorHdl1() const
SdrDragEntryPointGlueDrag(std::vector< basegfx::B2DPoint > &&rPositions, bool bIsPointDrag)
virtual void MoveSdrDrag(const Point &rPnt) override
virtual bool EndSdrDrag(bool bCopy) override
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
std::vector< std::unique_ptr< SdrUndoAction > > CreateConnectorUndo(const SdrObject &rO)
virtual void MoveSdrDrag(const Point &rPnt) override
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
void MirrorMarkedObj(const Point &rRef1, const Point &rRef2, bool bCopy=false)
static basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView const &rPageView, const tools::Rectangle &rMarkRect)
SdrHdl * GetDragHdl() const
bool DoAddConnectorOverlays()
size_t GetMarkCount() const
virtual void CreateOverlayGeometry(sdr::overlay::OverlayManager &rOverlayManager, const sdr::contact::ObjectContact &rObjectContact)
void prepareCurrentState(SdrDragMethod &rDragMethod)
virtual const tools::Rectangle & GetCurrentBoundRect() const
tools::Long GetDX() const
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
void SetPos(const Point &rPnt)
SdrDragEntryPolyPolygon(const basegfx::B2DPolyPolygon &rOriginalPolyPolygon)
SdrHdlColor * GetColorHdl2() const
virtual ~SdrDragEntryPointGlueDrag() override
bool IsResizeAllowed(bool bProp=false) const
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
const SdrUShortCont & GetMarkedPoints() const
void Set2ndPos(const Point &rPnt)
B2DTuple absolute(const B2DTuple &rTup)
SdrDragResize(SdrDragView &rNewView)
virtual bool EndSdrDrag(bool bCopy) override
virtual void TakeActionRect(tools::Rectangle &rRect) const override
void SetSkipChangeLayout(bool bOn)
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod &rDragMethod) override
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual OUString GetSdrDragComment() const override
void SetVerFixed(bool bOn)
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
tools::Long GetDY() const
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
const Point & GetStart() const
virtual bool BeginSdrDrag() override
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
static OUString GetAngleString(Degree100 nAngle)
B2DPolygon expandToCurve(const B2DPolygon &rCandidate)
virtual bool EndSdrDrag(bool bCopy) override
bool IsUndoEnabled() const
bool CheckMinMoved(const Point &rPnt)
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
virtual bool EndSdrDrag(bool bCopy) override
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon &rTarget)
static void ImpDistortObj(SdrObject *pO, const tools::Rectangle &rRef, const XPolygon &rDistortedRect, bool bNoContortion)
bool IsDraggingPoints() const
static size_t GetDragXorPointLimit()
basegfx::B2DPolyPolygon getB2DPolyPolygon() const
void RotateMarkedObj(const Point &rRef, Degree100 nAngle, bool bCopy=false)
void resetSdrDragEntries()
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
virtual void createSdrDragEntries()
SdrHdlGradient * pIAOHandle
SdrObject * GetObj() const
virtual void CancelSdrDrag()
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
Changing the geometry of an object.
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod &rDragMethod) override
virtual void MoveSdrDrag(const Point &rPnt) override
SdrMark * GetMark(size_t nNum) const
void append(std::unique_ptr< OverlayObject > pOverlayObject)
SdrDragShear(SdrDragView &rNewView, bool bSlant1)
const Point & GetPos() const
virtual void createSdrDragEntryForSdrObject(const SdrObject &rOriginal) override
virtual void ConnectToNode(bool bTail1, SdrObject *pObj)
const GraphicObject & GetGraphicObject(bool bForceSwapIn=false) const
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon) override
virtual void createSdrDragEntries() override
SdrDragCrop(SdrDragView &rNewView)
bool IsDraggingGluePoints() const
SwNodeOffset abs(const SwNodeOffset &a)
virtual void MoveSdrDrag(const Point &rPnt) override
virtual bool EndSdrDrag(bool bCopy) override
void EndTextEditCurrentView(bool bDontDeleteReally=false)
GraphicType GetGraphicType() const
EmbeddedObjectRef * pObject
virtual void MoveSdrDrag(const Point &rPnt) override
double CrookRotateXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
The following methods accept a point of an XPolygon, whereas the neighbouring control points of the a...
virtual bool BeginSdrDrag() override
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
const Color & GetHighlightColor() const
sdr::contact::ViewContact & GetViewContact() const
virtual PointerStyle GetPointer() const
virtual const tools::Rectangle & GetSnapRect() const
const Point & Get2ndPos() const
B2DRange getB2DRange() const
SdrDragRotate(SdrDragView &rNewView)
void add(OverlayObject &rOverlayObject)
static OutputDevice * GetDefaultDevice()
void createSdrDragEntries_PolygonDrag()
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
std::vector< std::unique_ptr< SdrDragEntry > > maSdrDragEntries
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
virtual bool BeginSdrDrag() override
virtual PointerStyle GetSdrDragPointer() const override
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
const B2DVector & getTranslate() const
std::map< const SdrObject *, SdrObject * > SdrObjectAndCloneMap
virtual void MoveSdrDrag(const Point &rPnt) override
bool mbSolidDraggingActive
void addSdrDragEntry(std::unique_ptr< SdrDragEntry > pNew)
void setSolidDraggingActive(bool bNew)
double CrookStretchXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert, const tools::Rectangle &rRefRect)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
void SetHorFixed(bool bOn)
SdrDragEntrySdrObject(const SdrObject &rOriginal, bool bModify)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
void ResizeMarkedPoints(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
OUString SvxResId(TranslateId aId)
Point GetSnapPos(const Point &rPt) const
tools::Rectangle aMarkRect
attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet &rSet)
bool IsMoveFirstHandle() const
virtual void Crop(const basegfx::B2DPoint &rRef, double fxFact, double fyFact)
void DistortMarkedObj(const tools::Rectangle &rRef, const XPolygon &rDistortedRect, bool bNoContortion, bool bCopy=false)
SdrCrookMode GetCrookMode() const
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
virtual PointerStyle GetSdrDragPointer() const override
virtual PointerStyle GetSdrDragPointer() const override
bool IsRotateAllowed(bool b90Deg=false) const
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SdrDragMethod(SdrDragView &rNewView)
virtual OUString GetSdrDragComment() const override
virtual PointerStyle GetSdrDragPointer() const override
const tools::Rectangle & GetMarkedRect() const
virtual SdrObject * GetConnectedNode(bool bTail1) const
B2IRange fround(const B2DRange &rRange)
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod &rDragMethod) override
tools::Rectangle aMarkRect
void ImpCheckSnap(const Point &rPt)
virtual PointerStyle GetSdrDragPointer() const override
Point Rotate(const Point &rPoint, Degree10 nOrientation, const Point &rOrigin)
virtual ~SdrDragObjOwn() override
void SetRef2(const Point &pt)
void clearSdrDragEntries()
SdrObject * GetMarkedSdrObj() const
virtual OUString GetSdrDragComment() const override
virtual PointerStyle GetSdrDragPointer() const override
OUString ImpGetDescriptionStr(TranslateId pStrCacheID) const
Everything a View needs to know about a selected object.
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod &rDragMethod) override
SdrDragView & getSdrDragView()
void ReduceInaccurate(unsigned nSignificantBits)
sdr::overlay::OverlayObjectList maOverlayObjectList
virtual void MoveSdrDrag(const Point &rPnt) override
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
bool IsCrookNoContortion() const
void ResizeMarkedGluePoints(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bCopy)
UNDERLYING_TYPE get() const
virtual const SdrGluePointList * GetGluePointList() const
static bool GetRelativePolyPoint(const basegfx::B2DPolyPolygon &rPoly, sal_uInt32 nAbsPnt, sal_uInt32 &rPolyNum, sal_uInt32 &rPointNum)
Outputs the relative position ( polygon number and point number in that polygon ) from the absolute p...
void setMoveOnly(bool bNew)
void append(const Primitive2DReference &)
void SetRef1(const Point &pt)
bool HasMarkedObjPageView() const
void ResizeMarkedObj(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bCopy=false)
sal_uInt16 GetStripeLength()
SdrDragMirror(SdrDragView &rNewView)
#define SDRGLUEPOINT_NOTFOUND
virtual void MoveSdrDrag(const Point &rPnt) override
SdrSnap SnapPos(Point &rPt) const
void rotate(double fRadiant)
basegfx::B2DPolygon ImplAddConnectorOverlay(const SdrDragMethod &rDragMethod, bool bTail1, bool bTail2, bool bDetail) const
virtual OUString GetSdrDragComment() const override
const B2DPolyPolygon maOriginal
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix &rMatrix, const basegfx::B2DPolyPolygon &rPolyPolygon)
virtual bool BeginSdrDrag() 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 BroadcastObjectChange() const
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
BitmapEx createDefaultCross_3x3(const basegfx::BColor &rBColor)
const SdrMarkList & GetMarkedObjectList() const
SdrPageView * GetPageView() const
SdrDragGradient(SdrDragView &rNewView, bool bGrad=true)
virtual bool supportsFullDrag() const
SdrObjectUniquePtr mxClone
virtual void CancelSdrDrag() override
#define DRAG_CROOK_RASTER_DISTANCE
virtual OUString GetSdrDragComment() const override
void FromIAOToItem(SdrObject *pObj, bool bSetItemOnObject, bool bUndo)
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
static void ImpCrookObj(SdrObject *pO, const Point &rRef, const Point &rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bRotate, const tools::Rectangle &rMarkRect)
bool IsDraggingGluePoints() const
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget)
void OrthoDistance8(const Point &rPt0, Point &rPt, bool bBigOrtho)
void scale(double fX, double fY)
SdrModel & getSdrModelFromSdrObject() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void NextMove(const Point &rPnt)
const SdrMarkList & GetEdgesOfMarkedNodes() const
virtual void createSdrDragEntries() override
virtual bool BeginSdrDrag() override
SdrPageView * GetPageView() const
virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon &rTarget) override
virtual void Move(const Size &rSiz)
void SetMergedItem(const SfxPoolItem &rItem)
bool bNoContortionAllowed
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
bool IsResizeProtect() const
virtual void CancelSdrDrag() override
virtual bool EndSdrDrag(bool bCopy) override
bool IsCrookAtCenter() const
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
const B2DVector & getScale() const
basegfx::B2DRange getCurrentRange() const
This class represents an embedded or linked bitmap graphic object.
bool getSolidDraggingActive() const
Degree100 GetSnapAngle() const
SdrDragMove(SdrDragView &rNewView)
virtual bool BeginSdrDrag() override
virtual bool BeginSdrDrag() override
constexpr TypedWhichId< SdrGrafCropItem > SDRATTR_GRAFCROP(SDRATTR_GRAF_FIRST+9)
virtual void Mirror(const Point &rRef1, const Point &rRef2)
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(const SfxItemSet &rSet, double fWidth)
void CrookMarkedObj(const Point &rRef, const Point &rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bCopy=false)
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
void CheckSnap(const Point &rPt, tools::Long &nBestXSnap, tools::Long &nBestYSnap, bool &bXSnapped, bool &bYSnapped) const
SdrDragEntryPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DContainer &&rSequence)
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.
virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon &rTarget) override
sal_uInt16 FindGluePoint(sal_uInt16 nId) const
bool HasLineStyle() const
virtual std::unique_ptr< SdrUndoAction > CreateUndoGeoObject(SdrObject &rObject)
const sdr::overlay::OverlayObjectList & getOverlayObjectList() const
void MovAllPoints(basegfx::B2DPolyPolygon &rTarget)
void MovCrookPoint(Point &rPnt, Point *pC1, Point *pC2)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void ShearMarkedObj(const Point &rRef, Degree100 nAngle, bool bVShear=false, bool bCopy=false)
const tools::Rectangle & GetDragLimitRect()
void RotateMarkedPoints(const Point &rRef, Degree100 nAngle)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual OUString GetSdrDragComment() const override
virtual const tools::Rectangle & GetLastBoundRect() const
void setAddToTransparent(bool bNew)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual void createSdrDragEntries() override
SdrHdl * GetHdl(size_t nNum) const
bool ImpCheckSide(const Point &rPnt) const
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
void SetActionRect(const tools::Rectangle &rR)
virtual bool EndSdrDrag(bool bCopy) override
virtual bool EndSdrDrag(bool bCopy) override
void createSdrDragEntries_GlueDrag()
SdrHdlKind GetDragHdlKind() const
sal_Int32 GetDenominator() const
basegfx::B2DPolyPolygon maOriginalPolyPolygon
SdrDragCrook(SdrDragView &rNewView)
virtual bool EndSdrDrag(bool bCopy) override
virtual OUString GetSdrDragComment() const override
virtual OUString GetSdrDragComment() const override
bool IsControl(sal_uInt16 nPos) const
short path to read the CONTROL flag directly (TODO: better explain what the sense behind this flag is...
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
virtual void createSdrDragEntryForSdrObject(const SdrObject &rOriginal)
virtual PointerStyle GetSdrDragPointer() const override
const SdrObject & maOriginal
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
virtual OUString GetSdrDragComment() const override
double CrookSlantXPoint(Point &rPnt, Point *pC1, Point *pC2, const Point &rCenter, const Point &rRad, double &rSin, double &rCos, bool bVert)
const SfxItemSet & GetMergedItemSet() const
virtual basegfx::B2DHomMatrix getCurrentTransformation() const
SdrDragDistort(SdrDragView &rNewView)
SdrPaintWindow & GetPaintWindow() const
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
SdrDragObjOwn(SdrDragView &rNewView)
#define DRAG_CROOK_RASTER_MINIMUM
void MoveMarkedPoints(const Size &rSiz)
std::vector< basegfx::B2DPoint > maPositions
B2DPoint distort(const B2DPoint &rCandidate, const B2DRange &rOriginal, const B2DPoint &rTopLeft, const B2DPoint &rTopRight, const B2DPoint &rBottomLeft, const B2DPoint &rBottomRight)
virtual PointerStyle GetSdrDragPointer() const override
sal_Int32 GetNumerator() const
void createSdrDragEntries_PointDrag()
void AddUndoActions(std::vector< std::unique_ptr< SdrUndoAction > >)
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
SdrObject * GetDragObj() const
static size_t GetDragXorPolyLimit()
virtual SdrObjectUniquePtr getFullDragClone() const
const Point & GetNow() const
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const
basegfx::B2DRange getBaseRange() const
static BitmapEx createGluePointBitmap()
void translate(double fX, double fY)
drawinglayer::primitive2d::Primitive2DContainer maPrimitive2DSequence
bool IsCrookAllowed(bool bNoContortion=false) const
void SetMoveFirstHandle(bool bNew)
const basegfx::B2DPolyPolygon & GetPathPoly() const
basegfx::BColor getBColor() const
virtual void Rotate(const Point &rRef, Degree100 nAngle, double sn, double cs)
ImpGetDescriptionOptions
options for ImpGetDescriptionString()
drawinglayer::primitive2d::Primitive2DContainer AddConnectorOverlays()
SdrPageView * GetSdrPageView() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
bool bNoContortionAllowed
const SdrObject & getOriginal() const
virtual bool applySpecialDrag(SdrDragStat &rDrag)
Degree100 NormAngle18000(Degree100 a)
virtual void MoveSdrDrag(const Point &rPnt) override
void RotateXPoly(XPolygon &rPoly, const Point &rRef, double sn, double cs)
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
virtual bool BeginSdrDrag() override
const SfxItemPool & GetItemPool() const
void destroyOverlayGeometry()
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
virtual bool EndSdrDrag(bool bCopy) override
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const override
virtual ~SdrDragEntrySdrObject() override
virtual PointerStyle GetSdrDragPointer() const override
virtual void createSdrDragEntries() override
virtual ~SdrDragEntryPolyPolygon() override
static OUString GetPercentString(const Fraction &rVal)
SdrMark * GetSdrMarkByIndex(size_t nNum) const
virtual PointerStyle GetSdrDragPointer() const override
void RotateMarkedGluePoints(const Point &rRef, Degree100 nAngle, bool bCopy)
virtual bool BeginSdrDrag() override
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
Primitive2DReference createPolygonLinePrimitive(const basegfx::B2DPolygon &rPolygon, const attribute::SdrLineAttribute &rLine, const attribute::SdrLineStartEndAttribute &rStroke)
bool isHitLogic(const basegfx::B2DPoint &rLogicPosition, double fLogicTolerance=0.0) const
virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix &rMatrix, basegfx::B2DPolyPolygon &rPolyPolygon) const
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
virtual bool BeginSdrDrag() override
sal_uInt16 GetPointCount() const
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
void reserve(sal_uInt32 nCount)
virtual ~SdrDragEntryPrimitive2DSequence() override
virtual void SetChanged()
virtual OUString GetSdrDragComment() const override
virtual OUString GetSdrDragComment() const override
SdrPageView * GetDragPV() const
virtual bool BeginSdrDrag() override
sal_uInt16 GetTransparentSelectionPercent()
bool IsMoveOnlyDragging() const
void OrthoDistance4(const Point &rPt0, Point &rPt, bool bBigOrtho)
SdrModel * GetModel() const
void SetMoveSingleHandle(bool bNew)
SdrObjUserCall * GetUserCall() const
#define DRAG_CROOK_RASTER_MAXIMUM
bool IsDraggingPoints() const
OutputDevice & GetOutputDevice() const
void MoveMarkedGluePoints(const Size &rSiz, bool bCopy)
void MovAllPoints(basegfx::B2DPolyPolygon &rTarget)
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
void insertNewlyCreatedOverlayObjectForSdrDragMethod(std::unique_ptr< sdr::overlay::OverlayObject > pOverlayObject, const sdr::contact::ObjectContact &rObjectContact, sdr::overlay::OverlayManager &rOverlayManager)
sal_uInt16 GetAngleSector(Degree100 nAngle)
Normalize angle to 0.00..359.99.
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
virtual bool EndSdrDrag(bool bCopy) override
SdrDragMovHdl(SdrDragView &rNewView)
SdrHdlKind GetKind() const
bool IsDistortAllowed(bool bNoContortion=false) const
Utility class SdrEdgeObj.
const SdrHdlList & GetHdlList() const
bool m_bDetectedRangeSegmentation false
bool IsMoveSingleHandle() const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void MoveMarkedObj(const Size &rSiz, bool bCopy=false)
sal_uInt32 PageWindowCount() const
virtual PointerStyle GetSdrDragPointer() const override
bool IsEndDragChangesAttributes() const