27#include <svx/strings.hrc>
68 bool b1stSmooth(
true);
71 bool bSmoothFuz(
false);
75 for(
size_t nMarkNum = 0; nMarkNum < nMarkCount; ++nMarkNum)
94 const bool bClosed(pPath->
IsClosed());
102 for (
const auto& rPt : rPts)
104 sal_uInt32 nNum(rPt);
105 sal_uInt32 nPolyNum, nPntNum;
107 if(PolyPolygonEditor::GetRelativePolyPoint(pPath->
GetPathPoly(), nNum, nPolyNum, nPntNum))
110 bool bCanSegment(bClosed || nPntNum < aLocalPolygon.
count() - 1);
130 if(!bSegmFuz && bCanSegment)
141 bSegmFuz = (bCrv != bCurve);
147 if(!b1stSmooth && !bSmoothFuz)
165 if(!b1stSegm && !bSegmFuz)
202 for(
size_t nMarkNum(nMarkCount); nMarkNum > 0;)
236 for(
size_t nMarkNum=nMarkCount; nMarkNum > 0;)
302 for (
size_t nMarkNum=nMarkCount; nMarkNum>0;)
323 AddUndo(
GetModel().GetSdrUndoFactory().CreateUndoDeleteObject(*pPath));
347 for(
size_t nMarkNum = nMarkCount; nMarkNum > 0;)
359 bool bCorrectionFlag(
false);
364 sal_uInt32 nNewPt0Idx(0);
378 DBG_ASSERT(!bCorrectionFlag,
"Multiple index corrections at SdrPolyEditView::RipUp().");
381 bCorrectionFlag =
true;
384 for(
const auto& rPt : rPts)
386 sal_uInt32 nPntNum(rPt);
387 nPntNum += nNewPt0Idx;
394 aReplaceSet.
insert(
static_cast<sal_uInt16
>(nPntNum) );
396 rPts.swap(aReplaceSet);
415 for(
size_t a = 0;
a < nMarkCount; ++
a)
420 if (!pMarkedPathObject)
424 if (rSelectedPoints.
empty())
429 if(1 == rPathPolyPolygon.
count())
434 const sal_uInt16 nPointCount(aPathPolygon.
GetSize());
439 || std::any_of(rSelectedPoints.
begin(), rSelectedPoints.
end(),
440 [nPointCount](
const sal_uInt16 nMarkedPointNum) {
441 return nMarkedPointNum > 0 && nMarkedPointNum < nPointCount - 1;
455 for(
size_t a = 0;
a < nMarkCount; ++
a)
460 if(pMarkedPathObject)
465 const sal_uInt16 nPolygonCount(aPathPolyPolygon.
Count());
467 for(sal_uInt16 b(0); !bRetval && b < nPolygonCount; b++)
470 const sal_uInt16 nPointCount(rPathPolygon.
GetSize());
472 bRetval = (nPointCount >= 3);
486 for(
size_t a = 0; !(bOpen && bClosed) &&
a < nMarkCount; ++
a)
491 if(pMarkedPathObject)
523 for (
size_t nm=0; nm<nMarkCount; ++nm)
540 for (
const auto& rPt : rPts)
542 sal_uInt32 nPt = rPt;
543 sal_uInt32 nPolyNum, nPointNum;
545 if(PolyPolygonEditor::GetRelativePolyPoint(aXPP, nPt, nPolyNum, nPointNum))
551 Point aPos, aC1, aC2;
572 (*pTrFunc)(aPos,&aC1,&aC2,p1,p2,p3,p4);
596 rPt.
Move(*
static_cast<const Size*
>(p1));
597 if (pC1!=
nullptr) pC1->
Move(*
static_cast<const Size*
>(p1));
598 if (pC2!=
nullptr) pC2->
Move(*
static_cast<const Size*
>(p1));
630 RotatePoint(rPt,*
static_cast<const Point*
>(p1),*
static_cast<const double*
>(p3),*
static_cast<const double*
>(p4));
631 if (pC1!=
nullptr)
RotatePoint(*pC1,*
static_cast<const Point*
>(p1),*
static_cast<const double*
>(p3),*
static_cast<const double*
>(p4));
632 if (pC2!=
nullptr)
RotatePoint(*pC2,*
static_cast<const Point*
>(p1),*
static_cast<const double*
>(p3),*
static_cast<const double*
>(p4));
constexpr tools::Long Y() const
void Move(tools::Long nHorzMove, tools::Long nVertMove)
constexpr tools::Long X() const
bool IsUndoEnabled() const
virtual void MarkListHasChanged() override
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
void ForcePossibilities() const
bool ImpIsFrameHandles() const
void SortMarkedObjects() const
OUString const & GetDescriptionOfMarkedPoints() const
virtual bool HasMarkedPoints() const
size_t GetMarkedObjectCount() const
void ForceUndirtyMrkPnt() const
SdrMark * GetSdrMarkByIndex(size_t nNum) const
virtual void BrkAction() override
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Everything a View needs to know about a selected object.
SdrPageView * GetPageView() const
SdrObject * GetMarkedSdrObj() const
const SdrUShortCont & GetMarkedPoints() const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
SdrObjList * GetObjList() const
Return current List.
SdrModel & GetModel() const
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
rtl::Reference< SdrPathObj > RipPoint(sal_uInt32 nHdlNum, sal_uInt32 &rNewPt0Index)
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
const basegfx::B2DPolyPolygon & GetPathPoly() const
bool IsRipUpAtMarkedPointsPossible() const override
void CheckPolyPossibilitiesHelper(SdrMark *pM, bool &b1stSmooth, bool &b1stSegm, bool &bCurve, bool &bSmoothFuz, bool &bSegmFuz, basegfx::B2VectorContinuity &eSmooth)
SVX_DLLPRIVATE void ImpCheckPolyPossibilities()
virtual ~SdrPolyEditView() override
bool bSetMarkedSegmentsKindPossible
void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) override
void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) override
SVX_DLLPRIVATE void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void *p1, const void *p2=nullptr, const void *p3=nullptr, const void *p4=nullptr)
void MoveMarkedPoints(const Size &rSiz)
bool bSetMarkedPointsSmoothPossible
SdrPathSmoothKind GetMarkedPointsSmooth() const override
bool IsOpenCloseMarkedObjectsPossible() const override
void DeleteMarkedPoints() override
SVX_DLLPRIVATE void ImpResetPolyPossibilityFlags()
SdrObjClosedKind GetMarkedObjectsClosedState() const override
void RipUpAtMarkedPoints() override
SdrPathSegmentKind eMarkedSegmentsKind
SdrPathSmoothKind eMarkedPointsSmooth
bool IsSetMarkedPointsSmoothPossible() const override
SdrPolyEditView(SdrModel &rSdrModel, OutputDevice *pOut)
SdrPathSegmentKind GetMarkedSegmentsKind() const override
void RotateMarkedPoints(const Point &rRef, Degree100 nAngle)
bool IsDeleteMarkedPointsPossible() const override
void ResizeMarkedPoints(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
bool IsSetMarkedSegmentsKindPossible() const override
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon &rPolygon)
bool isPrevControlPointUsed(sal_uInt32 nIndex) const
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
bool isNextControlPointUsed(sal_uInt32 nIndex) const
void setPrevControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void setNextControlPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint getPrevControlPoint(sal_uInt32 nIndex) const
basegfx::B2DPoint getNextControlPoint(sal_uInt32 nIndex) const
const_reverse_iterator rend() const
std::vector< Value >::const_reverse_iterator const_reverse_iterator
const_iterator begin() const
const_reverse_iterator rbegin() const
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
this class implements some helper functions to edit a B2DPolyPolygon
const basegfx::B2DPolyPolygon & GetPolyPolygon() const
bool SetPointsSmooth(basegfx::B2VectorContinuity eFlags, const o3tl::sorted_vector< sal_uInt16 > &rAbsPoints)
returns true if the B2DPolyPolygon was changed.
bool DeletePoints(const o3tl::sorted_vector< sal_uInt16 > &rAbsPoints)
returns true if the B2DPolyPolygon was changed.
bool SetSegmentsKind(SdrPathSegmentKind eKind, const o3tl::sorted_vector< sal_uInt16 > &rAbsPoints)
returns true if the B2DPolyPolygon was changed.
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
tools::Long FRound(double fVal)
B2VectorContinuity getContinuityInPoint(const B2DPolygon &rCandidate, sal_uInt32 nIndex)
static void ImpRotate(Point &rPt, Point *pC1, Point *pC2, const void *p1, const void *, const void *p3, const void *p4)
static void ImpResize(Point &rPt, Point *pC1, Point *pC2, const void *p1, const void *p2, const void *p3, const void *)
static void ImpMove(Point &rPt, Point *pC1, Point *pC2, const void *p1, const void *, const void *, const void *)
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
void ResizePoint(Point &rPnt, const Point &rRef, const Fraction &xFract, const Fraction &yFract)