22 #include <svx/strings.hrc>
39 #include <com/sun/star/uno/Sequence.h>
42 #include <rtl/ustrbuf.hxx>
49 return std::make_unique<sdr::properties::E3dProperties>(*this);
154 if(
nullptr == pScene)
162 basegfx::B2DPoint aScaleCenter2D(static_cast<double>(rRef.X()), static_cast<double>(rRef.Y()));
165 aInverseSceneTransform.
invert();
166 aScaleCenter2D = aInverseSceneTransform * aScaleCenter2D;
168 basegfx::B3DPoint aScaleCenter3D(aScaleCenter2D.getX(), aScaleCenter2D.getY(), 0.5);
169 basegfx::B3DHomMatrix aInverseViewToEye(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection());
171 aInverseViewToEye.
invert();
172 aScaleCenter3D = aInverseViewToEye * aScaleCenter3D;
175 double fScaleX(xFact);
176 double fScaleY(yFact);
180 aInverseOrientation.
invert();
184 aTrans *= aViewInfo3D.getOrientation();
185 aTrans.
translate(-aScaleCenter3D.getX(), -aScaleCenter3D.getY(), -aScaleCenter3D.getZ());
186 aTrans.
scale(fScaleX, fScaleY, 1.0);
187 aTrans.
translate(aScaleCenter3D.getX(), aScaleCenter3D.getY(), aScaleCenter3D.getZ());
188 aTrans *= aInverseOrientation;
190 aTrans *= aFullTransform;
206 if(
nullptr == pScene)
216 if(
nullptr != pParent)
219 aInvDispTransform.
invert();
226 aEyeVol.
transform(aViewInfo3D.getOrientation());
233 static_cast<double>(rSize.
Width()) * aEyeVol.getWidth() /
static_cast<double>(aRect.
GetWidth()),
234 static_cast<double>(-rSize.
Height()) * aEyeVol.getHeight() /
static_cast<double>(aRect.
GetHeight()),
240 aInverseOrientation.
invert();
243 aMove = aCompleteTrans * aMove;
244 aPos = aCompleteTrans * aPos;
248 aTranslate.
translate(aMove.getX() - aPos.getX(), aMove.getY() - aPos.getY(), aMove.getZ() - aPos.getZ());
265 if(
nullptr != pParent)
282 if(
nullptr != pParent)
304 if(!xLocalSequence.empty())
306 const uno::Sequence< beans::PropertyValue > aEmptyParameters;
309 aRetval = xLocalSequence.getB3DRange(aLocalViewInformation3D);
348 if(
nullptr != pParent)
350 aNewFullTransformation = pParent->
GetFullTransform() * aNewFullTransformation;
394 if (!aName.isEmpty())
401 return sName.makeStringAndClear();
407 return SvxResId(STR_ObjNamePluralObj3d);
412 return new E3dObject(rTargetModel, *
this);
417 return std::make_unique<E3DObjGeoData>();
449 aRotateZ.
rotate(0.0, 0.0, fAngleInRad);
461 return std::make_unique<sdr::properties::E3dCompoundProperties>(*this);
481 const uno::Sequence< beans::PropertyValue > aEmptyParameters;
505 const uno::Sequence< beans::PropertyValue > aEmptyParameters;
517 for(sal_uInt32
a(0);
a < 8;
a++)
523 case 0 : aPos3D.setX(aBoundVolume.
getMinX()); aPos3D.setY(aBoundVolume.
getMinY()); aPos3D.setZ(aBoundVolume.
getMinZ());
break;
524 case 1 : aPos3D.setX(aBoundVolume.
getMinX()); aPos3D.setY(aBoundVolume.
getMinY()); aPos3D.setZ(aBoundVolume.
getMaxZ());
break;
525 case 2 : aPos3D.setX(aBoundVolume.
getMinX()); aPos3D.setY(aBoundVolume.
getMaxY()); aPos3D.setZ(aBoundVolume.
getMinZ());
break;
526 case 3 : aPos3D.setX(aBoundVolume.
getMinX()); aPos3D.setY(aBoundVolume.
getMaxY()); aPos3D.setZ(aBoundVolume.
getMaxZ());
break;
527 case 4 : aPos3D.setX(aBoundVolume.
getMaxX()); aPos3D.setY(aBoundVolume.
getMinY()); aPos3D.setZ(aBoundVolume.
getMinZ());
break;
528 case 5 : aPos3D.setX(aBoundVolume.
getMaxX()); aPos3D.setY(aBoundVolume.
getMinY()); aPos3D.setZ(aBoundVolume.
getMaxZ());
break;
529 case 6 : aPos3D.setX(aBoundVolume.
getMaxX()); aPos3D.setY(aBoundVolume.
getMaxY()); aPos3D.setZ(aBoundVolume.
getMinZ());
break;
530 case 7 : aPos3D.setX(aBoundVolume.
getMaxX()); aPos3D.setY(aBoundVolume.
getMaxY()); aPos3D.setZ(aBoundVolume.
getMaxZ());
break;
549 if(aPolyPolygon.
count())
551 rHdlList.
AddHdl(std::make_unique<E3dVolumeMarker>(aPolyPolygon));
562 const uno::Sequence< beans::PropertyValue > aEmptyParameters;
579 if(xLocalSequence.empty())
590 aBoundVolume.getMinX(), aBoundVolume.getMinY(),
591 aBoundVolume.getMaxX(), aBoundVolume.getMaxY());
595 aSnapRange.transform(rVCScene.getObjectTransformation());
599 sal_Int32(floor(aSnapRange.getMinX())), sal_Int32(floor(aSnapRange.getMinY())),
600 sal_Int32(ceil(aSnapRange.getMaxX())), sal_Int32(ceil(aSnapRange.getMaxY())));
611 const uno::Sequence< beans::PropertyValue > aEmptyParameters;
621 aRetval.
transform(rVCScene.getObjectTransformation());
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual OUString TakeObjNameSingul() const override
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
virtual void SetTransformChanged()
virtual void StructureChanged() override
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
void SetGlueReallyAbsolute(bool bOn)
double toRadians(Degree10 x)
basegfx::B3DRange maLocalBoundVol
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
const basegfx::B3DHomMatrix & GetTransform() const
virtual const tools::Rectangle & GetSnapRect() const override
B3DPolyPolygon createCubePolyPolygonFromB3DRange(const B3DRange &rRange)
All geometrical data of an arbitrary object for use in undo/redo.
void scale(double fX, double fY, double fZ)
sdr::contact::ViewContact & GetViewContact() const
constexpr tools::Long Width() const
basegfx::B3DHomMatrix maTransformation
virtual SdrInventor GetObjInventor() const override
virtual SdrObjKind GetObjIdentifier() const override
virtual SdrObjKind GetObjIdentifier() const override
OUString SvxResId(const char *pId)
virtual void StructureChanged()
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
virtual bool IsBreakObjPossible()
tools::Rectangle maSnapRect
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
B2IRange fround(const B2DRange &rRange)
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
basegfx::B2DPolyPolygon TransformToScreenCoor(const basegfx::B3DPolyPolygon &rCandidate)
E3dScene * getParentE3dSceneFromE3dObject() const
virtual E3dObject * CloneSdrObject(SdrModel &rTargetModel) const override
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
void BroadcastObjectChange() const
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
SdrObjUserCall * m_pUserCall
void transform(const basegfx::B2DHomMatrix &rMatrix)
const basegfx::B3DRange & GetBoundVolume() const
const basegfx::B3DHomMatrix & GetFullTransform() const
virtual basegfx::B3DRange RecalcBoundVolume() const
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
void translate(double fX, double fY, double fZ)
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
E3dObject(SdrModel &rSdrModel)
constexpr tools::Long Height() const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual ~E3dCompoundObject() override
virtual void NbcMove(const Size &rSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Helper for 3d object changes affecting 2d geometry.
basegfx::B2DHomMatrix maTransformation
void rotate(double fAngleX, double fAngleY, double fAngleZ)
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
E3dCompoundObject(SdrModel &rSdrModel, E3dCompoundObject const &rSource)
virtual void SetSelected(bool bNew)
virtual E3dScene * getRootE3dSceneFromE3dObject() const
virtual std::unique_ptr< SdrAttrObj, SdrObjectFreeOp > GetBreakObj()
virtual void SetChanged()
virtual ~E3dObject() override
virtual E3dCompoundObject * CloneSdrObject(SdrModel &rTargetModel) const override
basegfx::B3DPolyPolygon CreateWireframe() const
virtual E3dScene * getRootE3dSceneFromE3dObject() const override
void InvalidateBoundVolume()
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
virtual OUString TakeObjNamePlural() const override
basegfx::B3DHomMatrix maFullTransform
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
E3dScene * fillViewInformation3DForCompoundObject(drawinglayer::geometry::ViewInformation3D &o_rViewInformation3D, const E3dCompoundObject &rCandidate)
support for getting a ViewInformation3D for a given CompoudObject3D with correct ObjectTransformation...