bump product version to 4.1.6.2
[LibreOffice.git] / oox / source / drawingml / scene3dcontext.cxx
blob8dc914b166c9e2edccba3d37c8223f13b29d0207
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 );
59 legacyObliqueTopLeft
60 legacyObliqueTop
61 legacyObliqueTopRight
62 legacyObliqueLeft
63 legacyObliqueFront
64 legacyObliqueRight
65 legacyObliqueBottomLeft
66 legacyObliqueBottom
67 legacyObliqueBottomRight
68 legacyPerspectiveTopLeft
69 legacyPerspectiveTop
70 legacyPerspectiveTopRight
71 legacyPerspectiveLeft
72 legacyPerspectiveFront
73 legacyPerspectiveRight
74 legacyPerspectiveBottomLeft
75 legacyPerspectiveBottom
76 legacyPerspectiveBottomRight
77 orthographicFront
78 isometricTopUp
79 isometricTopDown
80 isometricBottomUp
81 isometricBottomDown
82 isometricLeftUp
83 isometricLeftDown
84 isometricRightUp
85 isometricRightDown
86 isometricOffAxis1Left
87 isometricOffAxis1Right
88 isometricOffAxis1Top
89 isometricOffAxis2Left
90 isometricOffAxis2Right
91 isometricOffAxis2Top
92 isometricOffAxis3Left
93 isometricOffAxis3Right
94 isometricOffAxis3Bottom
95 isometricOffAxis4Left
96 isometricOffAxis4Right
97 isometricOffAxis4Bottom
98 obliqueTopLeft
99 obliqueTop
100 obliqueTopRight
101 obliqueLeft
102 obliqueRight
103 obliqueBottomLeft
104 obliqueBottom
105 obliqueBottomRight
106 perspectiveFront
107 perspectiveLeft
108 perspectiveRight
109 perspectiveAbove
110 perspectiveBelow
111 perspectiveAboveLeftFacing
112 perspectiveAboveRightFacing
113 perspectiveContrastingLeftFacing
114 perspectiveContrastingRightFacing
115 perspectiveHeroicLeftFacing
116 perspectiveHeroicRightFacing
117 perspectiveHeroicExtremeLeftFacing
118 perspectiveHeroicExtremeRightFacing
119 perspectiveRelaxed
120 perspectiveRelaxedModerately
123 // TODO: nested element XML_rot
124 break;
125 case NMSP_DRAWINGML|XML_lightRig:
126 mr3DProperties.mnLightRigDirection = aAttribs.getToken( XML_dir, XML_none );
128 XML_tl
129 XML_t
130 XML_tr
131 XML_l
132 XML_r
133 XML_bl
134 XML_b
135 XML_br
138 mr3DProperties.mnLightRigType = aAttribs.getToken( XML_rig, XML_none );
140 XML_legacyFlat1
141 XML_legacyFlat2
142 XML_legacyFlat3
143 XML_legacyFlat4
144 XML_legacyNormal1
145 XML_legacyNormal2
146 XML_legacyNormal3
147 XML_legacyNormal4
148 XML_legacyHarsh1
149 XML_legacyHarsh2
150 XML_legacyHarsh3
151 XML_legacyHarsh4
152 XML_threePt
153 XML_balanced
154 XML_soft
155 XML_harsh
156 XML_flood
157 XML_contrasting
158 XML_morning
159 XML_sunrise
160 XML_sunset
161 XML_chilly
162 XML_freezing
163 XML_flat
164 XML_twoPt
165 XML_glow
166 XML_brightRoom
168 // TODO: nested element XML_rot
169 break;
170 case NMSP_DRAWINGML|XML_backdrop:
171 case NMSP_DRAWINGML|XML_extLst:
172 return xRet; // TODO: later (backdrop is not supported by core anyway)
174 return xRet;
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */