21#include <svx/strings.hrc>
41std::unique_ptr<sdr::contact::ViewContact> E3dExtrudeObj::CreateObjectSpecificViewContact()
43 return std::make_unique<sdr::contact::ViewContactOfE3dExtrude>(*
this);
46std::unique_ptr<sdr::properties::BaseProperties> E3dExtrudeObj::CreateObjectSpecificProperties()
48 return std::make_unique<sdr::properties::E3dExtrudeProperties>(*
this);
53E3dExtrudeObj::E3dExtrudeObj(
55 const E3dDefaultAttributes& rDefault,
59 maExtrudePolygon(
std::move(aPP))
63 aMirrorY.
scale(1.0, -1.0);
64 maExtrudePolygon.transform(aMirrorY);
67 SetDefaultAttributes(rDefault);
70 GetProperties().SetObjectItemDirect(
makeSvx3DDepthItem(
static_cast<sal_uInt32
>(fDepth + 0.5)));
73E3dExtrudeObj::E3dExtrudeObj(
SdrModel& rSdrModel)
77 const E3dDefaultAttributes aDefault;
79 SetDefaultAttributes(aDefault);
82E3dExtrudeObj::E3dExtrudeObj(
SdrModel& rSdrModel, E3dExtrudeObj
const & rSource)
86 const E3dDefaultAttributes aDefault;
88 SetDefaultAttributes(aDefault);
90 maExtrudePolygon = rSource.maExtrudePolygon;
93E3dExtrudeObj::~E3dExtrudeObj()
97void E3dExtrudeObj::SetDefaultAttributes(
const E3dDefaultAttributes& rDefault)
100 GetProperties().SetObjectItemDirect(
Svx3DSmoothLidsItem(rDefault.GetDefaultExtrudeSmoothFrontBack()));
102 GetProperties().SetObjectItemDirect(Svx3DCloseFrontItem(rDefault.GetDefaultExtrudeCloseFront()));
103 GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(rDefault.GetDefaultExtrudeCloseBack()));
106 GetProperties().SetObjectItemDirect(Svx3DTextureProjectionXItem(1));
107 GetProperties().SetObjectItemDirect(Svx3DTextureProjectionYItem(1));
110SdrObjKind E3dExtrudeObj::GetObjIdentifier()
const
117 return new E3dExtrudeObj(rTargetModel, *
this);
124 if(maExtrudePolygon != rNew)
126 maExtrudePolygon = rNew;
133OUString E3dExtrudeObj::TakeObjNameSingul()
const
138 if (!
aName.isEmpty())
147OUString E3dExtrudeObj::TakeObjNamePlural()
const
149 return SvxResId(STR_ObjNamePluralExtrude3d);
152bool E3dExtrudeObj::IsBreakObjPossible()
162 if(maExtrudePolygon.count())
165 aTemp.removeDoublePoints();
177 if(aFrontSide.
count())
179 aBackSide = aFrontSide;
181 if(GetExtrudeDepth())
185 if(100 != GetPercentBackScale())
188 const double fScaleFactor(GetPercentBackScale() / 100.0);
192 aTransform.
translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ());
193 aTransform.
scale(fScaleFactor, fScaleFactor, fScaleFactor);
194 aTransform.
translate(aCenter.getX(), aCenter.getY(), aCenter.getZ());
198 aTransform.
translate(0.0, 0.0,
static_cast<double>(GetExtrudeDepth()));
204 if(aBackSide.
count())
212 pPathObj->SetMergedItemSet(aSet);
void scale(double fX, double fY)
void translate(double fX, double fY, double fZ)
void scale(double fX, double fY, double fZ)
void transform(const basegfx::B3DHomMatrix &rMatrix)
OUString SvxResId(TranslateId aId)
virtual OUString GetName() const override
B3DPolyPolygon createB3DPolyPolygonFromB2DPolyPolygon(const B2DPolyPolygon &rCandidate, double fZCoordinate)
B2VectorOrientation getOrientation(const B2DPolygon &rCandidate)
B2DPolyPolygon correctOrientations(const B2DPolyPolygon &rCandidate)
B2DRange getRange(const B2DPolygon &rCandidate)
@ PolyLine
polygon, PolyPolygon
SfxUInt32Item makeSvx3DDepthItem(sal_uInt32 nVal)