38 #include <svx/strings.hrc>
80 : mbAddToTransparent(false)
91 maOriginalPolyPolygon(rOriginalPolyPolygon)
192 maPrimitive2DSequence(rSequence)
214 : maPositions(rPositions),
215 mbIsPointDrag(bIsPointDrag)
243 std::vector< basegfx::B2DPoint > aTransformedPositions;
245 aTransformedPositions.
reserve(aTransformed.count());
247 for(sal_uInt32
a = 0;
a < aTransformed.count();
a++)
249 aTransformedPositions.push_back(aTransformed.getB2DPoint(
a));
337 std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject,
348 rOverlayManager.
add(*pOverlayObject);
355 if(!rNewRange.isEmpty())
362 pOverlayObject->setOffset(aOffset);
378 for(
size_t a = 0;
a < nMarkCount; ++
a)
399 bool bAddWireframe(bSuppressFullDrag);
404 bAddWireframe =
true;
407 if(!bSuppressFullDrag)
435 sal_uInt32 nPointCount(0);
437 for(
size_t a = 0; !bNoPolygons &&
a < nMarkCount; ++
a)
445 for(
auto const& rPolygon : aNewPolyPolygon)
447 nPointCount += rPolygon.
count();
457 aResult.
append(aNewPolyPolygon);
480 std::vector< basegfx::B2DPoint > aPositions;
482 for(
size_t nm = 0; nm < nMarkCount; ++nm)
501 for(
const sal_uInt16 nObjPt : rPts)
503 sal_uInt32 nPolyNum, nPointNum;
516 if(!aPositions.empty())
525 std::vector< basegfx::B2DPoint > aPositions;
527 for(
size_t nm = 0; nm < nMarkCount; ++nm)
542 for(
const sal_uInt16 nObjPt : rPts)
548 const Point aPoint((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
549 aPositions.emplace_back(aPoint.
X(), aPoint.
Y());
557 if(!aPositions.empty())
620 -aPolyRange.getMinX(),
621 -aPolyRange.getMinY()));
622 aPolyTransform.
scale(fScaleX, fScaleY);
625 aObjectPolyPolygon.
transform(aPolyTransform);
638 : maSdrDragEntries(),
639 maOverlayObjectList(),
640 mrSdrDragView(rNewView),
642 mbSolidDraggingActive(getSdrDragView().IsSolidDragging()),
643 mbShiftPressed(false)
700 std::vector< SdrEdgeObj* > aEdges;
708 if(pSdrDragEntrySdrObject)
716 aEdges.push_back(pSdrEdgeObj);
719 if(pSdrDragEntrySdrObject->
getClone())
721 aOriginalAndClones[&pSdrDragEntrySdrObject->
getOriginal()] = pSdrDragEntrySdrObject->
getClone();
733 SdrObjectAndCloneMap::iterator aEntry = aOriginalAndClones.find(pConnectedTo);
735 if(aEntry != aOriginalAndClones.end())
745 SdrObjectAndCloneMap::iterator aEntry = aOriginalAndClones.find(pConnectedTo);
747 if(aEntry != aOriginalAndClones.end())
758 for(
auto & pCandidate: maSdrDragEntries)
762 if(!aCandidateResult.empty())
764 if(pCandidate->getAddToTransparent())
766 aResultTransparent.
append(aCandidateResult);
770 aResult.
append(aCandidateResult);
779 if(!aConnectorOverlays.empty())
782 aResultTransparent.
append(aConnectorOverlays);
788 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
793 std::move(pNewOverlayObject),
798 if(!aResultTransparent.empty())
803 std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(
805 aResultTransparent));
808 std::move(pNewOverlayObject),
822 std::unique_ptr<sdr::overlay::OverlayRollingRectangleStriped> pNew(
857 dynamic_cast<const SdrDragMove*
>(
this) !=
nullptr || dynamic_cast<const SdrDragResize*>(
this) !=
nullptr ||
858 dynamic_cast<const SdrDragRotate*
>(
this) !=
nullptr || dynamic_cast<const SdrDragMirror*>(
this) != nullptr ))
864 if( dynamic_cast< const SdrDragObjOwn* >(
this) !=
nullptr ||
dynamic_cast< const SdrDragMovHdl*
>(
this) !=
nullptr )
890 if(aEdgePolygon.
count())
897 if(bUseSolidDragging)
902 bUseSolidDragging =
false;
906 if(bUseSolidDragging)
940 aEdgePolygon, aColA, aColB, fStripeLength));
941 aRetval.push_back(aPolyPolygonMarkerPrimitive2D);
983 if (pH1==
nullptr || pH2==
nullptr)
985 OSL_FAIL(
"SdrDragMovHdl::BeginSdrDrag(): Moving the axis of reflection: reference handles not found.");
1002 Point aPnt(rNoSnapPnt);
1011 if (pH1==
nullptr || pH2==
nullptr)
1018 bool bXSnapped=
false;
1019 bool bYSnapped=
false;
1074 long nNewAngle=nAngle;
1087 if (nNewAngle==0 || nNewAngle==18000) aPnt.
setY(aRef.Y() );
1088 if (nNewAngle==9000 || nNewAngle==27000) aPnt.
setX(aRef.X() );
1162 return PointerStyle::RefHand;
1187 bool bAddWireframe(
true);
1198 bAddWireframe =
false;
1208 bAddWireframe =
true;
1215 aDragPolyPolygon =
mxClone->TakeXorPoly();
1221 if(aSpecialDragPolyPolygon.count())
1223 aDragPolyPolygon.
append(aSpecialDragPolyPolygon);
1226 if(aDragPolyPolygon.
count())
1284 Point aPnt(rNoSnapPnt);
1301 else if (
DragStat().IsOrtho4Possible())
1307 if (!
DragStat().CheckMinMoved(rNoSnapPnt))
1335 if (bOldAutoGrowWidth != bNewAutoGrowWidth)
1346 std::vector< std::unique_ptr<SdrUndoAction> > vConnectorUndoActions;
1352 std::unique_ptr<SdrUndoAction> pUndo;
1353 std::unique_ptr<SdrUndoAction> pUndo2;
1365 if (
DragStat().IsEndDragChangesGeoAndAttributes())
1402 if (
DragStat().IsEndDragChangesLayout())
1447 return PointerStyle::Move;
1456 std::unique_ptr<SdrDragEntry>(
1490 aStr +=
SvxResId(STR_EditWithCopy);
1554 Point aNoSnapPnt(rNoSnapPnt_);
1560 Point aLU(aLO.X(),aRU.Y());
1561 Point aRO(aRU.X(),aLO.Y());
1577 if (
DragStat().CheckMinMoved(aNoSnapPnt))
1581 bool bWorkArea=!aLR.
IsEmpty();
1584 if (bDragLimit || bWorkArea)
1601 aSR2.
Move(aD.
X(),0);
1617 aSR2.
Move(0,aD.
Y());
1619 if (aSR2.
Top()<aLR.
Top())
1638 for (
size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1649 for (sal_uInt16
nId : rPts)
1655 Point aPt((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
1657 if (aPt.
X()<aBound.Left() ) aPt1.
AdjustX( -(aPt.
X()-aBound.Left()) ) ;
1658 if (aPt.
X()>aBound.Right() ) aPt1.
AdjustX( -(aPt.
X()-aBound.Right()) ) ;
1659 if (aPt.
Y()<aBound.Top() ) aPt1.
AdjustY( -(aPt.
Y()-aBound.Top()) ) ;
1660 if (aPt.
Y()>aBound.Bottom()) aPt1.
AdjustY( -(aPt.
Y()-aBound.Bottom()) );
1711 return PointerStyle::MovePoint;
1715 return PointerStyle::Move;
1733 sal_Int32 nXDiv(aStart.
X() - aRef.
X());
1738 sal_Int32 nYDiv(aStart.
Y() - aRef.
Y());
1743 bool bX(
aXFact != aFact1 && std::abs(nXDiv) > 1);
1744 bool bY(
aYFact != aFact1 && std::abs(nYDiv) > 1);
1771 aStr +=
SvxResId(STR_EditWithCopy);
1805 if (pRef1!=
nullptr && pRef2!=
nullptr)
1837 bool bWorkArea=!aLR.
IsEmpty();
1840 if (bDragLimit || bWorkArea)
1854 if (aPnt.
X()<aLR.
Left())
1856 else if (aPnt.
X()>aLR.
Right())
1859 if (aPnt.
Y()<aLR.
Top())
1861 else if (aPnt.
Y()>aLR.
Bottom())
1864 if (aRef.
X()>aSR.
Left())
1872 if (aRef.
X()<aSR.
Right())
1880 if (aRef.
Y()>aSR.
Top())
1897 long nXDiv=aStart.
X()-aRef.
X();
if (nXDiv==0) nXDiv=1;
1898 long nYDiv=aStart.
Y()-aRef.
Y();
if (nYDiv==0) nYDiv=1;
1899 long nXMul=aPnt.
X()-aRef.
X();
1900 long nYMul=aPnt.
Y()-aRef.
Y();
1914 bool bXNeg=nXMul<0;
if (bXNeg) nXMul=-nXMul;
1915 bool bYNeg=nYMul<0;
if (bYNeg) nYMul=-nYMul;
1920 if (std::abs(nXDiv)<=1 || std::abs(nYDiv)<=1)
1978 if (aNewXFact>aMaxFact)
1984 if (aNewYFact>aMaxFact)
2045 return PointerStyle::Move;
2078 aStr +=
SvxResId(STR_EditWithCopy);
2106 OSL_FAIL(
"SdrDragRotate::BeginSdrDrag(): No reference point handle found.");
2120 if (
DragStat().CheckMinMoved(aPnt))
2145 if (nSekt0==0 && nSekt1==3)
2148 if (nSekt0==3 && nSekt1==0)
2153 double nSin1=sin(a);
2154 double nCos1=cos(a);
2188 return PointerStyle::Rotate;
2210 sal_Int32 nTmpAngle(
nAngle);
2220 aStr +=
SvxResId(STR_EditWithCopy);
2241 if (pRefHdl!=
nullptr)
2248 OSL_FAIL(
"SdrDragShear::BeginSdrDrag(): No reference point handle for shearing found.");
2282 if (!
DragStat().CheckMinMoved(rPnt))
2302 aPnt.
setX(aP0.
X() );
2304 aPnt.
setY(aP0.
Y() );
2308 Point aDif(aPnt-aRef);
2326 if (nNewAngle<-9000 || nNewAngle>9000)
2338 aNewFract=
Fraction(aPt2.
X()-aRef.
X(),aP0.
X()-aRef.
X());
2342 aNewFract=
Fraction(aPt2.
Y()-aRef.
Y(),aP0.
Y()-aRef.
Y());
2347 bool bNeg=nNewAngle<0;
2350 nNewAngle=-nNewAngle;
2365 long nTmpAngle=nNewAngle;
2367 if (bNeg) nTmpAngle=-nTmpAngle;
2377 nNewAngle=-nNewAngle;
2384 double nTan1=tan(a);
2426 aStr +=
SvxResId(STR_EditWithCopy);
2462 return PointerStyle::VShear;
2464 return PointerStyle::HShear;
2490 return nAngle1<18000;
2498 else if (
aDif.
Y()==0)
2500 else if (std::abs(
aDif.
X()) == std::abs(
aDif.
Y()))
2515 if (pH1!=
nullptr && pH2!=
nullptr)
2523 bool b45=b90 || (std::abs(
aDif.
X()) == std::abs(
aDif.
Y()));
2538 OSL_FAIL(
"SdrDragMirror::BeginSdrDrag(): Axis of reflection not found.");
2551 const double fRotation(atan2(fDeltaY, fDeltaX));
2554 aRetval.
rotate(-fRotation);
2555 aRetval.
scale(1.0, -1.0);
2556 aRetval.
rotate(fRotation);
2565 if (
DragStat().CheckMinMoved(rPnt))
2568 bool bNewMirrored=
bSide0!=bNewSide;
2594 return PointerStyle::Mirror;
2600 pIAOHandle(nullptr),
2615 bool bRetval(
false);
2649 if(!bHit && pColHdl)
2676 OSL_FAIL(
"SdrDragGradient::BeginSdrDrag(): IAOGradient not found.");
2752 return PointerStyle::RefHand;
2759 bContortionAllowed(false),
2760 bNoContortionAllowed(false),
2762 bResizeAllowed(false),
2764 bRotateAllowed(false),
2792 nVal = std::abs(nVal);
2797 aStr +=
SvxResId(STR_EditWithCopy);
2803 #define DRAG_CROOK_RASTER_MINIMUM (4)
2804 #define DRAG_CROOK_RASTER_MAXIMUM (15)
2805 #define DRAG_CROOK_RASTER_DISTANCE (30)
2828 const double fXLen(rMarkRect.
GetWidth() /
static_cast<double>(nHorDiv));
2829 const double fYLen(rMarkRect.
GetHeight() /
static_cast<double>(nVerDiv));
2830 double fYPos(rMarkRect.
Top());
2833 for(a = 0; a <= nVerDiv; a++)
2836 for(b = 0; b < nHorDiv; b++)
2840 const double fNewX(rMarkRect.
Left() + (b * fXLen));
2846 aRetval.
append(aHorLineSegment);
2853 double fXPos(rMarkRect.
Left());
2855 for(a = 0; a <= nHorDiv; a++)
2858 for(b = 0; b < nVerDiv; b++)
2862 const double fNewY(rMarkRect.
Top() + (b * fYLen));
2868 aRetval.
append(aVerLineSegment);
2886 if(aDragRaster.
count())
2930 sal_uInt16 nPolyCount=aTempPolyPoly.
Count();
2934 sal_uInt16 n1st=0,nLast=0;
2937 while (n1st<nPolyCount)
2940 while (nLast<nPolyCount && aTempPolyPoly[nLast].GetPointCount()!=0) nLast++;
2944 for (i=n1st+1; i<nLast; i++)
2946 aBound.
Union(aTempPolyPoly[n1st].GetBoundRect());
2967 double nSin=0,nCos=0;
2983 for (i=n1st; i<nLast; i++)
2990 aTempPolyPoly[i].Move(aCtr1.X(),aCtr1.Y());
3000 for (j=0; j<nPolyCount; j++)
3006 while (i<nPointCount)
3008 Point* pPnt=&aPol[i];
3012 if (i+1<nPointCount && aPol.
IsControl(i))
3040 bool bC1=pC1!=
nullptr;
3041 bool bC2=pC2!=
nullptr;
3085 if (!
DragStat().CheckMinMoved(rPnt))
3124 long dx1=aPnt.
X()-aNewCenter.X();
3125 long dy1=aPnt.
Y()-aNewCenter.Y();
3131 bValid = std::abs(dx1)*100>std::abs(dy1);
3133 bValid = std::abs(dy1)*100>std::abs(dx1);
3146 a=
static_cast<double>(dy1)/static_cast<double>(dx1);
3147 nNewRad=(
static_cast<long>(dy1*a)+dx1) /2;
3148 aNewCenter.AdjustX(nNewRad );
3149 nPntWink=
GetAngle(aPnt-aNewCenter);
3153 a=
static_cast<double>(dx1)/static_cast<double>(dy1);
3154 nNewRad=(
static_cast<long>(dx1*a)+dy1) /2;
3155 aNewCenter.AdjustY(nNewRad );
3156 nPntWink=
GetAngle(aPnt-aNewCenter)-9000;
3163 if (
bRgt) nPntWink+=18000;
3164 if (
bLft) nPntWink=18000-nPntWink;
3165 if (
bLwr) nPntWink=-nPntWink;
3169 if (
bRgt) nPntWink=-nPntWink;
3170 if (
bUpr) nPntWink=18000-nPntWink;
3171 if (
bLwr) nPntWink+=18000;
3178 if (nNewRad<0) nPntWink+=18000;
3181 nPntWink = std::abs(nPntWink);
3184 double nUmfang = 2 * std::abs(nNewRad) * M_PI;
3188 long nMul=
static_cast<long>(nUmfang*
NormAngle36000(nPntWink)/36000);
3205 if (
nAngle==0 || nNewRad==0)
3223 nMul = std::abs(nMul);
3251 if (bDoCrook || bDoResize)
3282 Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
3322 aStr +=
SvxResId(STR_EditWithCopy);
3345 for (
size_t nm=0; nm<nMarkCount; ++nm)
3357 Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
3383 return PointerStyle::Crook;
3390 bContortionAllowed(false),
3391 bNoContortionAllowed(false),
3406 aStr +=
SvxResId(STR_EditWithCopy);
3417 if(aDragRaster.
count())
3469 aDragPolygon =
basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
3470 rTarget = aDragPolygon;
3477 if (
DragStat().CheckMinMoved(rPnt))
3513 return PointerStyle::RefHand;
3551 aStr +=
SvxResId(STR_EditWithCopy);
3594 bool bExternal(
false);
3599 if (
nullptr != pSdrObject && dynamic_cast< const SdrGrafObj* >(pSdrObject) ==
nullptr)
3608 if(dynamic_cast< SdrGrafObj* >(pFullDragClone.get()))
3611 pExternalSdrObject = pSdrObject;
3612 pSdrObject = pFullDragClone.get();
3625 const bool bUndo(!bExternal &&
getSdrDragView().IsUndoEnabled());
3640 bool bShearCorrected(
false);
3648 bShearCorrected =
true;
3660 bool bOnAxis(
false);
3686 aLocalCurrent.
setX(aLocalStart.
getX());
3690 aLocalCurrent.
setY(aLocalStart.
getY());
3699 if(aLocalStart.
getX() < 0.5)
3701 aDiscreteChangeMatrix.
scale(aLocalCurrent.
getX(), 1.0);
3705 aDiscreteChangeMatrix.
scale(1.0 - aLocalCurrent.
getX(), 1.0);
3712 if(aLocalStart.
getY() < 0.5)
3714 aDiscreteChangeMatrix.
scale(1.0, aLocalCurrent.
getY());
3718 aDiscreteChangeMatrix.
scale(1.0, 1.0 - aLocalCurrent.
getY());
3738 aRangeOriginalNoShearNoRotate.
transform(aOriginalMatrixNoShearNoRotate);
3739 aRangeNewNoShearNoRotate.
transform(aOriginalMatrixNoShearNoRotate * aDiscreteChangeMatrix);
3747 const double fScaleX(aRangeNewNoShearNoRotate.
getWidth() / aRangeOriginalNoShearNoRotate.
getWidth());
3748 const double fScaleY(aRangeNewNoShearNoRotate.
getHeight() / aRangeOriginalNoShearNoRotate.
getHeight());
3750 pExternalSdrObject->
Crop(
3807 Size aGraphicSize(rGraphicObject.GetPrefSize());
3809 if(MapUnit::MapPixel == rGraphicObject.GetPrefMapMode().GetMapUnit())
3818 if(0 == aGraphicSize.Width() || 0 == aGraphicSize.Height())
3824 double fScaleX = ( aGraphicSize.Width() - rOldCrop.
GetLeft() - rOldCrop.
GetRight() ) / static_cast<double>(aOldRect.
GetWidth());
3825 double fScaleY = ( aGraphicSize.Height() - rOldCrop.
GetTop() - rOldCrop.
GetBottom() ) / static_cast<double>(aOldRect.
GetHeight());
3827 sal_Int32 nDiffLeft = aNewRect.
Left() - aOldRect.
Left();
3828 sal_Int32 nDiffTop = aNewRect.
Top() - aOldRect.
Top();
3829 sal_Int32 nDiffRight = aNewRect.
Right() - aOldRect.
Right();
3830 sal_Int32 nDiffBottom = aNewRect.
Bottom() - aOldRect.
Bottom();
3836 sal_Int32 nTmp(nDiffLeft);
3837 nDiffLeft = -nDiffRight;
3841 sal_Int32 nLeftCrop =
static_cast<sal_Int32
>( rOldCrop.
GetLeft() + nDiffLeft * fScaleX );
3842 sal_Int32 nTopCrop =
static_cast<sal_Int32
>( rOldCrop.
GetTop() + nDiffTop * fScaleY );
3843 sal_Int32 nRightCrop =
static_cast<sal_Int32
>( rOldCrop.
GetRight() - nDiffRight * fScaleX );
3844 sal_Int32 nBottomCrop =
static_cast<sal_Int32
>( rOldCrop.
GetBottom() - nDiffBottom * fScaleY );
3848 aSet.Put(
SdrGrafCropItem( nLeftCrop, nTopCrop, nRightCrop, nBottomCrop ) );
3862 return PointerStyle::Crop;
Color GetStripeColorA() const
const SdrMarkList & GetMarkedObjectList()
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
sal_Int32 GetLeft() 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
long AdjustX(long nHorzMove)
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)
const Point & GetStart() const
virtual bool BeginSdrDrag() override
void RotateMarkedPoints(const Point &rRef, long nAngle)
B2DPolygon expandToCurve(const B2DPolygon &rCandidate)
virtual bool EndSdrDrag(bool bCopy) override
bool IsUndoEnabled() const
void CheckSnap(const Point &rPt, long &nBestXSnap, long &nBestYSnap, bool &bXSnapped, bool &bYSnapped) 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 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)
std::set< sal_uInt16 > SdrUShortCont
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
long NormAngle36000(long a)
Normalize angle to -180.00..179.99.
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
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
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
Primitive2DReference createPolygonLinePrimitive(const basegfx::B2DPolygon &rPolygon, const attribute::SdrLineAttribute &rLine, const attribute::SdrLineStartEndAttribute &rStroke)
std::vector< std::unique_ptr< SdrDragEntry > > maSdrDragEntries
static OUString GetAngleString(long nAngle)
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 RotateMarkedObj(const Point &rRef, long nAngle, bool bCopy=false)
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)
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)
sal_uInt16 GetAngleSector(long nAngle)
Normalize angle to 0.00..359.99.
Point GetSnapPos(const Point &rPt) const
tools::Rectangle aMarkRect
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)
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
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)
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)
long AdjustY(long nVertMove)
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
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
bool IsAngleSnapEnabled() const
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)
long GetSnapAngle() const
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
SdrDragMove(SdrDragView &rNewView)
virtual bool BeginSdrDrag() override
virtual bool BeginSdrDrag() override
virtual void Mirror(const Point &rRef1, const Point &rRef2)
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
void CrookMarkedObj(const Point &rRef, const Point &rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bCopy=false)
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)
OUString GetMetricString(long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
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
long NormAngle18000(long a)
sal_Int32 GetBottom() const
const tools::Rectangle & GetDragLimitRect()
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
virtual OUString GetSdrDragComment() const override
void RotateMarkedGluePoints(const Point &rRef, long nAngle, bool bCopy)
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)
attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(const SfxItemSet &rSet, double fWidth)
virtual bool EndSdrDrag(bool bCopy) override
virtual bool EndSdrDrag(bool bCopy) override
void createSdrDragEntries_GlueDrag()
SdrHdlKind GetDragHdlKind() const
drawinglayer::primitive2d::Primitive2DContainer const maPrimitive2DSequence
sal_Int32 GetDenominator() const
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
void ShearMarkedObj(const Point &rRef, long nAngle, bool bVShear=false, bool bCopy=false)
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
#define SDRATTR_TEXT_AUTOGROWWIDTH
SdrDragDistort(SdrDragView &rNewView)
SdrPaintWindow & GetPaintWindow() const
attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet &rSet)
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
SdrDragObjOwn(SdrDragView &rNewView)
#define DRAG_CROOK_RASTER_MINIMUM
void MoveMarkedPoints(const Size &rSiz)
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
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
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
long 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.
basegfx::B2DRange getBaseRange() const
static BitmapEx createGluePointBitmap()
void translate(double fX, double fY)
bool IsCrookAllowed(bool bNoContortion=false) const
void SetMoveFirstHandle(bool bNew)
const basegfx::B2DPolyPolygon & GetPathPoly() const
basegfx::BColor getBColor() const
ImpGetDescriptionOptions
options for ImpGetDescriptionString()
drawinglayer::primitive2d::Primitive2DContainer AddConnectorOverlays()
SdrPageView * GetSdrPageView() const
sal_Int32 GetRight() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
basegfx::B2DPolyPolygon const maOriginalPolyPolygon
bool bNoContortionAllowed
const SdrObject & getOriginal() const
std::vector< basegfx::B2DPoint > const maPositions
virtual bool applySpecialDrag(SdrDragStat &rDrag)
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()
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
virtual bool BeginSdrDrag() override
sal_uInt16 GetStripeLength() const
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)
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
virtual bool EndSdrDrag(bool bCopy) override
SdrDragMovHdl(SdrDragView &rNewView)
Point Rotate(const Point &rPoint, short nOrientation, const Point &rOrigin)
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