LibreOffice Module svx (master) 1
svdsnpv.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include <svx/svdsnpv.hxx>
22#include <math.h>
23
24#include <svx/svdobj.hxx>
25#include <svx/svdpagv.hxx>
26#include <svx/svdpage.hxx>
27#include <svx/svditer.hxx>
33#include <tools/debug.hxx>
34#include <vcl/ptrstyle.hxx>
35
36
38{
39 // The OverlayObjects
41
42 // The current position in logical coordinates
44
45public:
46 ImplPageOriginOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos);
47
48 // The OverlayObjects are cleared using the destructor of OverlayObjectList.
49 // That destructor calls clear() at the list which removes all objects from the
50 // OverlayManager and deletes them.
51
52 void SetPosition(const basegfx::B2DPoint& rNewPosition);
53};
54
56: maPosition(rStartPos)
57{
58 for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
59 {
60 SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
61 const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
62
63 if (xTargetOverlay.is())
64 {
65 std::unique_ptr<sdr::overlay::OverlayCrosshairStriped> aNew(new sdr::overlay::OverlayCrosshairStriped(
66 maPosition));
67 xTargetOverlay->add(*aNew);
68 maObjects.append(std::move(aNew));
69 }
70 }
71}
72
74{
75 if(rNewPosition == maPosition)
76 return;
77
78 // apply to OverlayObjects
79 for(sal_uInt32 a(0); a < maObjects.count(); a++)
80 {
83
84 if(pCandidate)
85 {
86 pCandidate->setBasePosition(rNewPosition);
87 }
88 }
89
90 // remember new position
91 maPosition = rNewPosition;
92}
93
94
96{
97 // The OverlayObjects
99
100 // The current position in logical coordinates
102
103 // HelpLine specific stuff
107
108public:
109 ImplHelpLineOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos,
110 SdrPageView* pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind);
111
112 // The OverlayObjects are cleared using the destructor of OverlayObjectList.
113 // That destructor calls clear() at the list which removes all objects from the
114 // OverlayManager and deletes them.
115
116 void SetPosition(const basegfx::B2DPoint& rNewPosition);
117
118 // access to HelpLine specific stuff
119 SdrPageView* GetPageView() const { return mpPageView; }
120 sal_uInt16 GetHelpLineNumber() const { return mnHelpLineNumber; }
122};
123
125 const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos,
126 SdrPageView* pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind)
127: maPosition(rStartPos),
128 mpPageView(pPageView),
129 mnHelpLineNumber(nHelpLineNumber),
130 meHelpLineKind(eKind)
131{
132 for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
133 {
134 SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
135 const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
136
137 if (xTargetOverlay.is())
138 {
139 std::unique_ptr<sdr::overlay::OverlayHelplineStriped> aNew(new sdr::overlay::OverlayHelplineStriped(
141 xTargetOverlay->add(*aNew);
142 maObjects.append(std::move(aNew));
143 }
144 }
145}
146
148{
149 if(rNewPosition == maPosition)
150 return;
151
152 // apply to OverlayObjects
153 for(sal_uInt32 a(0); a < maObjects.count(); a++)
154 {
157
158 if(pCandidate)
159 {
160 pCandidate->setBasePosition(rNewPosition);
161 }
162 }
163
164 // remember new position
165 maPosition = rNewPosition;
166}
167
169 SdrModel& rSdrModel,
170 OutputDevice* pOut)
171: SdrPaintView(rSdrModel, pOut)
172 ,mpPageOriginOverlay(nullptr)
173 ,mpHelpLineOverlay(nullptr)
174 ,nMagnSizPix(4)
175 ,nSnapAngle(1500)
176 ,nEliminatePolyPointLimitAngle(0)
177 ,eCrookMode(SdrCrookMode::Rotate)
178 ,bSnapEnab(true)
179 ,bGridSnap(true)
180 ,bBordSnap(true)
181 ,bHlplSnap(true)
182 ,bOFrmSnap(true)
183 ,bOPntSnap(false)
184 ,bOConSnap(true)
185 ,bMoveSnapOnlyTopLeft(false)
186 ,bOrtho(false)
187 ,bBigOrtho(true)
188 ,bAngleSnapEnab(false)
189 ,bMoveOnlyDragging(false)
190 ,bSlantButShear(false)
191 ,bCrookNoContortion(false)
192 ,bEliminatePolyPoints(false)
193{
194}
195
197{
200}
201
202
204{
206}
207
209{
211 if (IsSetPageOrg()) {
212 MovSetPageOrg(rPnt);
213 }
214 if (IsDragHelpLine()) {
215 MovDragHelpLine(rPnt);
216 }
217}
218
220{
221 if (IsSetPageOrg()) {
223 }
224 if (IsDragHelpLine()) {
226 }
228}
229
231{
235}
236
238{
242}
243
245{
246 if (IsSetPageOrg() || IsDragHelpLine()) {
248 } else {
250 }
251}
252
253
254Point SdrSnapView::GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const
255{
256 Point aPt(rPnt);
257 SnapPos(aPt,pPV);
258 return aPt;
259}
260
261#define NOT_SNAPPED 0x7FFFFFFF
263{
264 if (!bSnapEnab) return SdrSnap::NOTSNAPPED;
265 tools::Long x=rPnt.X();
266 tools::Long y=rPnt.Y();
267 if (pPV==nullptr) {
268 pPV=GetSdrPageView();
269 if (pPV==nullptr) return SdrSnap::NOTSNAPPED;
270 }
271
274 tools::Long dx1,dy1;
278 {
279 const SdrHelpLineList& rHLL=pPV->GetHelpLines();
280 sal_uInt16 nCount=rHLL.GetCount();
281 for (sal_uInt16 i=nCount; i>0;) {
282 i--;
283 const SdrHelpLine& rHL=rHLL[i];
284 const Point& rPos=rHL.GetPos();
285 switch (rHL.GetKind()) {
287 tools::Long a=x-rPos.X();
288 if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; }
289 } break;
291 tools::Long b=y-rPos.Y();
292 if (std::abs(b)<=my) { dy1=-b; if (std::abs(dy1)<std::abs(dy)) dy=dy1; }
293 } break;
295 tools::Long a=x-rPos.X();
296 tools::Long b=y-rPos.Y();
297 if (std::abs(a)<=mx && std::abs(b)<=my) {
298 dx1=-a; dy1=-b;
299 if (std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) { dx=dx1; dy=dy1; }
300 }
301 } break;
302 } // switch
303 }
304 }
305 if (mbBordVisible && bBordSnap) {
306 SdrPage* pPage=pPV->GetPage();
307 tools::Long xs=pPage->GetWidth();
308 tools::Long ys=pPage->GetHeight();
309 tools::Long lft=pPage->GetLeftBorder();
310 tools::Long rgt=pPage->GetRightBorder();
311 tools::Long upp=pPage->GetUpperBorder();
312 tools::Long lwr=pPage->GetLowerBorder();
314 a=x- lft ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // left margin
315 a=x-(xs-rgt); if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // right margin
316 a=x ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // left edge of paper
317 a=x- xs ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // right edge of paper
318 a=y- upp ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left margin
319 a=y-(ys-lwr); if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right margin
320 a=y ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left edge of paper
321 a=y- ys ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right edge of paper
322 }
323 if (bOFrmSnap || bOPntSnap) {
324 sal_uInt32 nMaxPointSnapCount=200;
325 sal_uInt32 nMaxFrameSnapCount=200;
326
327 // go back to SdrIterMode::DeepNoGroups runthrough for snap to object comparisons
329
330 while (aIter.IsMore() && (nMaxPointSnapCount>0 || nMaxFrameSnapCount>0)) {
331 SdrObject* pO=aIter.Next();
333 aRect.AdjustLeft( -mx );
334 aRect.AdjustRight(mx );
335 aRect.AdjustTop( -my );
336 aRect.AdjustBottom(my );
337 if (aRect.Contains(rPnt)) {
338 if (bOPntSnap && nMaxPointSnapCount>0)
339 {
340 sal_uInt32 nCount(pO->GetSnapPointCount());
341 for (sal_uInt32 i(0); i < nCount && nMaxPointSnapCount > 0; i++)
342 {
343 Point aP(pO->GetSnapPoint(i));
344 dx1=x-aP.X();
345 dy1=y-aP.Y();
346 if (std::abs(dx1)<=mx && std::abs(dy1)<=my && std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) {
347 dx=-dx1;
348 dy=-dy1;
349 }
350 nMaxPointSnapCount--;
351 }
352 }
353 if (bOFrmSnap && nMaxFrameSnapCount>0) {
354 tools::Rectangle aLog(pO->GetSnapRect());
355 tools::Rectangle aR1(aLog);
356 aR1.AdjustLeft( -mx );
357 aR1.AdjustRight(mx );
358 aR1.AdjustTop( -my );
359 aR1.AdjustBottom(my );
360 if (aR1.Contains(rPnt)) {
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; }
365 }
366 nMaxFrameSnapCount--;
367 }
368 }
369 }
370 }
371 if(bGridSnap)
372 {
373 double fSnapWidth(aSnapWdtX);
374 if(dx == NOT_SNAPPED && fSnapWidth != 0.0)
375 {
376 double fx = static_cast<double>(x);
377
378 // round instead of trunc
379 if(fx - static_cast<double>(pPV->GetPageOrigin().X()) >= 0.0)
380 fx += fSnapWidth / 2.0;
381 else
382 fx -= fSnapWidth / 2.0;
383
384 x = static_cast<tools::Long>((fx - static_cast<double>(pPV->GetPageOrigin().X())) / fSnapWidth);
385 x = static_cast<tools::Long>(static_cast<double>(x) * fSnapWidth + static_cast<double>(pPV->GetPageOrigin().X()));
386 dx = 0;
387 }
388 fSnapWidth = double(aSnapWdtY);
389 if(dy == NOT_SNAPPED && fSnapWidth)
390 {
391 double fy = static_cast<double>(y);
392
393 // round instead of trunc
394 if(fy - static_cast<double>(pPV->GetPageOrigin().Y()) >= 0.0)
395 fy += fSnapWidth / 2.0;
396 else
397 fy -= fSnapWidth / 2.0;
398
399 y = static_cast<tools::Long>((fy - static_cast<double>(pPV->GetPageOrigin().Y())) / fSnapWidth);
400 y = static_cast<tools::Long>(static_cast<double>(y) * fSnapWidth + static_cast<double>(pPV->GetPageOrigin().Y()));
401 dy = 0;
402 }
403 }
405 if (dx==NOT_SNAPPED) dx=0; else bRet|=SdrSnap::XSNAPPED;
406 if (dy==NOT_SNAPPED) dy=0; else bRet|=SdrSnap::YSNAPPED;
407 rPnt.setX(x+dx );
408 rPnt.setY(y+dy );
409 return bRet;
410}
411
412void SdrSnapView::CheckSnap(const Point& rPt, tools::Long& nBestXSnap, tools::Long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const
413{
414 Point aPt(rPt);
415 SdrSnap nRet=SnapPos(aPt,nullptr);
416 aPt-=rPt;
417 if (nRet & SdrSnap::XSNAPPED) {
418 if (bXSnapped) {
419 if (std::abs(aPt.X())<std::abs(nBestXSnap)) {
420 nBestXSnap=aPt.X();
421 }
422 } else {
423 nBestXSnap=aPt.X();
424 bXSnapped=true;
425 }
426 }
427 if (nRet & SdrSnap::YSNAPPED) {
428 if (bYSnapped) {
429 if (std::abs(aPt.Y())<std::abs(nBestYSnap)) {
430 nBestYSnap=aPt.Y();
431 }
432 } else {
433 nBestYSnap=aPt.Y();
434 bYSnapped=true;
435 }
436 }
437}
438
439
441{
442 BrkAction();
443
444 DBG_ASSERT(nullptr == mpPageOriginOverlay, "SdrSnapView::BegSetPageOrg: There exists an ImplPageOriginOverlay (!)");
445 basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
446 mpPageOriginOverlay = new ImplPageOriginOverlay(*this, aStartPos);
447 maDragStat.Reset(GetSnapPos(rPnt,nullptr));
448}
449
451{
452 if(IsSetPageOrg())
453 {
454 maDragStat.NextMove(GetSnapPos(rPnt,nullptr));
455 DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
458 }
459}
460
462{
463 if(!IsSetPageOrg())
464 return;
465
467
468 if(pPV)
469 {
470 Point aPnt(maDragStat.GetNow());
471 pPV->SetPageOrigin(aPnt);
472 }
473
474 // cleanup
476}
477
479{
480 if(IsSetPageOrg())
481 {
482 DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
483 delete mpPageOriginOverlay;
484 mpPageOriginOverlay = nullptr;
485 }
486}
487
488
489bool SdrSnapView::PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const
490{
491 rpPV=nullptr;
492 nTol=ImpGetHitTolLogic(nTol,&rOut);
494
495 if(pPV)
496 {
497 Point aPnt(rPnt);
498 sal_uInt16 nIndex=pPV->GetHelpLines().HitTest(aPnt,sal_uInt16(nTol),rOut);
500 rpPV=pPV;
501 rnHelpLineNum=nIndex;
502 return true;
503 }
504 }
505 return false;
506}
507
508// start HelpLine drag for new HelpLine
509bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV)
510{
511 bool bRet(false);
512
513 BrkAction();
514
515 if(pPV && nHelpLineNum < pPV->GetHelpLines().GetCount())
516 {
517 const SdrHelpLineList& rHelpLines = pPV->GetHelpLines();
518 const SdrHelpLine& rHelpLine = rHelpLines[nHelpLineNum];
519 Point aHelpLinePos = rHelpLine.GetPos();
520 basegfx::B2DPoint aStartPos(aHelpLinePos.X(), aHelpLinePos.Y());
521
522 DBG_ASSERT(nullptr == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists an ImplHelpLineOverlay (!)");
523 mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, pPV, nHelpLineNum, rHelpLine.GetKind());
524
525 maDragStat.Reset(GetSnapPos(aHelpLinePos, pPV));
527
528 bRet = true;
529 }
530
531 return bRet;
532}
533
534// start HelpLine drag with existing HelpLine
536{
537 BrkAction();
538
539 if(GetSdrPageView())
540 {
541 DBG_ASSERT(nullptr == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists an ImplHelpLineOverlay (!)");
542 basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
543 mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, nullptr, 0, eNewKind);
544 maDragStat.Reset(GetSnapPos(rPnt, nullptr));
545 }
546}
547
549{
550 if(IsDragHelpLine())
551 {
553 {
554 case SdrHelpLineKind::Vertical : return PointerStyle::ESize;
555 case SdrHelpLineKind::Horizontal: return PointerStyle::SSize;
556 default : return PointerStyle::Move;
557 }
558 }
559
560 return PointerStyle::Move;
561}
562
564{
566 {
567 Point aPnt(GetSnapPos(rPnt, nullptr));
568
569 if(aPnt != maDragStat.GetNow())
570 {
571 maDragStat.NextMove(aPnt);
572 DBG_ASSERT(mpHelpLineOverlay, "SdrSnapView::MovDragHelpLine: no ImplHelpLineOverlay (!)");
575 }
576 }
577}
578
580{
581 bool bRet(false);
582
583 if(IsDragHelpLine())
584 {
586 {
588
589 if(pPageView)
590 {
591 // moved existing one
592 Point aPnt(maDragStat.GetNow());
593 const SdrHelpLineList& rHelpLines = pPageView->GetHelpLines();
594 SdrHelpLine aChangedHelpLine = rHelpLines[mpHelpLineOverlay->GetHelpLineNumber()];
595 aChangedHelpLine.SetPos(aPnt);
596 pPageView->SetHelpLine(mpHelpLineOverlay->GetHelpLineNumber(), aChangedHelpLine);
597
598 bRet = true;
599 }
600 else
601 {
602 // create new one
603 pPageView = GetSdrPageView();
604
605 if(pPageView)
606 {
607 Point aPnt(maDragStat.GetNow());
608 SdrHelpLine aNewHelpLine(mpHelpLineOverlay->GetHelpLineKind(), aPnt);
609 pPageView->InsertHelpLine(aNewHelpLine);
610
611 bRet = true;
612 }
613 }
614 }
615
616 // cleanup
618 }
619
620 return bRet;
621}
622
624{
625 if(IsDragHelpLine())
626 {
627 DBG_ASSERT(mpHelpLineOverlay, "SdrSnapView::EndDragHelpLine: no ImplHelpLineOverlay (!)");
628 delete mpHelpLineOverlay;
629 mpHelpLineOverlay = nullptr;
630 }
631}
632
633/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
geometry::RealPoint2D maPosition
sdr::overlay::OverlayObjectList maObjects
Definition: svdsnpv.cxx:98
SdrHelpLineKind meHelpLineKind
Definition: svdsnpv.cxx:106
SdrPageView * mpPageView
Definition: svdsnpv.cxx:104
sal_uInt16 mnHelpLineNumber
Definition: svdsnpv.cxx:105
void SetPosition(const basegfx::B2DPoint &rNewPosition)
Definition: svdsnpv.cxx:147
SdrHelpLineKind GetHelpLineKind() const
Definition: svdsnpv.cxx:121
basegfx::B2DPoint maPosition
Definition: svdsnpv.cxx:101
ImplHelpLineOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos, SdrPageView *pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind)
Definition: svdsnpv.cxx:124
sal_uInt16 GetHelpLineNumber() const
Definition: svdsnpv.cxx:120
SdrPageView * GetPageView() const
Definition: svdsnpv.cxx:119
ImplPageOriginOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos)
Definition: svdsnpv.cxx:55
basegfx::B2DPoint maPosition
Definition: svdsnpv.cxx:43
sdr::overlay::OverlayObjectList maObjects
Definition: svdsnpv.cxx:40
void SetPosition(const basegfx::B2DPoint &rNewPosition)
Definition: svdsnpv.cxx:73
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)
Definition: svddrag.cxx:66
bool IsMinMoved() const
Definition: svddrag.hxx:118
void Reset()
Definition: svddrag.cxx:36
bool CheckMinMoved(const Point &rPnt)
Definition: svddrag.cxx:86
const Point & GetNow() const
Definition: svddrag.hxx:105
void SetMinMove(sal_uInt16 nDist)
Definition: svddrag.hxx:121
sal_uInt16 GetCount() const
Definition: svdhlpln.hxx:70
sal_uInt16 HitTest(const Point &rPnt, sal_uInt16 nTolLog, const OutputDevice &rOut) const
Definition: svdhlpln.cxx:99
const Point & GetPos() const
Definition: svdhlpln.hxx:51
SdrHelpLineKind GetKind() const
Definition: svdhlpln.hxx:49
void SetPos(const Point &rPnt)
Definition: svdhlpln.hxx:50
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
Abstract DrawObject.
Definition: svdobj.hxx:260
virtual sal_uInt32 GetSnapPointCount() const
snap to special points of an Object (polygon points, center of circle)
Definition: svdobj.cxx:1715
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:962
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1662
virtual Point GetSnapPoint(sal_uInt32 i) const
Definition: svdobj.cxx:1720
void SetPageOrigin(const Point &rOrg)
Definition: svdpagv.cxx:640
const SdrHelpLineList & GetHelpLines() const
Definition: svdpagv.hxx:216
SdrPage * GetPage() const
Definition: svdpagv.hxx:166
const Point & GetPageOrigin() const
The Origin always refers to the upper left corner of the Page.
Definition: svdpagv.hxx:202
void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine &rNewHelpLine)
Definition: svdpagv.cxx:682
void InsertHelpLine(const SdrHelpLine &rHL)
Definition: svdpagv.cxx:708
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1561
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1566
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1556
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1571
tools::Long GetHeight() const
Definition: svdpage.cxx:1481
tools::Long GetWidth() const
Definition: svdpage.cxx:1455
virtual void MovAction(const Point &rPnt)
Definition: svdpntv.cxx:277
bool mbBordVisible
Definition: svdpntv.hxx:154
virtual void BrkAction()
Definition: svdpntv.cxx:289
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:75
sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice *pOut) const
Definition: svdpntv.cxx:304
virtual void BckAction()
Definition: svdpntv.cxx:285
virtual void EndAction()
Definition: svdpntv.cxx:281
virtual void TakeActionRect(tools::Rectangle &rRect) const
Definition: svdpntv.cxx:293
virtual bool IsAction() const
Definition: svdpntv.cxx:272
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
Definition: svdpntv.cxx:318
SdrDragStat maDragStat
Definition: svdpntv.hxx:139
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:241
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:323
bool mbHlplVisible
Definition: svdpntv.hxx:157
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
Size aMagnSiz
Definition: svdsnpv.hxx:102
virtual ~SdrSnapView() override
Definition: svdsnpv.cxx:196
SdrSnap SnapPos(Point &rPnt, const SdrPageView *pPV) const
Definition: svdsnpv.cxx:262
void MovDragHelpLine(const Point &rPnt)
Definition: svdsnpv.cxx:563
bool EndDragHelpLine()
Definition: svdsnpv.cxx:579
virtual bool IsAction() const override
Definition: svdsnpv.cxx:203
PointerStyle GetDraggedHelpLinePointer() const
Definition: svdsnpv.cxx:548
bool IsSetPageOrg() const
Definition: svdsnpv.hxx:190
class ImplPageOriginOverlay * mpPageOriginOverlay
Definition: svdsnpv.hxx:97
bool bBordSnap
Definition: svdsnpv.hxx:114
SdrSnapView(SdrModel &rSdrModel, OutputDevice *pOut)
Definition: svdsnpv.cxx:168
Fraction aSnapWdtX
Definition: svdsnpv.hxx:103
bool bOFrmSnap
Definition: svdsnpv.hxx:116
class ImplHelpLineOverlay * mpHelpLineOverlay
Definition: svdsnpv.hxx:100
bool PickHelpLine(const Point &rPnt, short nTol, const OutputDevice &rOut, sal_uInt16 &rnHelpLineNum, SdrPageView *&rpPV) const
Definition: svdsnpv.cxx:489
virtual void TakeActionRect(tools::Rectangle &rRect) const override
Definition: svdsnpv.cxx:244
void EndSetPageOrg()
Definition: svdsnpv.cxx:461
bool bOPntSnap
Definition: svdsnpv.hxx:117
virtual void EndAction() override
Definition: svdsnpv.cxx:219
bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView *pPV)
Definition: svdsnpv.cxx:509
bool IsDragHelpLine() const
Definition: svdsnpv.hxx:207
Fraction aSnapWdtY
Definition: svdsnpv.hxx:104
void CheckSnap(const Point &rPt, tools::Long &nBestXSnap, tools::Long &nBestYSnap, bool &bXSnapped, bool &bYSnapped) const
Definition: svdsnpv.cxx:412
virtual void BrkAction() override
Definition: svdsnpv.cxx:237
virtual void BckAction() override
Definition: svdsnpv.cxx:230
void BegSetPageOrg(const Point &rPnt)
Definition: svdsnpv.cxx:440
bool bSnapEnab
Definition: svdsnpv.hxx:112
virtual void MovAction(const Point &rPnt) override
Definition: svdsnpv.cxx:208
bool bGridSnap
Definition: svdsnpv.hxx:113
Point GetSnapPos(const Point &rPnt, const SdrPageView *pPV) const
Definition: svdsnpv.cxx:254
void BrkSetPageOrg()
Definition: svdsnpv.cxx:478
void BrkDragHelpLine()
Definition: svdsnpv.cxx:623
void MovSetPageOrg(const Point &rPnt)
Definition: svdsnpv.cxx:450
bool bHlplSnap
Definition: svdsnpv.hxx:115
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)
bool Contains(const Point &rPOINT) const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
int nCount
#define DBG_ASSERT(sCon, aError)
float y
float x
sal_Int32 nIndex
uno_Any a
int i
long Long
PointerStyle
SdrHelpLineKind
Definition: svdhlpln.hxx:34
#define SDRHELPLINE_NOTFOUND
Definition: svdhlpln.hxx:59
#define NOT_SNAPPED
Definition: svdsnpv.cxx:261
SdrSnap
Definition:
Definition: svdsnpv.hxx:72
SdrCrookMode
Definition: svdsnpv.hxx:83
oslFileHandle & pOut