28std::unique_ptr<sdr::contact::ViewContact> E3dPolygonObj::CreateObjectSpecificViewContact()
30 return std::make_unique<sdr::contact::ViewContactOfE3dPolygon>(*
this);
38 SetPolyPolygon3D(rPolyPoly3D);
41 CreateDefaultNormals();
44 CreateDefaultTexture();
47E3dPolygonObj::E3dPolygonObj(
SdrModel& rSdrModel)
54E3dPolygonObj::E3dPolygonObj(
SdrModel& rSdrModel, E3dPolygonObj
const& rSource)
60 aPolyPoly3D = rSource.aPolyPoly3D;
61 aPolyNormals3D = rSource.aPolyNormals3D;
62 aPolyTexture2D = rSource.aPolyTexture2D;
63 bLineOnly = rSource.bLineOnly;
66void E3dPolygonObj::CreateDefaultNormals()
71 for (sal_uInt32
a(0);
a < aPolyPoly3D.count();
a++)
83 for (sal_uInt32 b(0); b < aPolygon.count(); b++)
89 aPolyNormals.
append(aNormals);
93 SetPolyNormals3D(aPolyNormals);
96void E3dPolygonObj::CreateDefaultTexture()
102 for (sal_uInt32
a(0);
a < aPolyPoly3D.count();
a++)
112 aNormal.setX(fabs(aNormal.getX()));
113 aNormal.setY(fabs(aNormal.getY()));
114 aNormal.setZ(fabs(aNormal.getZ()));
117 sal_uInt16 nSourceMode = 0;
120 if (aNormal.getX() <= aNormal.getY() || aNormal.getX() <= aNormal.getZ())
122 if (aNormal.getY() > aNormal.getZ())
138 for (sal_uInt32 b(0); b < aPolygon.count(); b++)
146 if (aVolume.getHeight())
147 aTex.
setX((aCandidate.getY() - aVolume.getMinY()) / aVolume.getHeight());
148 if (aVolume.getDepth())
149 aTex.
setY((aCandidate.getZ() - aVolume.getMinZ()) / aVolume.getDepth());
153 if (aVolume.getWidth())
154 aTex.
setX((aCandidate.getX() - aVolume.getMinX()) / aVolume.getWidth());
155 if (aVolume.getDepth())
156 aTex.
setY((aCandidate.getZ() - aVolume.getMinZ()) / aVolume.getDepth());
160 if (aVolume.getWidth())
161 aTex.
setX((aCandidate.getX() - aVolume.getMinX()) / aVolume.getWidth());
162 if (aVolume.getHeight())
163 aTex.
setY((aCandidate.getY() - aVolume.getMinY()) / aVolume.getHeight());
171 aPolyTexture.
append(aTexture);
175 SetPolyTexture2D(aPolyTexture);
178E3dPolygonObj::~E3dPolygonObj() {}
184 if (aPolyPoly3D != rNewPolyPoly3D)
187 aPolyPoly3D = rNewPolyPoly3D;
196 if (aPolyNormals3D != rNewPolyNormals3D)
199 aPolyNormals3D = rNewPolyNormals3D;
208 if (aPolyTexture2D != rNewPolyTexture2D)
211 aPolyTexture2D = rNewPolyTexture2D;
228 return new E3dPolygonObj(rTargetModel, *
this);
231void E3dPolygonObj::SetLineOnly(
bool bNew)
233 if (bNew != bLineOnly)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void append(const B3DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const B3DPoint &rPoint, sal_uInt32 nCount=1)
B2DRange getRange(const B2DPolygon &rCandidate)