22#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
23#include <com/sun/star/drawing/DoubleSequence.hpp>
32 ,
const drawing::Direction3D& rDirectionToPoint2
33 ,
const drawing::Direction3D& rDirectionToPoint4 )
35 , m_aPoint2(rPoint1+rDirectionToPoint2)
36 , m_aPoint3(m_aPoint2+rDirectionToPoint4)
37 , m_aPoint4(rPoint1+rDirectionToPoint4)
38 , m_bInvertNormal(false)
39 , m_bManualNormalSet(false)
43Stripe::Stripe(
const drawing::Position3D& rPoint1
44 ,
const drawing::Position3D& rPoint2
50 , m_bInvertNormal(false)
51 , m_bManualNormalSet(false)
53 m_aPoint3.PositionZ += fDepth;
54 m_aPoint4.PositionZ += fDepth;
57Stripe::Stripe(
const drawing::Position3D& rPoint1
58 ,
const drawing::Position3D& rPoint2
59 ,
const drawing::Position3D& rPoint3
60 ,
const drawing::Position3D& rPoint4 )
65 , m_bInvertNormal(false)
66 , m_bManualNormalSet(false)
70void Stripe::SetManualNormal(
const drawing::Direction3D& rNormal )
72 m_aManualNormal = rNormal;
73 m_bManualNormalSet =
true;
76void Stripe::InvertNormal(
bool bInvertNormal )
78 m_bInvertNormal = bInvertNormal;
83 drawing::PolyPolygonShape3D aPP;
85 aPP.SequenceX.realloc(1);
86 aPP.SequenceY.realloc(1);
87 aPP.SequenceZ.realloc(1);
89 drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray();
90 drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray();
91 drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray();
93 pOuterSequenceX->realloc(4);
94 pOuterSequenceY->realloc(4);
95 pOuterSequenceZ->realloc(4);
97 double* pInnerSequenceX = pOuterSequenceX->getArray();
98 double* pInnerSequenceY = pOuterSequenceY->getArray();
99 double* pInnerSequenceZ = pOuterSequenceZ->getArray();
101 *pInnerSequenceX++ = m_aPoint1.PositionX;
102 *pInnerSequenceY++ = m_aPoint1.PositionY;
103 *pInnerSequenceZ++ = m_aPoint1.PositionZ;
105 *pInnerSequenceX++ = m_aPoint2.PositionX;
106 *pInnerSequenceY++ = m_aPoint2.PositionY;
107 *pInnerSequenceZ++ = m_aPoint2.PositionZ;
109 *pInnerSequenceX++ = m_aPoint3.PositionX;
110 *pInnerSequenceY++ = m_aPoint3.PositionY;
111 *pInnerSequenceZ++ = m_aPoint3.PositionZ;
113 *pInnerSequenceX++ = m_aPoint4.PositionX;
114 *pInnerSequenceY++ = m_aPoint4.PositionY;
115 *pInnerSequenceZ++ = m_aPoint4.PositionZ;
120drawing::Direction3D Stripe::getNormal()
const
122 drawing::Direction3D aRet(1.0,0.0,0.0);
124 if( m_bManualNormalSet )
125 aRet = m_aManualNormal;
137 if( m_bInvertNormal )
139 aRet.DirectionX *= -1.0;
140 aRet.DirectionY *= -1.0;
141 aRet.DirectionZ *= -1.0;
148 drawing::PolyPolygonShape3D aPP;
150 aPP.SequenceX.realloc(1);
151 aPP.SequenceY.realloc(1);
152 aPP.SequenceZ.realloc(1);
154 drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray();
155 drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray();
156 drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray();
158 pOuterSequenceX->realloc(4);
159 pOuterSequenceY->realloc(4);
160 pOuterSequenceZ->realloc(4);
162 double* pInnerSequenceX = pOuterSequenceX->getArray();
163 double* pInnerSequenceY = pOuterSequenceY->getArray();
164 double* pInnerSequenceZ = pOuterSequenceZ->getArray();
166 drawing::Direction3D aNormal( getNormal() );
168 for(sal_Int32 nN=4; --nN; )
170 *pInnerSequenceX++ = aNormal.DirectionX;
171 *pInnerSequenceY++ = aNormal.DirectionY;
172 *pInnerSequenceZ++ = aNormal.DirectionZ;
177uno::Any Stripe::getTexturePolygon(
short nRotatedTexture )
179 drawing::PolyPolygonShape3D aPP;
181 aPP.SequenceX.realloc(1);
182 aPP.SequenceY.realloc(1);
183 aPP.SequenceZ.realloc(1);
185 drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray();
186 drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray();
187 drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray();
189 pOuterSequenceX->realloc(4);
190 pOuterSequenceY->realloc(4);
191 pOuterSequenceZ->realloc(4);
193 double* pInnerSequenceX = pOuterSequenceX->getArray();
194 double* pInnerSequenceY = pOuterSequenceY->getArray();
195 double* pInnerSequenceZ = pOuterSequenceZ->getArray();
197 if( nRotatedTexture==0 )
199 *pInnerSequenceX++ = 0.0;
200 *pInnerSequenceY++ = 0.0;
201 *pInnerSequenceZ++ = 0.0;
203 *pInnerSequenceX++ = 0.0;
204 *pInnerSequenceY++ = 1.0;
205 *pInnerSequenceZ++ = 0.0;
207 *pInnerSequenceX++ = 1.0;
208 *pInnerSequenceY++ = 1.0;
209 *pInnerSequenceZ++ = 0.0;
211 *pInnerSequenceX++ = 1.0;
212 *pInnerSequenceY++ = 0.0;
213 *pInnerSequenceZ++ = 0.0;
215 else if( nRotatedTexture==1 )
217 *pInnerSequenceX++ = 1.0;
218 *pInnerSequenceY++ = 0.0;
219 *pInnerSequenceZ++ = 0.0;
221 *pInnerSequenceX++ = 0.0;
222 *pInnerSequenceY++ = 0.0;
223 *pInnerSequenceZ++ = 0.0;
225 *pInnerSequenceX++ = 0.0;
226 *pInnerSequenceY++ = 1.0;
227 *pInnerSequenceZ++ = 0.0;
229 *pInnerSequenceX++ = 1.0;
230 *pInnerSequenceY++ = 1.0;
231 *pInnerSequenceZ++ = 0.0;
233 else if( nRotatedTexture==2 )
235 *pInnerSequenceX++ = 1.0;
236 *pInnerSequenceY++ = 1.0;
237 *pInnerSequenceZ++ = 0.0;
239 *pInnerSequenceX++ = 1.0;
240 *pInnerSequenceY++ = 0.0;
241 *pInnerSequenceZ++ = 0.0;
243 *pInnerSequenceX++ = 0.0;
244 *pInnerSequenceY++ = 0.0;
245 *pInnerSequenceZ++ = 0.0;
247 *pInnerSequenceX++ = 0.0;
248 *pInnerSequenceY++ = 1.0;
249 *pInnerSequenceZ++ = 0.0;
251 else if( nRotatedTexture==3 )
253 *pInnerSequenceX++ = 0.0;
254 *pInnerSequenceY++ = 1.0;
255 *pInnerSequenceZ++ = 0.0;
257 *pInnerSequenceX++ = 1.0;
258 *pInnerSequenceY++ = 1.0;
259 *pInnerSequenceZ++ = 0.0;
261 *pInnerSequenceX++ = 1.0;
262 *pInnerSequenceY++ = 0.0;
263 *pInnerSequenceZ++ = 0.0;
265 *pInnerSequenceX++ = 0.0;
266 *pInnerSequenceY++ = 0.0;
267 *pInnerSequenceZ++ = 0.0;
269 else if( nRotatedTexture==4 )
271 *pInnerSequenceX++ = 1.0;
272 *pInnerSequenceY++ = 0.0;
273 *pInnerSequenceZ++ = 0.0;
275 *pInnerSequenceX++ = 1.0;
276 *pInnerSequenceY++ = 1.0;
277 *pInnerSequenceZ++ = 0.0;
279 *pInnerSequenceX++ = 0.0;
280 *pInnerSequenceY++ = 1.0;
281 *pInnerSequenceZ++ = 0.0;
283 *pInnerSequenceX++ = 0.0;
284 *pInnerSequenceY++ = 0.0;
285 *pInnerSequenceZ++ = 0.0;
287 else if( nRotatedTexture==5 )
289 *pInnerSequenceX++ = 0.0;
290 *pInnerSequenceY++ = 0.0;
291 *pInnerSequenceZ++ = 0.0;
293 *pInnerSequenceX++ = 1.0;
294 *pInnerSequenceY++ = 0.0;
295 *pInnerSequenceZ++ = 0.0;
297 *pInnerSequenceX++ = 1.0;
298 *pInnerSequenceY++ = 1.0;
299 *pInnerSequenceZ++ = 0.0;
301 *pInnerSequenceX++ = 0.0;
302 *pInnerSequenceY++ = 1.0;
303 *pInnerSequenceZ++ = 0.0;
305 else if( nRotatedTexture==6 )
307 *pInnerSequenceX++ = 0.0;
308 *pInnerSequenceY++ = 1.0;
309 *pInnerSequenceZ++ = 0.0;
311 *pInnerSequenceX++ = 0.0;
312 *pInnerSequenceY++ = 0.0;
313 *pInnerSequenceZ++ = 0.0;
315 *pInnerSequenceX++ = 1.0;
316 *pInnerSequenceY++ = 0.0;
317 *pInnerSequenceZ++ = 0.0;
319 *pInnerSequenceX++ = 1.0;
320 *pInnerSequenceY++ = 1.0;
321 *pInnerSequenceZ++ = 0.0;
323 else if( nRotatedTexture==7 )
325 *pInnerSequenceX++ = 1.0;
326 *pInnerSequenceY++ = 1.0;
327 *pInnerSequenceZ++ = 0.0;
329 *pInnerSequenceX++ = 0.0;
330 *pInnerSequenceY++ = 1.0;
331 *pInnerSequenceZ++ = 0.0;
333 *pInnerSequenceX++ = 0.0;
334 *pInnerSequenceY++ = 0.0;
335 *pInnerSequenceZ++ = 0.0;
337 *pInnerSequenceX++ = 1.0;
338 *pInnerSequenceY++ = 0.0;
339 *pInnerSequenceZ++ = 0.0;
void append(const B3DPoint &rPoint, sal_uInt32 nCount=1)
B3DVector const & getNormal() const
Stripe(const css::drawing::Position3D &rPoint1, const css::drawing::Direction3D &rDirectionToPoint2, const css::drawing::Direction3D &rDirectionToPoint4)
css::drawing::Direction3D B3DVectorToDirection3D(const ::basegfx::B3DVector &rB3DVector)
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DPoint Position3DToB3DPoint(const css::drawing::Position3D &rPosition)
Position3D -> B3DPoint.