1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "oox/drawingml/scene3dcontext.hxx"
21 #include <com/sun/star/io/XInputStream.hpp>
22 #include <com/sun/star/graphic/XGraphicProvider.hpp>
23 #include <cppuhelper/exc_hlp.hxx>
24 #include <comphelper/anytostring.hxx>
25 #include "oox/drawingml/colorchoicecontext.hxx"
26 #include "oox/drawingml/drawingmltypes.hxx"
27 #include "oox/drawingml/fillproperties.hxx"
28 #include "oox/core/namespaces.hxx"
29 #include "oox/core/xmlfilterbase.hxx"
30 #include "oox/helper/attributelist.hxx"
32 using ::oox::core::ContextHandler
;
33 using ::oox::core::XmlFilterBase
;
34 using namespace ::com::sun::star
;
35 using namespace ::com::sun::star::uno
;
36 using namespace ::com::sun::star::xml::sax
;
38 namespace oox
{ namespace drawingml
{
40 Scene3DContext::Scene3DContext( ContextHandler
& rParent
, Shape3DProperties
& r3DProperties
) throw()
41 : ContextHandler( rParent
)
42 , mr3DProperties( r3DProperties
)
46 Reference
< XFastContextHandler
> Scene3DContext::createFastChildContext( sal_Int32 aElementToken
, const Reference
< XFastAttributeList
>& xAttribs
)
47 throw ( SAXException
, RuntimeException
)
49 AttributeList
aAttribs( xAttribs
);
50 Reference
< XFastContextHandler
> xRet
;
52 switch( aElementToken
)
54 case NMSP_DRAWINGML
|XML_camera
:
55 mr3DProperties
.mfFieldOfVision
= aAttribs
.getInteger( XML_fov
, 0 ) / 36000000.0;
56 mr3DProperties
.mfZoom
= aAttribs
.getInteger( XML_zoom
, 100000 ) / 100000.0;
57 mr3DProperties
.mnPreset
= aAttribs
.getToken( XML_prst
, XML_none
);
65 legacyObliqueBottomLeft
67 legacyObliqueBottomRight
68 legacyPerspectiveTopLeft
70 legacyPerspectiveTopRight
72 legacyPerspectiveFront
73 legacyPerspectiveRight
74 legacyPerspectiveBottomLeft
75 legacyPerspectiveBottom
76 legacyPerspectiveBottomRight
87 isometricOffAxis1Right
90 isometricOffAxis2Right
93 isometricOffAxis3Right
94 isometricOffAxis3Bottom
96 isometricOffAxis4Right
97 isometricOffAxis4Bottom
111 perspectiveAboveLeftFacing
112 perspectiveAboveRightFacing
113 perspectiveContrastingLeftFacing
114 perspectiveContrastingRightFacing
115 perspectiveHeroicLeftFacing
116 perspectiveHeroicRightFacing
117 perspectiveHeroicExtremeLeftFacing
118 perspectiveHeroicExtremeRightFacing
120 perspectiveRelaxedModerately
123 // TODO: nested element XML_rot
125 case NMSP_DRAWINGML
|XML_lightRig
:
126 mr3DProperties
.mnLightRigDirection
= aAttribs
.getToken( XML_dir
, XML_none
);
138 mr3DProperties
.mnLightRigType
= aAttribs
.getToken( XML_rig
, XML_none
);
168 // TODO: nested element XML_rot
170 case NMSP_DRAWINGML
|XML_backdrop
:
171 case NMSP_DRAWINGML
|XML_extLst
:
172 return xRet
; // TODO: later (backdrop is not supported by core anyway)
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */