63 if (xTargetOverlay.is())
67 xTargetOverlay->add(*aNew);
128 mpPageView(pPageView),
129 mnHelpLineNumber(nHelpLineNumber),
130 meHelpLineKind(eKind)
137 if (xTargetOverlay.is())
141 xTargetOverlay->add(*aNew);
172 ,mpPageOriginOverlay(nullptr)
173 ,mpHelpLineOverlay(nullptr)
176 ,nEliminatePolyPointLimitAngle(0)
185 ,bMoveSnapOnlyTopLeft(false)
188 ,bAngleSnapEnab(false)
189 ,bMoveOnlyDragging(false)
190 ,bSlantButShear(false)
191 ,bCrookNoContortion(false)
192 ,bEliminatePolyPoints(false)
261#define NOT_SNAPPED 0x7FFFFFFF
288 if (std::abs(
a)<=mx) { dx1=-
a;
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
292 if (std::abs(b)<=my) { dy1=-b;
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
297 if (std::abs(
a)<=mx && std::abs(b)<=my) {
299 if (std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) { dx=dx1; dy=dy1; }
314 a=
x- lft ;
if (std::abs(
a)<=mx) { dx1=-
a;
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
315 a=
x-(xs-rgt);
if (std::abs(
a)<=mx) { dx1=-
a;
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
316 a=
x ;
if (std::abs(
a)<=mx) { dx1=-
a;
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
317 a=
x- xs ;
if (std::abs(
a)<=mx) { dx1=-
a;
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
318 a=
y- upp ;
if (std::abs(
a)<=my) { dy1=-
a;
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
319 a=
y-(ys-lwr);
if (std::abs(
a)<=my) { dy1=-
a;
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
320 a=
y ;
if (std::abs(
a)<=my) { dy1=-
a;
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
321 a=
y- ys ;
if (std::abs(
a)<=my) { dy1=-
a;
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
324 sal_uInt32 nMaxPointSnapCount=200;
325 sal_uInt32 nMaxFrameSnapCount=200;
330 while (aIter.
IsMore() && (nMaxPointSnapCount>0 || nMaxFrameSnapCount>0)) {
341 for (sal_uInt32
i(0); i < nCount && nMaxPointSnapCount > 0;
i++)
346 if (std::abs(dx1)<=mx && std::abs(dy1)<=my && std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) {
350 nMaxPointSnapCount--;
361 if (std::abs(
x-aLog.
Left ())<=mx) { dx1=-(
x-aLog.
Left ());
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
362 if (std::abs(
x-aLog.
Right ())<=mx) { dx1=-(
x-aLog.
Right ());
if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
363 if (std::abs(
y-aLog.
Top ())<=my) { dy1=-(
y-aLog.
Top ());
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
364 if (std::abs(
y-aLog.
Bottom())<=my) { dy1=-(
y-aLog.
Bottom());
if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
366 nMaxFrameSnapCount--;
376 double fx =
static_cast<double>(
x);
380 fx += fSnapWidth / 2.0;
382 fx -= fSnapWidth / 2.0;
391 double fy =
static_cast<double>(
y);
395 fy += fSnapWidth / 2.0;
397 fy -= fSnapWidth / 2.0;
419 if (std::abs(aPt.
X())<std::abs(nBestXSnap)) {
429 if (std::abs(aPt.
Y())<std::abs(nBestYSnap)) {
515 if(pPV && nHelpLineNum < pPV->GetHelpLines().GetCount())
518 const SdrHelpLine& rHelpLine = rHelpLines[nHelpLineNum];
556 default :
return PointerStyle::Move;
560 return PointerStyle::Move;
595 aChangedHelpLine.
SetPos(aPnt);
geometry::RealPoint2D maPosition
sdr::overlay::OverlayObjectList maObjects
SdrHelpLineKind meHelpLineKind
sal_uInt16 mnHelpLineNumber
void SetPosition(const basegfx::B2DPoint &rNewPosition)
SdrHelpLineKind GetHelpLineKind() const
basegfx::B2DPoint maPosition
ImplHelpLineOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos, SdrPageView *pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind)
sal_uInt16 GetHelpLineNumber() const
SdrPageView * GetPageView() const
ImplPageOriginOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos)
basegfx::B2DPoint maPosition
sdr::overlay::OverlayObjectList maObjects
void SetPosition(const basegfx::B2DPoint &rNewPosition)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
void NextMove(const Point &rPnt)
bool CheckMinMoved(const Point &rPnt)
const Point & GetNow() const
void SetMinMove(sal_uInt16 nDist)
sal_uInt16 GetCount() const
sal_uInt16 HitTest(const Point &rPnt, sal_uInt16 nTolLog, const OutputDevice &rOut) const
const Point & GetPos() const
SdrHelpLineKind GetKind() const
void SetPos(const Point &rPnt)
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual const tools::Rectangle & GetSnapRect() const
virtual Point GetSnapPoint(sal_uInt32 i) const
void SetPageOrigin(const Point &rOrg)
const SdrHelpLineList & GetHelpLines() const
SdrPage * GetPage() const
const Point & GetPageOrigin() const
The Origin always refers to the upper left corner of the Page.
void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine &rNewHelpLine)
void InsertHelpLine(const SdrHelpLine &rHL)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
sal_Int32 GetLowerBorder() const
tools::Long GetHeight() const
tools::Long GetWidth() const
virtual void MovAction(const Point &rPnt)
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice *pOut) const
virtual void TakeActionRect(tools::Rectangle &rRect) const
virtual bool IsAction() const
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
sal_uInt32 PaintWindowCount() const
SdrPageView * GetSdrPageView() const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
virtual ~SdrSnapView() override
SdrSnap SnapPos(Point &rPnt, const SdrPageView *pPV) const
void MovDragHelpLine(const Point &rPnt)
virtual bool IsAction() const override
PointerStyle GetDraggedHelpLinePointer() const
bool IsSetPageOrg() const
class ImplPageOriginOverlay * mpPageOriginOverlay
SdrSnapView(SdrModel &rSdrModel, OutputDevice *pOut)
class ImplHelpLineOverlay * mpHelpLineOverlay
bool PickHelpLine(const Point &rPnt, short nTol, const OutputDevice &rOut, sal_uInt16 &rnHelpLineNum, SdrPageView *&rpPV) const
virtual void TakeActionRect(tools::Rectangle &rRect) const override
virtual void EndAction() override
bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView *pPV)
bool IsDragHelpLine() const
void CheckSnap(const Point &rPt, tools::Long &nBestXSnap, tools::Long &nBestYSnap, bool &bXSnapped, bool &bYSnapped) const
virtual void BrkAction() override
virtual void BckAction() override
void BegSetPageOrg(const Point &rPnt)
virtual void MovAction(const Point &rPnt) override
Point GetSnapPos(const Point &rPnt, const SdrPageView *pPV) const
void MovSetPageOrg(const Point &rPnt)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void append(std::unique_ptr< OverlayObject > pOverlayObject)
OverlayObject & getOverlayObject(sal_uInt32 nIndex) const
void setBasePosition(const basegfx::B2DPoint &rNew)
#define DBG_ASSERT(sCon, aError)
#define SDRHELPLINE_NOTFOUND