LibreOffice Module svx (master)  1
svdpoev.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/svdpoev.hxx>
22 #include <math.h>
23 #include <svx/svdpagv.hxx>
24 #include <svx/svdpage.hxx>
25 #include <svx/svdopath.hxx>
26 #include <svx/svdundo.hxx>
27 #include <svx/strings.hrc>
28 #include <svx/dialmgr.hxx>
29 #include <svx/svdtrans.hxx>
32 #include <tools/debug.hxx>
33 #include <tools/helpers.hxx>
34 
36 
37 using namespace sdr;
38 
39 
41 {
42  eMarkedPointsSmooth=SdrPathSmoothKind::DontCare;
43  eMarkedSegmentsKind=SdrPathSegmentKind::DontCare;
44  bSetMarkedPointsSmoothPossible=false;
45  bSetMarkedSegmentsKindPossible=false;
46 }
47 
49  SdrModel& rSdrModel,
50  OutputDevice* pOut)
51 : SdrEditView(rSdrModel, pOut)
52 {
54 }
55 
57 {
58 }
59 
61 {
63  const size_t nMarkCount(GetMarkedObjectCount());
64 
65  if(nMarkCount && !ImpIsFrameHandles())
66  {
67  bool b1stSmooth(true);
68  bool b1stSegm(true);
69  bool bCurve(false);
70  bool bSmoothFuz(false);
71  bool bSegmFuz(false);
73 
74  for(size_t nMarkNum = 0; nMarkNum < nMarkCount; ++nMarkNum)
75  {
76  SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
77  CheckPolyPossibilitiesHelper( pM, b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth );
78  }
79  }
80 }
81 
82 void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth )
83 {
84  SdrObject* pObj = pM->GetMarkedSdrObj();
85  SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pObj );
86 
87  if (!pPath)
88  return;
89 
90  SdrUShortCont& rPts = pM->GetMarkedPoints();
91  if (rPts.empty())
92  return;
93 
94  const bool bClosed(pPath->IsClosed());
96 
97  if (bClosed)
98  {
100  }
101 
102  for (const auto& rPt : rPts)
103  {
104  sal_uInt32 nNum(rPt);
105  sal_uInt32 nPolyNum, nPntNum;
106 
107  if(PolyPolygonEditor::GetRelativePolyPoint(pPath->GetPathPoly(), nNum, nPolyNum, nPntNum))
108  {
109  const basegfx::B2DPolygon aLocalPolygon(pPath->GetPathPoly().getB2DPolygon(nPolyNum));
110  bool bCanSegment(bClosed || nPntNum < aLocalPolygon.count() - 1);
111 
112  if(!bSetMarkedSegmentsKindPossible && bCanSegment)
113  {
115  }
116 
117  if(!bSmoothFuz)
118  {
119  if (b1stSmooth)
120  {
121  b1stSmooth = false;
122  eSmooth = basegfx::utils::getContinuityInPoint(aLocalPolygon, nPntNum);
123  }
124  else
125  {
126  bSmoothFuz = (eSmooth != basegfx::utils::getContinuityInPoint(aLocalPolygon, nPntNum));
127  }
128  }
129 
130  if(!bSegmFuz && bCanSegment)
131  {
132  bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum));
133 
134  if(b1stSegm)
135  {
136  b1stSegm = false;
137  bCurve = bCrv;
138  }
139  else
140  {
141  bSegmFuz = (bCrv != bCurve);
142  }
143  }
144  }
145  }
146 
147  if(!b1stSmooth && !bSmoothFuz)
148  {
149  if(basegfx::B2VectorContinuity::NONE == eSmooth)
150  {
152  }
153 
154  if(basegfx::B2VectorContinuity::C1 == eSmooth)
155  {
157  }
158 
159  if(basegfx::B2VectorContinuity::C2 == eSmooth)
160  {
162  }
163  }
164 
165  if(!b1stSegm && !bSegmFuz)
166  {
168  }
169 }
170 
172 {
174 
175  if(SdrPathSmoothKind::Angular == eKind)
176  {
178  }
179  else if(SdrPathSmoothKind::Asymmetric == eKind)
180  {
182  }
183  else if(SdrPathSmoothKind::Symmetric == eKind)
184  {
186  }
187  else
188  {
189  return;
190  }
191 
192  if(HasMarkedPoints())
193  {
195 
196  const bool bUndo = IsUndoEnabled();
197  if( bUndo )
198  BegUndo(SvxResId(STR_EditSetPointsSmooth), GetDescriptionOfMarkedPoints());
199  const size_t nMarkCount(GetMarkedObjectCount());
200 
201  for(size_t nMarkNum(nMarkCount); nMarkNum > 0;)
202  {
203  --nMarkNum;
204  SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
205  SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() );
206  if (!pPath)
207  continue;
208 
209  SdrUShortCont& rPts = pM->GetMarkedPoints();
210  PolyPolygonEditor aEditor(pPath->GetPathPoly());
211  if (aEditor.SetPointsSmooth(eFlags, rPts))
212  {
213  if( bUndo )
214  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
215  pPath->SetPathPoly(aEditor.GetPolyPolygon());
216  }
217  }
218 
219  if( bUndo )
220  EndUndo();
221  }
222 }
223 
225 {
226  if(HasMarkedPoints())
227  {
229 
230  const bool bUndo = IsUndoEnabled();
231  if( bUndo )
232  BegUndo(SvxResId(STR_EditSetSegmentsKind), GetDescriptionOfMarkedPoints());
233  const size_t nMarkCount(GetMarkedObjectCount());
234 
235  for(size_t nMarkNum=nMarkCount; nMarkNum > 0;)
236  {
237  --nMarkNum;
238  SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
239  SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() );
240  if (!pPath)
241  continue;
242  SdrUShortCont& rPts = pM->GetMarkedPoints();
243  PolyPolygonEditor aEditor( pPath->GetPathPoly());
244  if (aEditor.SetSegmentsKind(eKind, rPts))
245  {
246  if( bUndo )
247  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
248  pPath->SetPathPoly(aEditor.GetPolyPolygon());
249  }
250  }
251 
252  if( bUndo )
253  EndUndo();
254  }
255 }
256 
258 {
261 }
262 
264 {
266  return eMarkedPointsSmooth;
267 }
268 
270 {
273 }
274 
276 {
278  return eMarkedSegmentsKind;
279 }
280 
282 {
283  return HasMarkedPoints();
284 }
285 
287 {
288  if (HasMarkedPoints())
289  {
290  BrkAction();
292  const size_t nMarkCount=GetMarkedObjectCount();
293 
294  const bool bUndo = IsUndoEnabled();
295  if( bUndo )
296  {
297  // Description
299  }
300 
301  for (size_t nMarkNum=nMarkCount; nMarkNum>0;)
302  {
303  --nMarkNum;
304  SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
305  SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() );
306  if (!pPath)
307  continue;
308 
309  SdrUShortCont& rPts = pM->GetMarkedPoints();
310  PolyPolygonEditor aEditor( pPath->GetPathPoly());
311  if (aEditor.DeletePoints(rPts))
312  {
313  if( aEditor.GetPolyPolygon().count() )
314  {
315  if( bUndo )
316  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath ));
317  pPath->SetPathPoly( aEditor.GetPolyPolygon() );
318  }
319  else
320  {
321  if( bUndo )
322  AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pPath ) );
323  pM->GetPageView()->GetObjList()->RemoveObject(pPath->GetOrdNum());
324  if( !bUndo )
325  {
326  SdrObject* pObj = pPath;
327  SdrObject::Free(pObj);
328  }
329  }
330  }
331  }
332 
333  if( bUndo )
334  EndUndo();
335  UnmarkAllPoints();
337  }
338 }
339 
341 {
342  if(HasMarkedPoints())
343  {
345  const size_t nMarkCount(GetMarkedObjectCount());
346 
347  const bool bUndo = IsUndoEnabled();
348  if( bUndo )
349  BegUndo(SvxResId(STR_EditRipUp), GetDescriptionOfMarkedPoints());
350 
351  for(size_t nMarkNum = nMarkCount; nMarkNum > 0;)
352  {
353  --nMarkNum;
354  SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
355  SdrPathObj* pObj = dynamic_cast<SdrPathObj*>( pM->GetMarkedSdrObj() );
356  if (!pObj)
357  continue;
358 
359  SdrUShortCont& rPts = pM->GetMarkedPoints();
360 
361  if( bUndo )
362  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
363  bool bCorrectionFlag(false);
364  sal_uInt32 nMax(pObj->GetHdlCount());
365 
366  for(SdrUShortCont::const_reverse_iterator it = rPts.rbegin(); it != rPts.rend(); ++it)
367  {
368  sal_uInt32 nNewPt0Idx(0);
369  SdrObject* pNewObj = pObj->RipPoint(*it, nNewPt0Idx);
370 
371  if(pNewObj)
372  {
373  pM->GetPageView()->GetObjList()->InsertObject(pNewObj, pObj->GetOrdNum() + 1);
374  if( bUndo )
375  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNewObj));
376  MarkObj(pNewObj, pM->GetPageView(), false, true);
377  }
378 
379  if(nNewPt0Idx)
380  {
381  // correction necessary?
382  DBG_ASSERT(!bCorrectionFlag,"Multiple index corrections at SdrPolyEditView::RipUp().");
383  if(!bCorrectionFlag)
384  {
385  bCorrectionFlag = true;
386 
387  SdrUShortCont aReplaceSet;
388  for(const auto& rPt : rPts)
389  {
390  sal_uInt32 nPntNum(rPt);
391  nPntNum += nNewPt0Idx;
392 
393  if(nPntNum >= nMax)
394  {
395  nPntNum -= nMax;
396  }
397 
398  aReplaceSet.insert( static_cast<sal_uInt16>(nPntNum) );
399  }
400  rPts.swap(aReplaceSet);
401 
402  it = rPts.rbegin();
403  }
404  }
405  }
406  }
407 
408  UnmarkAllPoints();
409  if( bUndo )
410  EndUndo();
412  }
413 }
414 
416 {
417  bool bRetval(false);
418  const size_t nMarkCount(GetMarkedObjectCount());
419 
420  for(size_t a = 0; a < nMarkCount; ++a)
421  {
422  const SdrMark* pMark = GetSdrMarkByIndex(a);
423  const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj());
424 
425  if (!pMarkedPathObject)
426  continue;
427 
428  const SdrUShortCont& rSelectedPoints = pMark->GetMarkedPoints();
429  if (rSelectedPoints.empty())
430  continue;
431 
432  const basegfx::B2DPolyPolygon& rPathPolyPolygon = pMarkedPathObject->GetPathPoly();
433 
434  if(1 == rPathPolyPolygon.count())
435  {
436  // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
437  // are different and methods need to be changed thoroughly with interaction rework
438  const tools::Polygon aPathPolygon(rPathPolyPolygon.getB2DPolygon(0));
439  const sal_uInt16 nPointCount(aPathPolygon.GetSize());
440 
441  if(nPointCount >= 3)
442  {
443  bRetval = pMarkedPathObject->IsClosedObj() // #i76617#
444  || std::any_of(rSelectedPoints.begin(), rSelectedPoints.end(),
445  [nPointCount](const sal_uInt16 nMarkedPointNum) {
446  return nMarkedPointNum > 0 && nMarkedPointNum < nPointCount - 1;
447  });
448  }
449  }
450  }
451 
452  return bRetval;
453 }
454 
456 {
457  bool bRetval(false);
458  const size_t nMarkCount(GetMarkedObjectCount());
459 
460  for(size_t a = 0; a < nMarkCount; ++a)
461  {
462  const SdrMark* pMark = GetSdrMarkByIndex(a);
463  const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj());
464 
465  if(pMarkedPathObject)
466  {
467  // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
468  // are different and methods need to be changed thoroughly with interaction rework
469  const tools::PolyPolygon aPathPolyPolygon(pMarkedPathObject->GetPathPoly());
470  const sal_uInt16 nPolygonCount(aPathPolyPolygon.Count());
471 
472  for(sal_uInt16 b(0); !bRetval && b < nPolygonCount; b++)
473  {
474  const tools::Polygon& rPathPolygon = aPathPolyPolygon[b];
475  const sal_uInt16 nPointCount(rPathPolygon.GetSize());
476 
477  bRetval = (nPointCount >= 3);
478  }
479  }
480  }
481 
482  return bRetval;
483 }
484 
486 {
487  bool bOpen(false);
488  bool bClosed(false);
489  const size_t nMarkCount(GetMarkedObjectCount());
490 
491  for(size_t a = 0; !(bOpen && bClosed) && a < nMarkCount; ++a)
492  {
493  const SdrMark* pMark = GetSdrMarkByIndex(a);
494  const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj());
495 
496  if(pMarkedPathObject)
497  {
498  if(pMarkedPathObject->IsClosedObj())
499  {
500  bClosed = true;
501  }
502  else
503  {
504  bOpen = true;
505  }
506  }
507  }
508 
509  if(bOpen && bClosed)
510  {
512  }
513  else if(bOpen)
514  {
515  return SdrObjClosedKind::Open;
516  }
517  else
518  {
520  }
521 }
522 
523 void SdrPolyEditView::ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* p1, const void* p2, const void* p3, const void* p4)
524 {
525  const bool bUndo = IsUndoEnabled();
526 
527  const size_t nMarkCount=GetMarkedObjectCount();
528  for (size_t nm=0; nm<nMarkCount; ++nm)
529  {
530  SdrMark* pM=GetSdrMarkByIndex(nm);
531  SdrObject* pObj=pM->GetMarkedSdrObj();
532  SdrPathObj* pPath=dynamic_cast<SdrPathObj*>( pObj );
533  if (!pPath)
534  continue;
535 
536  const SdrUShortCont& rPts = pM->GetMarkedPoints();
537  if (rPts.empty())
538  continue;
539 
540  if( bUndo )
541  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
542 
543  basegfx::B2DPolyPolygon aXPP(pPath->GetPathPoly());
544 
545  for (const auto& rPt : rPts)
546  {
547  sal_uInt32 nPt = rPt;
548  sal_uInt32 nPolyNum, nPointNum;
549 
550  if(PolyPolygonEditor::GetRelativePolyPoint(aXPP, nPt, nPolyNum, nPointNum))
551  {
552  //#i83671# used nLocalPointNum (which was the polygon point count)
553  // instead of the point index (nPointNum). This of course led
554  // to a wrong point access to the B2DPolygon.
555  basegfx::B2DPolygon aNewXP(aXPP.getB2DPolygon(nPolyNum));
556  Point aPos, aC1, aC2;
557  bool bC1(false);
558  bool bC2(false);
559 
560  const basegfx::B2DPoint aB2DPos(aNewXP.getB2DPoint(nPointNum));
561  aPos = Point(FRound(aB2DPos.getX()), FRound(aB2DPos.getY()));
562 
563  if(aNewXP.isPrevControlPointUsed(nPointNum))
564  {
565  const basegfx::B2DPoint aB2DC1(aNewXP.getPrevControlPoint(nPointNum));
566  aC1 = Point(FRound(aB2DC1.getX()), FRound(aB2DC1.getY()));
567  bC1 = true;
568  }
569 
570  if(aNewXP.isNextControlPointUsed(nPointNum))
571  {
572  const basegfx::B2DPoint aB2DC2(aNewXP.getNextControlPoint(nPointNum));
573  aC2 = Point(FRound(aB2DC2.getX()), FRound(aB2DC2.getY()));
574  bC2 = true;
575  }
576 
577  (*pTrFunc)(aPos,&aC1,&aC2,p1,p2,p3,p4);
578  aNewXP.setB2DPoint(nPointNum, basegfx::B2DPoint(aPos.X(), aPos.Y()));
579 
580  if (bC1)
581  {
582  aNewXP.setPrevControlPoint(nPointNum, basegfx::B2DPoint(aC1.X(), aC1.Y()));
583  }
584 
585  if (bC2)
586  {
587  aNewXP.setNextControlPoint(nPointNum, basegfx::B2DPoint(aC2.X(), aC2.Y()));
588  }
589 
590  aXPP.setB2DPolygon(nPolyNum, aNewXP);
591  }
592  }
593 
594  pPath->SetPathPoly(aXPP);
595  }
596 }
597 
598 
599 static void ImpMove(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/)
600 {
601  rPt.Move(*static_cast<const Size*>(p1));
602  if (pC1!=nullptr) pC1->Move(*static_cast<const Size*>(p1));
603  if (pC2!=nullptr) pC2->Move(*static_cast<const Size*>(p1));
604 }
605 
607 {
609  OUString aStr(SvxResId(STR_EditMove));
612  EndUndo();
613  AdjustMarkHdl();
614 }
615 
616 static void ImpResize(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* p2, const void* p3, const void* /*p4*/)
617 {
618  ResizePoint(rPt,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3));
619  if (pC1!=nullptr) ResizePoint(*pC1,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3));
620  if (pC2!=nullptr) ResizePoint(*pC2,*static_cast<const Point*>(p1),*static_cast<const Fraction*>(p2),*static_cast<const Fraction*>(p3));
621 }
622 
623 void SdrPolyEditView::ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
624 {
626  OUString aStr(SvxResId(STR_EditResize));
628  ImpTransformMarkedPoints(ImpResize,&rRef,&xFact,&yFact);
629  EndUndo();
630  AdjustMarkHdl();
631 }
632 
633 static void ImpRotate(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* /*p2*/, const void* p3, const void* p4)
634 {
635  RotatePoint(rPt,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4));
636  if (pC1!=nullptr) RotatePoint(*pC1,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4));
637  if (pC2!=nullptr) RotatePoint(*pC2,*static_cast<const Point*>(p1),*static_cast<const double*>(p3),*static_cast<const double*>(p4));
638 }
639 
640 void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, long nAngle)
641 {
643  OUString aStr(SvxResId(STR_EditResize));
645  double nSin = sin(nAngle * F_PI18000);
646  double nCos = cos(nAngle * F_PI18000);
647  ImpTransformMarkedPoints(ImpRotate,&rRef,&nAngle,&nSin,&nCos);
648  EndUndo();
649  AdjustMarkHdl();
650 }
651 
652 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool bSetMarkedSegmentsKindPossible
Definition: svdpoev.hxx:33
bool IsClosedObj() const
Definition: svdobj.hxx:787
B2VectorContinuity getContinuityInPoint(const B2DPolygon &rCandidate, sal_uInt32 nIndex)
void SortMarkedObjects() const
Definition: svdmrkv.hxx:250
SdrPolyEditView(SdrModel &rSdrModel, OutputDevice *pOut)
Definition: svdpoev.cxx:48
long FRound(double fVal)
static void ImpMove(Point &rPt, Point *pC1, Point *pC2, const void *p1, const void *, const void *, const void *)
Definition: svdpoev.cxx:599
const SdrUShortCont & GetMarkedPoints() const
Definition: svdmark.hxx:109
SVX_DLLPRIVATE void ImpCheckPolyPossibilities()
Definition: svdpoev.cxx:60
void DeleteMarkedPoints() override
Definition: svdpoev.cxx:286
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)
Definition: svdtrans.hxx:106
void RotateMarkedPoints(const Point &rRef, long nAngle)
Definition: svdpoev.cxx:640
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1031
bool ImpIsFrameHandles() const
Definition: svdmrkv.cxx:569
void ForcePossibilities() const
Definition: svdedtv.hxx:162
void RipUpAtMarkedPoints() override
Definition: svdpoev.cxx:340
SdrPathSegmentKind GetMarkedSegmentsKind() const override
Definition: svdpoev.cxx:275
void BegUndo()
Definition: svdedtv.hxx:179
OUString const & GetDescriptionOfMarkedPoints() const
Definition: svdmrkv.hxx:253
void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) override
Definition: svdpoev.cxx:224
SVX_DLLPRIVATE void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void *p1, const void *p2=nullptr, const void *p3=nullptr, const void *p4=nullptr)
Definition: svdpoev.cxx:523
std::set< sal_uInt16 > SdrUShortCont
Definition: svdmark.hxx:35
virtual void BrkAction() override
Definition: svdmrkv.cxx:304
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:423
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:358
SdrPathSmoothKind GetMarkedPointsSmooth() const override
Definition: svdpoev.cxx:263
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
SdrPathSmoothKind eMarkedPointsSmooth
Definition: svdpoev.hxx:35
B2VectorContinuity
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
this class implements some helper functions to edit a B2DPolyPolygon
void ResizeMarkedPoints(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
Definition: svdpoev.cxx:623
bool IsClosed() const
Definition: svdopath.hxx:144
SdrObject * RipPoint(sal_uInt32 nHdlNum, sal_uInt32 &rNewPt0Index)
Definition: svdopath.cxx:2627
void ForceUndirtyMrkPnt() const
Definition: svdmrkv.hxx:158
bool IsDeleteMarkedPointsPossible() const override
Definition: svdpoev.cxx:281
void EndUndo()
Definition: svdedtv.cxx:278
SdrObjClosedKind GetMarkedObjectsClosedState() const override
Definition: svdpoev.cxx:485
virtual bool HasMarkedPoints() const
Definition: svdmrkv1.cxx:68
SdrObjList * GetObjList() const
Return current List.
Definition: svdpagv.hxx:176
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:67
Everything a View needs to know about a selected object.
Definition: svdmark.hxx:43
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:183
SVX_DLLPRIVATE void ImpResetPolyPossibilityFlags()
Definition: svdpoev.cxx:40
SdrPathSegmentKind eMarkedSegmentsKind
Definition: svdpoev.hxx:36
static void ImpResize(Point &rPt, Point *pC1, Point *pC2, const void *p1, const void *p2, const void *p3, const void *)
Definition: svdpoev.cxx:616
virtual void MarkListHasChanged() override
Definition: svdedtv.cxx:354
#define DBG_ASSERT(sCon, aError)
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
Definition: svdopath.cxx:2746
uno_Any a
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:249
virtual ~SdrPolyEditView() override
Definition: svdpoev.cxx:56
SdrPageView * GetPageView() const
Definition: svdmark.hxx:69
void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) override
Definition: svdpoev.cxx:171
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:823
sal_uInt16 GetSize() const
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:436
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: svdopath.cxx:1971
bool bSetMarkedPointsSmoothPossible
Definition: svdpoev.hxx:32
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
Definition: svdtrans.hxx:114
bool UnmarkAllPoints()
Definition: svdmrkv.hxx:332
sal_uInt32 count() const
bool IsOpenCloseMarkedObjectsPossible() const override
Definition: svdpoev.cxx:455
bool IsSetMarkedSegmentsKindPossible() const override
Definition: svdpoev.cxx:269
bool IsRipUpAtMarkedPointsPossible() const override
Definition: svdpoev.cxx:415
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
Definition: svdmrkv.cxx:2343
static void ImpRotate(Point &rPt, Point *pC1, Point *pC2, const void *p1, const void *, const void *p3, const void *p4)
Definition: svdpoev.cxx:633
#define F_PI18000
void MoveMarkedPoints(const Size &rSiz)
Definition: svdpoev.cxx:606
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:139
void Move(long nHorzMove, long nVertMove)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Definition: svdmrkv.cxx:1673
SdrMark * GetSdrMarkByIndex(size_t nNum) const
Definition: svdmrkv.hxx:247
bool IsSetMarkedPointsSmoothPossible() const override
Definition: svdpoev.cxx:257
SdrModel * GetModel() const
Definition: svdpntv.hxx:271
aStr
void CheckPolyPossibilitiesHelper(SdrMark *pM, bool &b1stSmooth, bool &b1stSegm, bool &bCurve, bool &bSmoothFuz, bool &bSegmFuz, basegfx::B2VectorContinuity &eSmooth)
Definition: svdpoev.cxx:82