24 #include <svx/strings.hrc>
42 #include <rtl/ustrbuf.hxx>
55 ImpRemap3DDepth(sal_uInt32 nOrdNum,
double fMinimalDepth);
56 explicit ImpRemap3DDepth(sal_uInt32 nOrdNum);
59 bool operator<(
const ImpRemap3DDepth& rComp)
const;
61 sal_uInt32 GetOrdNum()
const {
return mnOrdNum; }
62 bool IsScene()
const {
return mbIsScene; }
67 ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum,
double fMinimalDepth)
74 ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum)
116 for(
size_t a = 0;
a < nObjCount; ++
a)
122 if(
auto pCompoundObj = dynamic_cast< const E3dCompoundObject*>(pCandidate))
126 ImpRemap3DDepth aEntry(
a, fMinimalDepth);
132 ImpRemap3DDepth aEntry(
a);
158 return std::make_unique<sdr::properties::E3dSceneProperties>(*this);
166 return std::make_unique<sdr::contact::ViewContactOfE3dScene>(*this);
174 bDrawOnlySelected(false),
175 mbSkipSettingDirty(false)
185 _control87( _MCW_EM, _MCW_EM );
200 if(fabs(fNew - aActualPosition.getZ()) > 1.0)
221 return const_cast< E3dScene*
>(
this);
226 return const_cast< E3dScene*
>(
this);
236 aViewInfo3D.getObjectToView()));
301 aNewSnapRect.
Move(rSize);
309 ResizeRect(aNewSnapRect, rRef, rXFact, rYFact);
364 if(
nullptr != pParent)
369 return const_cast< E3dScene*
>(
this);
382 bool bRemoveObject(
false);
384 if(
auto pScene = dynamic_cast<E3dScene*>(pObj))
387 pScene->removeAllNonSelectedObjects();
390 const size_t nObjCount(pScene->GetSubList() ? pScene->GetSubList()->GetObjCount() : 0);
395 bRemoveObject =
true;
398 else if(
auto pCompound = dynamic_cast<E3dCompoundObject*>(pObj))
400 if(!pCompound->GetSelected())
402 bRemoveObject =
true;
418 return CloneHelper< E3dScene >(rTargetModel);
456 if(
nullptr != pScene)
466 if(
nullptr != pScene)
476 if(
nullptr != pScene)
491 while(a3DIterator.
IsMore())
493 E3dObject* p3DObj(static_cast< E3dObject* >(a3DIterator.
Next()));
535 tools::Long dxOutRectHalf = std::abs(UpperLeft.X() - LowerRight.X());
537 tools::Long dyOutRectHalf = std::abs(UpperLeft.Y() - LowerRight.Y());
545 Center.setX( (UpperLeft.X() + dxOutRectHalf) - rRef.X() );
546 Center.setY( -((UpperLeft.Y() + dyOutRectHalf) - rRef.Y()) );
548 if (sn==1.0 && cs==0.0) {
549 NewCenter.setX( -Center.Y() );
550 NewCenter.setY( -Center.X() );
551 }
else if (sn==0.0 && cs==-1.0) {
552 NewCenter.setX( -Center.X() );
553 NewCenter.setY( -Center.Y() );
554 }
else if (sn==-1.0 && cs==0.0) {
555 NewCenter.setX( Center.Y() );
556 NewCenter.setY( -Center.X() );
564 NewCenter.setX( static_cast<tools::Long>(Center.X() * cs - Center.Y() * sn) );
565 NewCenter.setY( static_cast<tools::Long>(Center.X() * sn + Center.Y() * cs) );
569 Point DiffPoint = NewCenter - Center;
570 Differenz.
setWidth( DiffPoint.X() );
580 if (!aName.isEmpty())
587 return sName.makeStringAndClear();
592 return SvxResId(STR_ObjNamePluralScene3d);
634 aRotation.
rotate(0.0, 0.0, fAngleInRad);
679 while ( a3DIterator.
IsMore() )
682 DBG_ASSERT(dynamic_cast< const E3dObject*>(pObj),
"only 3D objects are allowed in scenes!");
755 if(
nullptr != dynamic_cast< const E3dObject* >(pObj))
774 if(
nullptr != dynamic_cast< const E3dObject* >(pObj))
846 if(pOldPage == pNewPage)
862 OSL_ENSURE(
false,
"E3dScene::handlePageChange invalid object list (!)");
869 return const_cast< E3dScene*
>(
this);
877 for(
size_t a = 0;
a < nObjCnt; ++
a)
885 aRetval.
expand(aLocalRange);
virtual OUString TakeObjNameSingul() const override
virtual SdrObject * RemoveObject(size_t nObjNum) override
const tools::Rectangle & GetDeviceWindow() const
void SetDeviceWindow(const tools::Rectangle &rRect)
virtual void SetBoundRectDirty() override
void SuspendReportingDirtyRects()
ProjectionType GetProjection() const
virtual SdrObjKind GetObjIdentifier() const override
void setWidth(tools::Long nWidth)
virtual void SetTransformChanged()
virtual void StructureChanged() override
void SetViewWindow(double fX, double fY, double fW, double fH)
virtual void NbcSetLayer(SdrLayerID nLayer) override
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
const Point & GetStart() const
virtual void SetTransformChanged() override
double getMinimalDepthInViewCoordinates(const E3dCompoundObject &rObject)
support extracting the minimal depth of a 3d object in its scene
virtual SdrObjList * getChildrenOfSdrObject() const override
std::vector< ImpRemap3DDepth > maVector
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual OUString TakeObjNamePlural() const override
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
E3dScene & operator=(const E3dScene &)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual void SetBoundRectDirty()
void SetGlueReallyAbsolute(bool bOn)
void CopyObjects(const SdrObjList &rSrcList)
double toRadians(Degree10 x)
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
virtual bool IsBreakObjPossible() override
const basegfx::B3DHomMatrix & GetTransform() const
static void Free(SdrObject *&_rpObject)
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
virtual SdrObjList * GetSubList() const override
virtual sdr::properties::BaseProperties & GetProperties() const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual const tools::Rectangle & GetSnapRect() const override
All geometrical data of an arbitrary object for use in undo/redo.
virtual bool BckCreate(SdrDragStat &rStat) override
double GetDistance() const
sdr::contact::ViewContact & GetViewContact() const
void SetAllSceneRectsDirty()
ProjectionType GetPerspective() const
basegfx::B3DHomMatrix maTransformation
virtual SdrObject * getSdrObjectFromSdrObjList() const override
std::unique_ptr< Imp3DDepthRemapper > mp3DDepthRemapper
SdrPage * getSdrPageFromSdrObject() const
OUString SvxResId(const char *pId)
virtual void StructureChanged()
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix) override
virtual bool IsBreakObjPossible()
void SetCamera(const Camera3D &rNewCamera)
void ImpCleanup3DDepthMapper()
double GetFocalLength() const
void SetOrtho4Possible(bool bOn=true)
void removeAllNonSelectedObjects()
void SetDefaultAttributes()
void TakeCreateRect(tools::Rectangle &rRect) const
virtual void SetSelected(bool bNew) override
tools::Rectangle maSnapRect
virtual void NbcResize(const Point &rRef, const Fraction &rXFact, const Fraction &rYFact) override
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
void RotateScene(const Point &rRef, double sn, double cs)
const basegfx::B3DPoint & GetViewPoint()
E3dScene(SdrModel &rSdrModel)
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
E3dScene * getParentE3dSceneFromE3dObject() const
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
virtual E3dScene * CloneSdrObject(SdrModel &rTargetModel) const override
#define DBG_ASSERT(sCon, aError)
tools::Rectangle aOutRect
virtual ~E3dScene() override
void expand(const B3DTuple &rTuple)
sal_Int32 GetPointCount() const
void SetFocalLength(double fLen)
void transform(const basegfx::B2DHomMatrix &rMatrix)
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
virtual void NbcMove(const Size &rSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
const basegfx::B3DRange & GetBoundVolume() const
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
virtual SdrObject * NbcRemoveObject(size_t nObjNum)
remove from list without delete
virtual basegfx::B3DRange RecalcBoundVolume() const override
virtual SdrObject * RemoveObject(size_t nObjNum)
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true) override
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
virtual SdrLayerID GetLayer() const
virtual SdrObject * NbcRemoveObject(size_t nObjNum) override
remove from list without delete
Imp3DDepthRemapper(E3dScene const &rScene)
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix) override
void SetActionRect(const tools::Rectangle &rR)
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
const basegfx::B3DPoint & GetPosition() const
bool operator<(const Subset &rLHS, const Subset &rRHS)
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
const basegfx::B3DPoint & GetVRP() const
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
virtual SdrPage * getSdrPageFromSdrObjList() const override
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
void SetProjection(ProjectionType ePrj)
virtual bool MovCreate(SdrDragStat &rStat) override
E3dObject & operator=(const E3dObject &rObj)
const Point & GetNow() const
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
void setHeight(tools::Long nHeight)
Helper for 3d object changes affecting 2d geometry.
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
virtual void BrkCreate(SdrDragStat &rStat) override
void rotate(double fAngleX, double fAngleY, double fAngleZ)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
virtual void SetSelected(bool bNew)
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
void SetPosition(const basegfx::B3DPoint &rNewPos)
const basegfx::B3DVector & GetVUV() const
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() 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.
B3dCamera & GetCameraSet()
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
void ResumeReportingDirtyRects()
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
virtual void NbcSetLayer(SdrLayerID nLayer)
virtual SdrObjGeoData * NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...