Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <comphelper/extract.hxx>
30 : : #include "ximp3dobject.hxx"
31 : : #include <xmloff/XMLShapeStyleContext.hxx>
32 : : #include <xmloff/xmluconv.hxx>
33 : : #include <com/sun/star/beans/XPropertySet.hpp>
34 : : #include <com/sun/star/drawing/PointSequenceSequence.hpp>
35 : : #include <com/sun/star/drawing/PointSequence.hpp>
36 : : #include "xexptran.hxx"
37 : : #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
38 : : #include <xmloff/families.hxx>
39 : : #include "ximpstyl.hxx"
40 : : #include <xmloff/xmltoken.hxx>
41 : : #include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
42 : : #include <com/sun/star/drawing/DoubleSequence.hpp>
43 : :
44 : : using ::rtl::OUString;
45 : : using ::rtl::OUStringBuffer;
46 : :
47 : : using namespace ::com::sun::star;
48 : :
49 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
50 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
51 : :
52 [ # # ][ # # ]: 0 : TYPEINIT1( SdXML3DObjectContext, SdXMLShapeContext );
53 : :
54 : 0 : SdXML3DObjectContext::SdXML3DObjectContext(
55 : : SvXMLImport& rImport,
56 : : sal_uInt16 nPrfx,
57 : : const OUString& rLocalName,
58 : : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
59 : : uno::Reference< drawing::XShapes >& rShapes,
60 : : sal_Bool bTemporaryShape)
61 : : : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
62 : 0 : mbSetTransform( sal_False )
63 : : {
64 [ # # ][ # # ]: 0 : sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
[ # # ]
65 [ # # ]: 0 : for(sal_Int16 i=0; i < nAttrCount; i++)
66 : : {
67 [ # # ][ # # ]: 0 : OUString sAttrName = xAttrList->getNameByIndex( i );
68 : 0 : OUString aLocalName;
69 [ # # ]: 0 : sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
70 [ # # ][ # # ]: 0 : OUString sValue = xAttrList->getValueByIndex( i );
71 [ # # ][ # # ]: 0 : const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DObjectAttrTokenMap();
[ # # ][ # # ]
72 : :
73 [ # # ]: 0 : switch(rAttrTokenMap.Get(nPrefix, aLocalName))
[ # # # ]
74 : : {
75 : : case XML_TOK_3DOBJECT_DRAWSTYLE_NAME:
76 : : {
77 : 0 : maDrawStyleName = sValue;
78 : 0 : break;
79 : : }
80 : : case XML_TOK_3DOBJECT_TRANSFORM:
81 : : {
82 [ # # ]: 0 : SdXMLImExTransform3D aTransform(sValue, GetImport().GetMM100UnitConverter());
83 [ # # ]: 0 : if(aTransform.NeedsAction())
84 [ # # ]: 0 : mbSetTransform = aTransform.GetFullHomogenTransform(mxHomMat);
85 [ # # ]: 0 : break;
86 : : }
87 : : }
88 : 0 : }
89 : 0 : }
90 : :
91 : : //////////////////////////////////////////////////////////////////////////////
92 : :
93 : 0 : SdXML3DObjectContext::~SdXML3DObjectContext()
94 : : {
95 [ # # ]: 0 : }
96 : :
97 : : //////////////////////////////////////////////////////////////////////////////
98 : :
99 : 0 : void SdXML3DObjectContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
100 : : {
101 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
102 [ # # ]: 0 : if(xPropSet.is())
103 : : {
104 : : // set parameters
105 [ # # ]: 0 : if(mbSetTransform)
106 : : {
107 : 0 : uno::Any aAny;
108 [ # # ]: 0 : aAny <<= mxHomMat;
109 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DTransformMatrix")), aAny);
[ # # ]
110 : : }
111 : :
112 : : // call parent
113 [ # # ]: 0 : SdXMLShapeContext::StartElement(xAttrList);
114 : 0 : }
115 : 0 : }
116 : :
117 : : //////////////////////////////////////////////////////////////////////////////
118 : :
119 : 0 : void SdXML3DObjectContext::EndElement()
120 : : {
121 : : // call parent
122 : 0 : SdXMLShapeContext::EndElement();
123 : 0 : }
124 : :
125 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
126 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
127 : :
128 [ # # ][ # # ]: 0 : TYPEINIT1( SdXML3DCubeObjectShapeContext, SdXML3DObjectContext);
129 : :
130 : 0 : SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext(
131 : : SvXMLImport& rImport,
132 : : sal_uInt16 nPrfx,
133 : : const OUString& rLocalName,
134 : : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
135 : : uno::Reference< drawing::XShapes >& rShapes,
136 : : sal_Bool bTemporaryShape)
137 : : : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
138 : : maMinEdge(-2500.0, -2500.0, -2500.0),
139 : : maMaxEdge(2500.0, 2500.0, 2500.0),
140 : : mbMinEdgeUsed(sal_False),
141 : 0 : mbMaxEdgeUsed(sal_False)
142 : : {
143 [ # # ][ # # ]: 0 : sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
[ # # ]
144 [ # # ]: 0 : for(sal_Int16 i=0; i < nAttrCount; i++)
145 : : {
146 [ # # ][ # # ]: 0 : OUString sAttrName = xAttrList->getNameByIndex( i );
147 : 0 : OUString aLocalName;
148 [ # # ]: 0 : sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
149 [ # # ][ # # ]: 0 : OUString sValue = xAttrList->getValueByIndex( i );
150 [ # # ][ # # ]: 0 : const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DCubeObjectAttrTokenMap();
[ # # ][ # # ]
151 : :
152 [ # # ]: 0 : switch(rAttrTokenMap.Get(nPrefix, aLocalName))
[ # # # ]
153 : : {
154 : : case XML_TOK_3DCUBEOBJ_MINEDGE:
155 : : {
156 : 0 : ::basegfx::B3DVector aNewVec;
157 [ # # ]: 0 : GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue);
158 : :
159 [ # # ]: 0 : if(aNewVec != maMinEdge)
160 : : {
161 [ # # ]: 0 : maMinEdge = aNewVec;
162 : 0 : mbMinEdgeUsed = sal_True;
163 : : }
164 : 0 : break;
165 : : }
166 : : case XML_TOK_3DCUBEOBJ_MAXEDGE:
167 : : {
168 : 0 : ::basegfx::B3DVector aNewVec;
169 [ # # ]: 0 : GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue);
170 : :
171 [ # # ]: 0 : if(aNewVec != maMaxEdge)
172 : : {
173 [ # # ]: 0 : maMaxEdge = aNewVec;
174 : 0 : mbMaxEdgeUsed = sal_True;
175 : : }
176 : 0 : break;
177 : : }
178 : : }
179 : 0 : }
180 : 0 : }
181 : :
182 : : //////////////////////////////////////////////////////////////////////////////
183 : :
184 : 0 : SdXML3DCubeObjectShapeContext::~SdXML3DCubeObjectShapeContext()
185 : : {
186 [ # # ]: 0 : }
187 : :
188 : : //////////////////////////////////////////////////////////////////////////////
189 : :
190 : 0 : void SdXML3DCubeObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
191 : : {
192 : : // create shape
193 : 0 : AddShape( "com.sun.star.drawing.Shape3DCubeObject" );
194 [ # # ]: 0 : if(mxShape.is())
195 : : {
196 : : // add, set style and properties from base shape
197 [ # # ]: 0 : SetStyle();
198 [ # # ]: 0 : SdXML3DObjectContext::StartElement(xAttrList);
199 : :
200 : : // set local parameters on shape
201 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
202 [ # # ]: 0 : if(xPropSet.is())
203 : : {
204 : : // set parameters
205 : 0 : drawing::Position3D aPosition3D;
206 : 0 : drawing::Direction3D aDirection3D;
207 : :
208 : : // convert from min, max to size to be set
209 : 0 : maMaxEdge = maMaxEdge - maMinEdge;
210 : :
211 : 0 : aPosition3D.PositionX = maMinEdge.getX();
212 : 0 : aPosition3D.PositionY = maMinEdge.getY();
213 : 0 : aPosition3D.PositionZ = maMinEdge.getZ();
214 : :
215 : 0 : aDirection3D.DirectionX = maMaxEdge.getX();
216 : 0 : aDirection3D.DirectionY = maMaxEdge.getY();
217 : 0 : aDirection3D.DirectionZ = maMaxEdge.getZ();
218 : :
219 : 0 : uno::Any aAny;
220 [ # # ]: 0 : aAny <<= aPosition3D;
221 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")), aAny);
[ # # ]
222 [ # # ]: 0 : aAny <<= aDirection3D;
223 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")), aAny);
[ # # ]
224 : 0 : }
225 : : }
226 : 0 : }
227 : :
228 : : //////////////////////////////////////////////////////////////////////////////
229 : :
230 : 0 : void SdXML3DCubeObjectShapeContext::EndElement()
231 : : {
232 : : // call parent
233 : 0 : SdXML3DObjectContext::EndElement();
234 : 0 : }
235 : :
236 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
237 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
238 : :
239 [ # # ][ # # ]: 0 : TYPEINIT1( SdXML3DSphereObjectShapeContext, SdXML3DObjectContext);
240 : :
241 : 0 : SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext(
242 : : SvXMLImport& rImport,
243 : : sal_uInt16 nPrfx,
244 : : const OUString& rLocalName,
245 : : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
246 : : uno::Reference< drawing::XShapes >& rShapes,
247 : : sal_Bool bTemporaryShape)
248 : : : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
249 : : maCenter(0.0, 0.0, 0.0),
250 : : maSize(5000.0, 5000.0, 5000.0),
251 : : mbCenterUsed(sal_False),
252 : 0 : mbSizeUsed(sal_False)
253 : : {
254 [ # # ][ # # ]: 0 : sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
[ # # ]
255 [ # # ]: 0 : for(sal_Int16 i=0; i < nAttrCount; i++)
256 : : {
257 [ # # ][ # # ]: 0 : OUString sAttrName = xAttrList->getNameByIndex( i );
258 : 0 : OUString aLocalName;
259 [ # # ]: 0 : sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
260 [ # # ][ # # ]: 0 : OUString sValue = xAttrList->getValueByIndex( i );
261 [ # # ][ # # ]: 0 : const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DSphereObjectAttrTokenMap();
[ # # ][ # # ]
262 : :
263 [ # # ]: 0 : switch(rAttrTokenMap.Get(nPrefix, aLocalName))
[ # # # ]
264 : : {
265 : : case XML_TOK_3DSPHEREOBJ_CENTER:
266 : : {
267 : 0 : ::basegfx::B3DVector aNewVec;
268 [ # # ]: 0 : GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue);
269 : :
270 [ # # ]: 0 : if(aNewVec != maCenter)
271 : : {
272 [ # # ]: 0 : maCenter = aNewVec;
273 : 0 : mbCenterUsed = sal_True;
274 : : }
275 : 0 : break;
276 : : }
277 : : case XML_TOK_3DSPHEREOBJ_SIZE:
278 : : {
279 : 0 : ::basegfx::B3DVector aNewVec;
280 [ # # ]: 0 : GetImport().GetMM100UnitConverter().convertB3DVector(aNewVec, sValue);
281 : :
282 [ # # ]: 0 : if(aNewVec != maSize)
283 : : {
284 [ # # ]: 0 : maSize = aNewVec;
285 : 0 : mbSizeUsed = sal_True;
286 : : }
287 : 0 : break;
288 : : }
289 : : }
290 : 0 : }
291 : 0 : }
292 : :
293 : : //////////////////////////////////////////////////////////////////////////////
294 : :
295 : 0 : SdXML3DSphereObjectShapeContext::~SdXML3DSphereObjectShapeContext()
296 : : {
297 [ # # ]: 0 : }
298 : :
299 : : //////////////////////////////////////////////////////////////////////////////
300 : :
301 : 0 : void SdXML3DSphereObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
302 : : {
303 : : // create shape
304 : 0 : AddShape( "com.sun.star.drawing.Shape3DSphereObject" );
305 [ # # ]: 0 : if(mxShape.is())
306 : : {
307 : : // add, set style and properties from base shape
308 [ # # ]: 0 : SetStyle();
309 [ # # ]: 0 : SdXML3DObjectContext::StartElement(xAttrList);
310 : :
311 : : // set local parameters on shape
312 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
313 [ # # ]: 0 : if(xPropSet.is())
314 : : {
315 : : // set parameters
316 : 0 : drawing::Position3D aPosition3D;
317 : 0 : drawing::Direction3D aDirection3D;
318 : :
319 : 0 : aPosition3D.PositionX = maCenter.getX();
320 : 0 : aPosition3D.PositionY = maCenter.getY();
321 : 0 : aPosition3D.PositionZ = maCenter.getZ();
322 : :
323 : 0 : aDirection3D.DirectionX = maSize.getX();
324 : 0 : aDirection3D.DirectionY = maSize.getY();
325 : 0 : aDirection3D.DirectionZ = maSize.getZ();
326 : :
327 : 0 : uno::Any aAny;
328 [ # # ]: 0 : aAny <<= aPosition3D;
329 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")), aAny);
[ # # ]
330 [ # # ]: 0 : aAny <<= aDirection3D;
331 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")), aAny);
[ # # ]
332 : 0 : }
333 : : }
334 : 0 : }
335 : :
336 : : //////////////////////////////////////////////////////////////////////////////
337 : :
338 : 0 : void SdXML3DSphereObjectShapeContext::EndElement()
339 : : {
340 : : // call parent
341 : 0 : SdXML3DObjectContext::EndElement();
342 : 0 : }
343 : :
344 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
345 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
346 : :
347 [ # # ][ # # ]: 0 : TYPEINIT1( SdXML3DPolygonBasedShapeContext, SdXML3DObjectContext );
348 : :
349 : 0 : SdXML3DPolygonBasedShapeContext::SdXML3DPolygonBasedShapeContext(
350 : : SvXMLImport& rImport,
351 : : sal_uInt16 nPrfx,
352 : : const OUString& rLocalName,
353 : : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
354 : : uno::Reference< drawing::XShapes >& rShapes,
355 : : sal_Bool bTemporaryShape)
356 : 0 : : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
357 : : {
358 [ # # ][ # # ]: 0 : sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
[ # # ]
359 [ # # ]: 0 : for(sal_Int16 i=0; i < nAttrCount; i++)
360 : : {
361 [ # # ][ # # ]: 0 : OUString sAttrName = xAttrList->getNameByIndex( i );
362 : 0 : OUString aLocalName;
363 [ # # ]: 0 : sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
364 [ # # ][ # # ]: 0 : OUString sValue = xAttrList->getValueByIndex( i );
365 [ # # ][ # # ]: 0 : const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DPolygonBasedAttrTokenMap();
[ # # ][ # # ]
366 : :
367 [ # # ]: 0 : switch(rAttrTokenMap.Get(nPrefix, aLocalName))
[ # # # ]
368 : : {
369 : : case XML_TOK_3DPOLYGONBASED_VIEWBOX:
370 : : {
371 : 0 : maViewBox = sValue;
372 : 0 : break;
373 : : }
374 : : case XML_TOK_3DPOLYGONBASED_D:
375 : : {
376 : 0 : maPoints = sValue;
377 : 0 : break;
378 : : }
379 : : }
380 : 0 : }
381 : 0 : }
382 : :
383 : : //////////////////////////////////////////////////////////////////////////////
384 : :
385 : 0 : SdXML3DPolygonBasedShapeContext::~SdXML3DPolygonBasedShapeContext()
386 : : {
387 [ # # ]: 0 : }
388 : :
389 : : //////////////////////////////////////////////////////////////////////////////
390 : :
391 : 0 : void SdXML3DPolygonBasedShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
392 : : {
393 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
394 [ # # ]: 0 : if(xPropSet.is())
395 : : {
396 : : // set parameters
397 [ # # ][ # # ]: 0 : if(!maPoints.isEmpty() && !maViewBox.isEmpty())
[ # # ]
398 : : {
399 [ # # ]: 0 : SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter());
400 : 0 : awt::Point aMinPoint(aViewBox.GetX(), aViewBox.GetY());
401 : 0 : awt::Size aMaxSize(aViewBox.GetWidth(), aViewBox.GetHeight());
402 [ # # ]: 0 : SdXMLImExSvgDElement aPoints(maPoints, aViewBox, aMinPoint, aMaxSize, GetImport());
403 : :
404 : : // convert to double sequences
405 : : drawing::PointSequenceSequence& xPoSeSe =
406 : 0 : (drawing::PointSequenceSequence&)aPoints.GetPointSequenceSequence();
407 : 0 : sal_Int32 nOuterSequenceCount = xPoSeSe.getLength();
408 [ # # ]: 0 : drawing::PointSequence* pInnerSequence = xPoSeSe.getArray();
409 : :
410 [ # # ]: 0 : drawing::PolyPolygonShape3D xPolyPolygon3D;
411 [ # # ]: 0 : xPolyPolygon3D.SequenceX.realloc(nOuterSequenceCount);
412 [ # # ]: 0 : xPolyPolygon3D.SequenceY.realloc(nOuterSequenceCount);
413 [ # # ]: 0 : xPolyPolygon3D.SequenceZ.realloc(nOuterSequenceCount);
414 [ # # ]: 0 : drawing::DoubleSequence* pOuterSequenceX = xPolyPolygon3D.SequenceX.getArray();
415 [ # # ]: 0 : drawing::DoubleSequence* pOuterSequenceY = xPolyPolygon3D.SequenceY.getArray();
416 [ # # ]: 0 : drawing::DoubleSequence* pOuterSequenceZ = xPolyPolygon3D.SequenceZ.getArray();
417 : :
418 [ # # ]: 0 : for(sal_Int32 a(0L); a < nOuterSequenceCount; a++)
419 : : {
420 : 0 : sal_Int32 nInnerSequenceCount(pInnerSequence->getLength());
421 [ # # ]: 0 : awt::Point* pArray = pInnerSequence->getArray();
422 : :
423 [ # # ]: 0 : pOuterSequenceX->realloc(nInnerSequenceCount);
424 [ # # ]: 0 : pOuterSequenceY->realloc(nInnerSequenceCount);
425 [ # # ]: 0 : pOuterSequenceZ->realloc(nInnerSequenceCount);
426 [ # # ]: 0 : double* pInnerSequenceX = pOuterSequenceX->getArray();
427 [ # # ]: 0 : double* pInnerSequenceY = pOuterSequenceY->getArray();
428 [ # # ]: 0 : double* pInnerSequenceZ = pOuterSequenceZ->getArray();
429 : :
430 [ # # ]: 0 : for(sal_Int32 b(0L); b < nInnerSequenceCount; b++)
431 : : {
432 : 0 : *pInnerSequenceX++ = pArray->X;
433 : 0 : *pInnerSequenceY++ = pArray->Y;
434 : 0 : *pInnerSequenceZ++ = 0.0;
435 : 0 : pArray++;
436 : : }
437 : 0 : pInnerSequence++;
438 : :
439 : 0 : pOuterSequenceX++;
440 : 0 : pOuterSequenceY++;
441 : 0 : pOuterSequenceZ++;
442 : : }
443 : :
444 : : // set poly
445 : 0 : uno::Any aAny;
446 [ # # ]: 0 : aAny <<= xPolyPolygon3D;
447 [ # # ]: 0 : xPropSet->setPropertyValue(
448 [ # # ][ # # ]: 0 : OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPolyPolygon3D")), aAny);
[ # # ][ # # ]
449 : : }
450 : :
451 : : // call parent
452 [ # # ]: 0 : SdXML3DObjectContext::StartElement(xAttrList);
453 : 0 : }
454 : 0 : }
455 : :
456 : : //////////////////////////////////////////////////////////////////////////////
457 : :
458 : 0 : void SdXML3DPolygonBasedShapeContext::EndElement()
459 : : {
460 : : // call parent
461 : 0 : SdXML3DObjectContext::EndElement();
462 : 0 : }
463 : :
464 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
465 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
466 : :
467 [ # # ][ # # ]: 0 : TYPEINIT1( SdXML3DLatheObjectShapeContext, SdXML3DPolygonBasedShapeContext);
468 : :
469 : 0 : SdXML3DLatheObjectShapeContext::SdXML3DLatheObjectShapeContext(
470 : : SvXMLImport& rImport,
471 : : sal_uInt16 nPrfx,
472 : : const OUString& rLocalName,
473 : : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
474 : : uno::Reference< drawing::XShapes >& rShapes,
475 : : sal_Bool bTemporaryShape)
476 : 0 : : SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
477 : : {
478 : 0 : }
479 : :
480 : : //////////////////////////////////////////////////////////////////////////////
481 : :
482 : 0 : SdXML3DLatheObjectShapeContext::~SdXML3DLatheObjectShapeContext()
483 : : {
484 [ # # ]: 0 : }
485 : :
486 : : //////////////////////////////////////////////////////////////////////////////
487 : :
488 : 0 : void SdXML3DLatheObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
489 : : {
490 : : // create shape
491 : 0 : AddShape( "com.sun.star.drawing.Shape3DLatheObject" );
492 [ # # ]: 0 : if(mxShape.is())
493 : : {
494 : : // add, set style and properties from base shape
495 : 0 : SetStyle();
496 : 0 : SdXML3DPolygonBasedShapeContext::StartElement(xAttrList);
497 : : }
498 : 0 : }
499 : :
500 : : //////////////////////////////////////////////////////////////////////////////
501 : :
502 : 0 : void SdXML3DLatheObjectShapeContext::EndElement()
503 : : {
504 : : // call parent
505 : 0 : SdXML3DPolygonBasedShapeContext::EndElement();
506 : 0 : }
507 : :
508 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
509 : : ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
510 : :
511 [ # # ][ # # ]: 0 : TYPEINIT1( SdXML3DExtrudeObjectShapeContext, SdXML3DPolygonBasedShapeContext);
512 : :
513 : 0 : SdXML3DExtrudeObjectShapeContext::SdXML3DExtrudeObjectShapeContext(
514 : : SvXMLImport& rImport,
515 : : sal_uInt16 nPrfx,
516 : : const OUString& rLocalName,
517 : : const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
518 : : uno::Reference< drawing::XShapes >& rShapes,
519 : : sal_Bool bTemporaryShape)
520 : 0 : : SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
521 : : {
522 : 0 : }
523 : :
524 : : //////////////////////////////////////////////////////////////////////////////
525 : :
526 : 0 : SdXML3DExtrudeObjectShapeContext::~SdXML3DExtrudeObjectShapeContext()
527 : : {
528 [ # # ]: 0 : }
529 : :
530 : : //////////////////////////////////////////////////////////////////////////////
531 : :
532 : 0 : void SdXML3DExtrudeObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
533 : : {
534 : 0 : AddShape( "com.sun.star.drawing.Shape3DExtrudeObject" );
535 [ # # ]: 0 : if(mxShape.is())
536 : : {
537 : : // add, set style and properties from base shape
538 : 0 : SetStyle();
539 : 0 : SdXML3DPolygonBasedShapeContext::StartElement(xAttrList);
540 : : }
541 : 0 : }
542 : :
543 : : //////////////////////////////////////////////////////////////////////////////
544 : :
545 : 0 : void SdXML3DExtrudeObjectShapeContext::EndElement()
546 : : {
547 : : // call parent
548 : 0 : SdXML3DPolygonBasedShapeContext::EndElement();
549 : 0 : }
550 : :
551 : : // EOF
552 : :
553 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|