29#include <svx/strings.hrc>
46 meConstraint(eConstr),
56 for(
size_t nObjs = 0; nObjs < nCnt; ++nObjs)
71 for(
size_t nObjs = 0; nObjs < nCnt; ++nObjs)
102 maGrp.push_back(aNewUnit);
118 const sal_uInt32 nCnt(
maGrp.size());
121 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
143 const sal_uInt32 nCnt(
maGrp.size());
159 for(nOb=0;nOb<nCnt;nOb++)
167 std::make_unique<E3dRotateUndoAction>(
186 const sal_uInt32 nCnt(
maGrp.size());
188 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
222 const sal_uInt32 nCnt(
maGrp.size());
225 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
233 const sal_uInt32 nPlyCnt(aCandidate.
count());
239 if(
nullptr != pScene)
252 aResult.
append(aPolyPolygon);
260 std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(
262 std::move(aResult)));
279 const sal_uInt32 nCnt(
maGrp.size());
284 const E3dScene* pScene(
maGrp[0].mr3DObj.getRootE3dSceneFromE3dObject());
286 if(
nullptr == pScene)
292 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
298 aObjCenter = aTransform * aObjCenter;
313 aInverseObjectTransform.
invert();
314 aRotCenter2D = aInverseObjectTransform * aRotCenter2D;
319 aInverseViewToEye.
invert();
320 aRotCenter3D = aInverseViewToEye * aRotCenter3D;
340 sal_uInt16 nModifier = 0;
343 const MouseEvent& rLastMouse = pDragView->GetMouseEvent();
348 const sal_uInt32 nCnt(
maGrp.size());
350 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
353 double fWAngle, fHAngle;
368 fWAngle = 90.0 *
static_cast<double>(rPnt.
X() -
maLastPos.
X())
370 fHAngle = 90.0 *
static_cast<double>(rPnt.
Y() -
maLastPos.
Y())
380 fWAngle =
static_cast<double>((
static_cast<tools::Long>(fWAngle) + nSnap/2) / nSnap * nSnap);
381 fHAngle =
static_cast<double>((
static_cast<tools::Long>(fHAngle) + nSnap/2) / nSnap * nSnap);
393 aRotMat.
rotate(0.0, 0.0, fWAngle);
395 aRotMat.
rotate(0.0, fWAngle, 0.0);
400 aRotMat.
rotate(0.0, fWAngle, 0.0);
402 aRotMat.
rotate(0.0, 0.0, fWAngle);
406 aRotMat.
rotate(fHAngle, 0.0, 0.0);
411 if(
nullptr != pScene)
417 aInverseOrientation.
invert();
422 aTransMat *= aRotMat;
424 aTransMat *= aInverseOrientation;
449 return PointerStyle::Rotate;
463 meWhatDragHdl(eDrgHdl)
518 const sal_uInt32 nCnt(
maGrp.size());
521 sal_uInt16 nModifier(0);
525 const MouseEvent& rLastMouse = pDragView->GetMouseEvent();
529 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
534 if(
nullptr != pScene)
544 aInverseSceneTransform.
invert();
545 aGlobalMoveHead2D = aInverseSceneTransform * aGlobalMoveHead2D;
546 aGlobalMoveTail2D = aInverseSceneTransform * aGlobalMoveTail2D;
551 aInverseViewToEye.
invert();
553 aMoveHead3D = aInverseViewToEye * aMoveHead3D;
554 aMoveTail3D = aInverseViewToEye * aMoveTail3D;
559 double fZwi = aMoveHead3D.
getY();
560 aMoveHead3D.
setY(aMoveHead3D.
getZ());
561 aMoveHead3D.
setZ(fZwi);
563 fZwi = aMoveTail3D.
getY();
564 aMoveTail3D.
setY(aMoveTail3D.
getZ());
565 aMoveTail3D.
setZ(fZwi);
570 aInverseOrientation.
invert();
573 aMoveHead3D = aCompleteTrans * aMoveHead3D;
574 aMoveTail3D = aCompleteTrans* aMoveTail3D;
603 const sal_uInt32 nCnt(
maGrp.size());
605 for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
611 if(
nullptr != pScene)
617 basegfx::B2DPoint aGlobalScaleStart2D(
static_cast<double>(aStartPos.
X()),
static_cast<double>(aStartPos.
Y()));
618 basegfx::B2DPoint aGlobalScaleNext2D(
static_cast<double>(rPnt.
X()),
static_cast<double>(rPnt.
Y()));
622 aInverseSceneTransform.
invert();
623 aGlobalScaleStart2D = aInverseSceneTransform * aGlobalScaleStart2D;
624 aGlobalScaleNext2D = aInverseSceneTransform * aGlobalScaleNext2D;
625 aGlobalScaleFixPos2D = aInverseSceneTransform * aGlobalScaleFixPos2D;
632 aInverseViewToEye.
invert();
658 if(aScaleVec.
getX() != 0.0)
667 if(aScaleVec.
getY() != 0.0)
679 if(fabs(aScaleVec.
getX()) > fabs(aScaleVec.
getY()))
693 aInverseOrientation.
invert();
701 aNewTrans *= aInverseOrientation;
729 return PointerStyle::Move;
Helper for 3d object changes affecting 2d geometry.
basegfx::B3DHomMatrix maTransform
basegfx::B3DHomMatrix maDisplayTransform
basegfx::B3DHomMatrix maInitTransform
basegfx::B3DHomMatrix maInvDisplayTransform
basegfx::B3DPolyPolygon maWireframePoly
E3dDragMethod(SdrDragView &rView, const SdrMarkList &rMark, E3dDragConstraint eConstr, bool bFull)
virtual void MoveSdrDrag(const Point &rPnt) override
tools::Rectangle maFullBound
virtual bool EndSdrDrag(bool bCopy) override
virtual void CreateOverlayGeometry(sdr::overlay::OverlayManager &rOverlayManager, const sdr::contact::ObjectContact &rObjectContact) override
virtual void CancelSdrDrag() override
virtual OUString GetSdrDragComment() const override
E3dDragConstraint meConstraint
::std::vector< E3dDragMethodUnit > maGrp
virtual bool BeginSdrDrag() override
E3dDragMove(SdrDragView &rView, const SdrMarkList &rMark, SdrHdlKind eDrgHdl, E3dDragConstraint eConstr, bool bFull)
virtual PointerStyle GetSdrDragPointer() const override
virtual void MoveSdrDrag(const Point &rPnt) override
virtual PointerStyle GetSdrDragPointer() const override
virtual void MoveSdrDrag(const Point &rPnt) override
E3dDragRotate(SdrDragView &rView, const SdrMarkList &rMark, E3dDragConstraint eConstr, bool bFull)
basegfx::B3DPoint maGlobalCenter
basegfx::B3DPolyPolygon CreateWireframe() const
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
const basegfx::B3DRange & GetBoundVolume() const
const basegfx::B3DHomMatrix & GetTransform() const
virtual E3dScene * getRootE3dSceneFromE3dObject() const
const basegfx::B3DHomMatrix & GetFullTransform() const
E3dScene * getParentE3dSceneFromE3dObject() const
Derived class of SdrView to edit 3D objects.
sal_uInt16 GetModifier() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
virtual const tools::Rectangle & GetSnapRect() const override
void insertNewlyCreatedOverlayObjectForSdrDragMethod(std::unique_ptr< sdr::overlay::OverlayObject > pOverlayObject, const sdr::contact::ObjectContact &rObjectContact, sdr::overlay::OverlayManager &rOverlayManager)
SdrDragView & getSdrDragView()
void NextMove(const Point &rPnt)
const Point & GetStart() const
void SetRef1(const Point &pt)
bool IsUndoEnabled() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
bool IsRotateAllowed(bool b90Deg=false) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
sdr::contact::ViewContact & GetViewContact() const
bool HasLineStyle() const
bool HasFillStyle() const
bool HasMarkedObjPageView() const
SdrPageView * GetSdrPageView() const
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void rotate(double fAngleX, double fAngleY, double fAngleZ)
void translate(double fX, double fY, double fZ)
void scale(double fX, double fY, double fZ)
void transform(const basegfx::B3DHomMatrix &rMatrix)
B3DPoint getCenter() const
OUString SvxResId(TranslateId aId)
constexpr sal_uInt16 KEY_MOD2
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
constexpr double deg2rad(double v)
E3dObject * DynCastE3dObject(SdrObject *pObj)
Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle,...
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.