35 #include <svx/strings.hrc>
73 : mbAddToTransparent(false)
84 maOriginalPolyPolygon(rOriginalPolyPolygon)
185 maPrimitive2DSequence(rSequence)
207 : maPositions(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));
330 std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject,
341 rOverlayManager.
add(*pOverlayObject);
348 if(!rNewRange.isEmpty())
355 pOverlayObject->setOffset(aOffset);
372 for(
size_t a = 0;
a < nMarkCount; ++
a)
393 bool bAddWireframe(bSuppressFullDrag);
398 bAddWireframe =
true;
401 if(!bSuppressFullDrag)
428 sal_uInt32 nPointCount(0);
430 for(
size_t a = 0; !bNoPolygons &&
a < nMarkCount; ++
a)
438 for(
auto const& rPolygon : aNewPolyPolygon)
440 nPointCount += rPolygon.
count();
450 aResult.
append(aNewPolyPolygon);
473 std::vector< basegfx::B2DPoint > aPositions;
475 for(
size_t nm = 0; nm < nMarkCount; ++nm)
494 for(
const sal_uInt16 nObjPt : rPts)
496 sal_uInt32 nPolyNum, nPointNum;
509 if(!aPositions.empty())
518 std::vector< basegfx::B2DPoint > aPositions;
520 for(
size_t nm = 0; nm < nMarkCount; ++nm)
535 for(
const sal_uInt16 nObjPt : rPts)
541 const Point aPoint((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
542 aPositions.emplace_back(aPoint.X(), aPoint.Y());
550 if(!aPositions.empty())
613 -aPolyRange.getMinX(),
614 -aPolyRange.getMinY()));
615 aPolyTransform.
scale(fScaleX, fScaleY);
618 aObjectPolyPolygon.
transform(aPolyTransform);
631 : maSdrDragEntries(),
632 maOverlayObjectList(),
633 mrSdrDragView(rNewView),
635 mbSolidDraggingActive(getSdrDragView().IsSolidDragging()),
636 mbShiftPressed(false)
697 std::vector< SdrEdgeObj* > aEdges;
705 if(pSdrDragEntrySdrObject)
713 aEdges.push_back(pSdrEdgeObj);
716 if(pSdrDragEntrySdrObject->
getClone())
718 aOriginalAndClones[&pSdrDragEntrySdrObject->
getOriginal()] = pSdrDragEntrySdrObject->
getClone();
730 SdrObjectAndCloneMap::iterator aEntry = aOriginalAndClones.find(pConnectedTo);
732 if(aEntry != aOriginalAndClones.end())
742 SdrObjectAndCloneMap::iterator aEntry = aOriginalAndClones.find(pConnectedTo);
744 if(aEntry != aOriginalAndClones.end())
755 for(
auto & pCandidate: maSdrDragEntries)
759 if(!aCandidateResult.empty())
761 if(pCandidate->getAddToTransparent())
763 aResultTransparent.
append(aCandidateResult);
767 aResult.
append(aCandidateResult);
776 if(!aConnectorOverlays.empty())
779 aResultTransparent.
append(aConnectorOverlays);
785 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
790 std::move(pNewOverlayObject),
795 if(!aResultTransparent.empty())
800 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
802 aResultTransparent));
805 std::move(pNewOverlayObject),
820 std::unique_ptr<sdr::overlay::OverlayRollingRectangleStriped> pNew(
854 dynamic_cast<const SdrDragMove*
>(
this) !=
nullptr || dynamic_cast<const SdrDragResize*>(
this) !=
nullptr ||
855 dynamic_cast<const SdrDragRotate*
>(
this) !=
nullptr || dynamic_cast<const SdrDragMirror*>(
this) != nullptr ))
861 if( dynamic_cast< const SdrDragObjOwn* >(
this) !=
nullptr ||
dynamic_cast< const SdrDragMovHdl*
>(
this) !=
nullptr )
887 if(aEdgePolygon.
count())
894 if(bUseSolidDragging)
899 bUseSolidDragging =
false;
903 if(bUseSolidDragging)
937 aEdgePolygon, aColA, aColB, fStripeLength));
938 aRetval.push_back(aPolyPolygonMarkerPrimitive2D);
980 if (pH1==
nullptr || pH2==
nullptr)
982 OSL_FAIL(
"SdrDragMovHdl::BeginSdrDrag(): Moving the axis of reflection: reference handles not found.");
999 Point aPnt(rNoSnapPnt);
1009 if (pH1==
nullptr || pH2==
nullptr)
1016 bool bXSnapped=
false;
1017 bool bYSnapped=
false;
1021 aPnt.AdjustX(nBestXSnap );
1022 aPnt.AdjustY(nBestYSnap );
1073 nNewAngle+=nSA/2_deg100;
1083 if (nSA==9000_deg100)
1085 if (nNewAngle==0_deg100 || nNewAngle==18000_deg100) aPnt.setY(aRef.Y() );
1086 if (nNewAngle==9000_deg100 || nNewAngle==27000_deg100) aPnt.setX(aRef.X() );
1089 if (nSA==4500_deg100)
1159 return PointerStyle::RefHand;
1185 bool bAddWireframe(
true);
1196 bAddWireframe =
false;
1206 bAddWireframe =
true;
1213 aDragPolyPolygon =
mxClone->TakeXorPoly();
1219 if(aSpecialDragPolyPolygon.count())
1221 aDragPolyPolygon.
append(aSpecialDragPolyPolygon);
1224 if(aDragPolyPolygon.
count())
1281 Point aPnt(rNoSnapPnt);
1298 else if (
DragStat().IsOrtho4Possible())
1304 if (!
DragStat().CheckMinMoved(rNoSnapPnt))
1332 if (bOldAutoGrowWidth != bNewAutoGrowWidth)
1343 std::vector< std::unique_ptr<SdrUndoAction> > vConnectorUndoActions;
1349 std::unique_ptr<SdrUndoAction> pUndo;
1350 std::unique_ptr<SdrUndoAction> pUndo2;
1362 if (
DragStat().IsEndDragChangesGeoAndAttributes())
1399 if (
DragStat().IsEndDragChangesLayout())
1444 return PointerStyle::Move;
1453 std::unique_ptr<SdrDragEntry>(
1487 aStr +=
SvxResId(STR_EditWithCopy);
1551 Point aNoSnapPnt(rNoSnapPnt_);
1555 Point aLO(aSR.
TopLeft()); aLO.AdjustX(nMovedx ); aLO.AdjustY(nMovedy );
1556 Point aRU(aSR.
BottomRight()); aRU.AdjustX(nMovedx ); aRU.AdjustY(nMovedy );
1557 Point aLU(aLO.X(),aRU.Y());
1558 Point aRO(aRU.X(),aLO.Y());
1574 if (!
DragStat().CheckMinMoved(aNoSnapPnt))
1579 bool bWorkArea=!aLR.
IsEmpty();
1582 if (bDragLimit || bWorkArea)
1599 aSR2.
Move(aD.X(),0);
1603 aPt1.AdjustX( -(aSR2.
Left()-aLR.
Left()) );
1615 aSR2.
Move(0,aD.Y());
1617 if (aSR2.
Top()<aLR.
Top())
1619 aPt1.AdjustY( -(aSR2.
Top()-aLR.
Top()) );
1636 for (
size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1647 for (sal_uInt16
nId : rPts)
1653 Point aPt((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
1655 if (aPt.X()<aBound.Left() ) aPt1.AdjustX( -(aPt.X()-aBound.Left()) ) ;
1656 if (aPt.X()>aBound.Right() ) aPt1.AdjustX( -(aPt.X()-aBound.Right()) ) ;
1657 if (aPt.Y()<aBound.Top() ) aPt1.AdjustY( -(aPt.Y()-aBound.Top()) ) ;
1658 if (aPt.Y()>aBound.Bottom()) aPt1.AdjustY( -(aPt.Y()-aBound.Bottom()) );
1708 return PointerStyle::MovePoint;
1712 return PointerStyle::Move;
1730 sal_Int32 nXDiv(aStart.X() - aRef.X());
1735 sal_Int32 nYDiv(aStart.Y() - aRef.Y());
1740 bool bX(
aXFact != aFact1 && std::abs(nXDiv) > 1);
1741 bool bY(
aYFact != aFact1 && std::abs(nYDiv) > 1);
1768 aStr +=
SvxResId(STR_EditWithCopy);
1802 if (pRef1!=
nullptr && pRef2!=
nullptr)
1834 bool bWorkArea=!aLR.
IsEmpty();
1837 if (bDragLimit || bWorkArea)
1851 if (aPnt.X()<aLR.
Left())
1853 else if (aPnt.X()>aLR.
Right())
1854 aPnt.setX(aLR.
Right() );
1856 if (aPnt.Y()<aLR.
Top())
1857 aPnt.setY(aLR.
Top() );
1858 else if (aPnt.Y()>aLR.
Bottom())
1859 aPnt.setY(aLR.
Bottom() );
1861 if (aRef.X()>aSR.
Left())
1869 if (aRef.X()<aSR.
Right())
1877 if (aRef.Y()>aSR.
Top())
1885 if (aRef.Y()<aSR.
Bottom())
1894 tools::Long nXDiv=aStart.X()-aRef.X();
if (nXDiv==0) nXDiv=1;
1895 tools::Long nYDiv=aStart.Y()-aRef.Y();
if (nYDiv==0) nYDiv=1;
1911 bool bXNeg=nXMul<0;
if (bXNeg) nXMul=-nXMul;
1912 bool bYNeg=nYMul<0;
if (bYNeg) nYMul=-nYMul;
1917 if (std::abs(nXDiv)<=1 || std::abs(nYDiv)<=1)
1975 if (aNewXFact>aMaxFact)
1981 if (aNewYFact>aMaxFact)
2042 return PointerStyle::Move;
2069 nTmpAngle -= 36000_deg100;
2075 aStr +=
SvxResId(STR_EditWithCopy);
2103 OSL_FAIL(
"SdrDragRotate::BeginSdrDrag(): No reference point handle found.");
2117 if (!
DragStat().CheckMinMoved(aPnt))
2131 nNewAngle += nSA / 2_deg100;
2144 if (nSekt0==0 && nSekt1==3)
2147 if (nSekt0==3 && nSekt1==0)
2152 double nSin1=sin(a);
2153 double nCos1=cos(a);
2185 return PointerStyle::Rotate;
2210 nTmpAngle += 18000_deg100;
2217 aStr +=
SvxResId(STR_EditWithCopy);
2238 if (pRefHdl!=
nullptr)
2245 OSL_FAIL(
"SdrDragShear::BeginSdrDrag(): No reference point handle for shearing found.");
2279 if (!
DragStat().CheckMinMoved(rPnt))
2293 if (nSA==0_deg100 && !
bSlant)
2299 aPnt.setX(aP0.X() );
2301 aPnt.setY(aP0.Y() );
2305 Point aDif(aPnt-aRef);
2323 if (nNewAngle<
Degree100(-9000) || nNewAngle>9000_deg100)
2335 aNewFract=
Fraction(aPt2.X()-aRef.X(),aP0.X()-aRef.X());
2339 aNewFract=
Fraction(aPt2.Y()-aRef.Y(),aP0.Y()-aRef.Y());
2344 bool bNeg=nNewAngle<0_deg100;
2347 nNewAngle=-nNewAngle;
2351 nNewAngle += nSA / 2_deg100;
2357 bUpSideDown=nNewAngle>9000_deg100 && nNewAngle<27000_deg100;
2364 if (bNeg) nTmpAngle=-nTmpAngle;
2370 if (nNewAngle > 8900_deg100)
2371 nNewAngle = 8900_deg100;
2374 nNewAngle=-nNewAngle;
2381 double nTan1=tan(a);
2423 aStr +=
SvxResId(STR_EditWithCopy);
2459 return PointerStyle::VShear;
2461 return PointerStyle::HShear;
2487 return nAngle1<18000_deg100;
2495 else if (
aDif.Y()==0)
2497 else if (std::abs(
aDif.X()) == std::abs(
aDif.Y()))
2512 if (pH1!=
nullptr && pH2!=
nullptr)
2519 bool b90=(
aDif.X()==0) ||
aDif.Y()==0;
2520 bool b45=b90 || (std::abs(
aDif.X()) == std::abs(
aDif.Y()));
2535 OSL_FAIL(
"SdrDragMirror::BeginSdrDrag(): Axis of reflection not found.");
2548 const double fRotation(atan2(fDeltaY, fDeltaX));
2551 aRetval.
rotate(-fRotation);
2552 aRetval.
scale(1.0, -1.0);
2553 aRetval.
rotate(fRotation);
2562 if (!
DragStat().CheckMinMoved(rPnt))
2566 bool bNewMirrored=
bSide0!=bNewSide;
2591 return PointerStyle::Mirror;
2597 pIAOHandle(nullptr),
2612 bool bRetval(
false);
2646 if(!bHit && pColHdl)
2673 OSL_FAIL(
"SdrDragGradient::BeginSdrDrag(): IAOGradient not found.");
2749 return PointerStyle::RefHand;
2756 bContortionAllowed(false),
2757 bNoContortionAllowed(false),
2759 bResizeAllowed(false),
2761 bRotateAllowed(false),
2789 nVal = std::abs(nVal);
2794 aStr +=
SvxResId(STR_EditWithCopy);
2800 #define DRAG_CROOK_RASTER_MINIMUM (4)
2801 #define DRAG_CROOK_RASTER_MAXIMUM (15)
2802 #define DRAG_CROOK_RASTER_DISTANCE (30)
2825 const double fXLen(rMarkRect.
GetWidth() /
static_cast<double>(nHorDiv));
2826 const double fYLen(rMarkRect.
GetHeight() /
static_cast<double>(nVerDiv));
2827 double fYPos(rMarkRect.
Top());
2830 for(a = 0; a <= nVerDiv; a++)
2833 for(b = 0; b < nHorDiv; b++)
2837 const double fNewX(rMarkRect.
Left() + (b * fXLen));
2843 aRetval.
append(aHorLineSegment);
2850 double fXPos(rMarkRect.
Left());
2852 for(a = 0; a <= nHorDiv; a++)
2855 for(b = 0; b < nVerDiv; b++)
2859 const double fNewY(rMarkRect.
Top() + (b * fYLen));
2865 aRetval.
append(aVerLineSegment);
2883 if(aDragRaster.
count())
2928 sal_uInt16 nPolyCount=aTempPolyPoly.
Count();
2932 sal_uInt16 n1st=0,nLast=0;
2935 while (n1st<nPolyCount)
2938 while (nLast<nPolyCount && aTempPolyPoly[nLast].GetPointCount()!=0) nLast++;
2942 for (i=n1st+1; i<nLast; i++)
2944 aBound.
Union(aTempPolyPoly[n1st].GetBoundRect());
2965 double nSin=0,nCos=0;
2981 for (i=n1st; i<nLast; i++)
2988 aTempPolyPoly[i].Move(aCtr1.X(),aCtr1.Y());
2998 for (j=0; j<nPolyCount; j++)
3004 while (i<nPointCount)
3006 Point* pPnt=&aPol[i];
3010 if (i+1<nPointCount && aPol.
IsControl(i))
3037 bool bC1=pC1!=
nullptr;
3038 bool bC2=pC2!=
nullptr;
3082 if (!
DragStat().CheckMinMoved(rPnt))
3098 aNewCenter.setX(
aStart.X() );
3128 bValid = std::abs(dx1)*100>std::abs(dy1);
3130 bValid = std::abs(dy1)*100>std::abs(dx1);
3143 a=
static_cast<double>(dy1)/static_cast<double>(dx1);
3145 aNewCenter.AdjustX(nNewRad );
3146 nPntAngle=
GetAngle(aPnt-aNewCenter);
3150 a=
static_cast<double>(dx1)/static_cast<double>(dy1);
3152 aNewCenter.AdjustY(nNewRad );
3153 nPntAngle=
GetAngle(aPnt-aNewCenter)-9000_deg100;
3160 if (
bRgt) nPntAngle += 18000_deg100;
3161 if (
bLft) nPntAngle = 18000_deg100 - nPntAngle;
3162 if (
bLwr) nPntAngle =- nPntAngle;
3166 if (
bRgt) nPntAngle = -nPntAngle;
3167 if (
bUpr) nPntAngle = 18000_deg100 - nPntAngle;
3168 if (
bLwr) nPntAngle += 18000_deg100;
3175 if (nNewRad<0) nPntAngle += 18000_deg100;
3176 if (
bVertical) nPntAngle = 18000_deg100 - nPntAngle;
3178 nPntAngle =
abs(nPntAngle);
3181 double nCircumference = 2 * std::abs(nNewRad) * M_PI;
3202 if (
nAngle==0_deg100 || nNewRad==0)
3220 nMul = std::abs(nMul);
3248 if (!(bDoCrook || bDoResize))
3280 Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
3319 aStr +=
SvxResId(STR_EditWithCopy);
3342 for (
size_t nm=0; nm<nMarkCount; ++nm)
3354 Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
3380 return PointerStyle::Crook;
3387 bContortionAllowed(false),
3388 bNoContortionAllowed(false),
3403 aStr +=
SvxResId(STR_EditWithCopy);
3414 if(aDragRaster.
count())
3467 aDragPolygon =
basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
3468 rTarget = aDragPolygon;
3474 if (!
DragStat().CheckMinMoved(rPnt))
3510 return PointerStyle::RefHand;
3548 aStr +=
SvxResId(STR_EditWithCopy);
3591 bool bExternal(
false);
3596 if (
nullptr != pSdrObject && dynamic_cast< const SdrGrafObj* >(pSdrObject) ==
nullptr)
3605 if(dynamic_cast< SdrGrafObj* >(pFullDragClone.get()))
3608 pExternalSdrObject = pSdrObject;
3609 pSdrObject = pFullDragClone.get();
3622 const bool bUndo(!bExternal &&
getSdrDragView().IsUndoEnabled());
3637 bool bShearCorrected(
false);
3645 bShearCorrected =
true;
3657 bool bOnAxis(
false);
3683 aLocalCurrent.
setX(aLocalStart.
getX());
3687 aLocalCurrent.
setY(aLocalStart.
getY());
3696 if(aLocalStart.
getX() < 0.5)
3698 aDiscreteChangeMatrix.
scale(aLocalCurrent.
getX(), 1.0);
3702 aDiscreteChangeMatrix.
scale(1.0 - aLocalCurrent.
getX(), 1.0);
3709 if(aLocalStart.
getY() < 0.5)
3711 aDiscreteChangeMatrix.
scale(1.0, aLocalCurrent.
getY());
3715 aDiscreteChangeMatrix.
scale(1.0, 1.0 - aLocalCurrent.
getY());
3735 aRangeOriginalNoShearNoRotate.
transform(aOriginalMatrixNoShearNoRotate);
3736 aRangeNewNoShearNoRotate.
transform(aOriginalMatrixNoShearNoRotate * aDiscreteChangeMatrix);
3744 const double fScaleX(aRangeNewNoShearNoRotate.
getWidth() / aRangeOriginalNoShearNoRotate.
getWidth());
3745 const double fScaleY(aRangeNewNoShearNoRotate.
getHeight() / aRangeOriginalNoShearNoRotate.
getHeight());
3747 pExternalSdrObject->
Crop(
3804 Size aGraphicSize(rGraphicObject.GetPrefSize());
3806 if(MapUnit::MapPixel == rGraphicObject.GetPrefMapMode().GetMapUnit())
3815 if(0 == aGraphicSize.Width() || 0 == aGraphicSize.Height())
3821 double fScaleX = ( aGraphicSize.Width() - rOldCrop.GetLeft() - rOldCrop.GetRight() ) / static_cast<double>(aOldRect.
GetWidth());
3822 double fScaleY = ( aGraphicSize.Height() - rOldCrop.GetTop() - rOldCrop.GetBottom() ) / static_cast<double>(aOldRect.
GetHeight());
3824 sal_Int32 nDiffLeft = aNewRect.
Left() - aOldRect.
Left();
3825 sal_Int32 nDiffTop = aNewRect.
Top() - aOldRect.
Top();
3826 sal_Int32 nDiffRight = aNewRect.
Right() - aOldRect.
Right();
3827 sal_Int32 nDiffBottom = aNewRect.
Bottom() - aOldRect.
Bottom();
3833 sal_Int32 nTmp(nDiffLeft);
3834 nDiffLeft = -nDiffRight;
3838 sal_Int32 nLeftCrop =
static_cast<sal_Int32
>( rOldCrop.GetLeft() + nDiffLeft * fScaleX );
3839 sal_Int32 nTopCrop =
static_cast<sal_Int32
>( rOldCrop.GetTop() + nDiffTop * fScaleY );
3840 sal_Int32 nRightCrop =
static_cast<sal_Int32
>( rOldCrop.GetRight() - nDiffRight * fScaleX );
3841 sal_Int32 nBottomCrop =
static_cast<sal_Int32
>( rOldCrop.GetBottom() - nDiffBottom * fScaleY );
3845 aSet.Put( SdrGrafCropItem( nLeftCrop, nTopCrop, nRightCrop, nBottomCrop ) );
3859 return PointerStyle::Crop;
Color GetStripeColorA() const
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
virtual void MoveSdrDrag(const Point &rPnt) override
virtual bool EndSdrDrag(bool bCopy) override
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
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
SdrDragEntryPointGlueDrag(const std::vector< basegfx::B2DPoint > &rPositions, bool bIsPointDrag)
bool IsResizeAllowed(bool bProp=false) const
virtual OUString getSpecialDragComment(const SdrDragStat &rDrag) const
const SdrUShortCont & GetMarkedPoints() const
sal_uInt16 GetTransparentSelectionPercent() 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
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
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)
virtual basegfx::B2DHomMatrix getCurrentTransformation() override
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
std::vector< std::unique_ptr< SdrUndoAction > > CreateConnectorUndo(SdrObject &rO)
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
void EndTextEditAllViews() const
Checks if this or other views have an active text edit, if true, end them.
SdrDragCrop(SdrDragView &rNewView)
Color GetStripeColorB() const
bool IsDraggingGluePoints() const
virtual void MoveSdrDrag(const Point &rPnt) override
virtual bool EndSdrDrag(bool bCopy) override
GraphicType GetGraphicType() const
EmbeddedObjectRef * pObject
virtual void MoveSdrDrag(const Point &rPnt) override
basegfx::B2DPolygon ImplAddConnectorOverlay(SdrDragMethod &rDragMethod, bool bTail1, bool bTail2, bool bDetail) const
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
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
virtual basegfx::B2DHomMatrix getCurrentTransformation()
void addSdrDragEntry(std::unique_ptr< SdrDragEntry > pNew)
OUString SvxResId(const char *pId)
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)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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)
Point GetSnapPos(const Point &rPt) const
tools::Rectangle aMarkRect
attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet &rSet)
bool IsMoveFirstHandle() const
bool GetHighContrastMode() 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)
Degree100 NormAngle36000(Degree100 deg100)
Normalize angle to -180.00..179.99.
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
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 SetRef1(const Point &pt)
bool HasMarkedObjPageView() const
void ResizeMarkedObj(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bCopy=false)
SdrDragMirror(SdrDragView &rNewView)
#define SDRGLUEPOINT_NOTFOUND
virtual void MoveSdrDrag(const Point &rPnt) override
SdrSnap SnapPos(Point &rPt) const
void rotate(double fRadiant)
virtual OUString GetSdrDragComment() const override
const B2DPolyPolygon maOriginal
virtual basegfx::B2DHomMatrix getCurrentTransformation() override
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)
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)
virtual void append(const Primitive2DReference &) override
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
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)
void CheckSnap(const Point &rPt, tools::Long &nBestXSnap, tools::Long &nBestYSnap, bool &bXSnapped, bool &bYSnapped) const
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)
Point PixelToLogic(const Point &rDevicePt) const
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)
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)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
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
virtual basegfx::B2DHomMatrix getCurrentTransformation() override
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...
OUString ImpGetDescriptionString(const char *pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
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() override
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
Degree100 abs(Degree100 x)
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
sal_uInt16 GetStripeLength() 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
SdrDragEntryPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DContainer &rSequence)
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
OUString ImpGetDescriptionStr(const char *pStrCacheID) const
virtual bool BeginSdrDrag() override
virtual basegfx::B2DHomMatrix getCurrentTransformation() override
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 IsMoveSingleHandle() const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
Color getHilightColor() const
void MoveMarkedObj(const Size &rSiz, bool bCopy=false)
sal_uInt32 PageWindowCount() const
virtual PointerStyle GetSdrDragPointer() const override
bool IsEndDragChangesAttributes() const