xref: /AOO41X/main/xmloff/source/draw/ximp3dobject.hxx (revision ecfe53c5d1886e1e0d215b0d140d05282ab1c477)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XIMP3DOBJECT_HXX
25 #define _XIMP3DOBJECT_HXX
26 
27 #include <xmloff/xmlictxt.hxx>
28 #include "sdxmlimp_impl.hxx"
29 #include <xmloff/nmspmap.hxx>
30 #include <com/sun/star/drawing/XShapes.hpp>
31 #include <tools/rtti.hxx>
32 #include <com/sun/star/drawing/HomogenMatrix.hpp>
33 #include <com/sun/star/drawing/Direction3D.hpp>
34 #include <com/sun/star/drawing/Position3D.hpp>
35 #include "ximpshap.hxx"
36 
37 //////////////////////////////////////////////////////////////////////////////
38 // common shape context
39 
40 class SdXML3DObjectContext : public SdXMLShapeContext
41 {
42 protected:
43     // the shape group this object should be created inside
44 
45     com::sun::star::drawing::HomogenMatrix mxHomMat;
46     sal_Bool                        mbSetTransform;
47 
48 /*
49     void SetStyle();
50     void AddShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape);
51 */
52 public:
53     TYPEINFO();
54 
55     SdXML3DObjectContext( SvXMLImport& rImport,
56         sal_uInt16 nPrfx,
57         const rtl::OUString& rLocalName,
58         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
59         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
60         sal_Bool bTemporaryShape);
61     virtual ~SdXML3DObjectContext();
62 
63     virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
64     virtual void EndElement();
65 };
66 
67 //////////////////////////////////////////////////////////////////////////////
68 // dr3d:3dcube context
69 
70 class SdXML3DCubeObjectShapeContext : public SdXML3DObjectContext
71 {
72     ::basegfx::B3DVector    maMinEdge;
73     ::basegfx::B3DVector    maMaxEdge;
74     sal_Bool                    mbMinEdgeUsed;
75     sal_Bool                    mbMaxEdgeUsed;
76 
77 public:
78     TYPEINFO();
79 
80     SdXML3DCubeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
81         const rtl::OUString& rLocalName,
82         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
83         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
84         sal_Bool bTemporaryShape);
85     virtual ~SdXML3DCubeObjectShapeContext();
86 
87     virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
88     virtual void EndElement();
89 };
90 
91 //////////////////////////////////////////////////////////////////////////////
92 // dr3d:3dsphere context
93 
94 class SdXML3DSphereObjectShapeContext : public SdXML3DObjectContext
95 {
96     ::basegfx::B3DVector    maCenter;
97     ::basegfx::B3DVector    maSize;
98     sal_Bool                    mbCenterUsed;
99     sal_Bool                    mbSizeUsed;
100 
101 public:
102     TYPEINFO();
103 
104     SdXML3DSphereObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
105         const rtl::OUString& rLocalName,
106         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
107         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
108         sal_Bool bTemporaryShape);
109     virtual ~SdXML3DSphereObjectShapeContext();
110 
111     virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
112     virtual void EndElement();
113 };
114 
115 //////////////////////////////////////////////////////////////////////////////
116 // polygonbased context
117 
118 class SdXML3DPolygonBasedShapeContext : public SdXML3DObjectContext
119 {
120     rtl::OUString               maPoints;
121     rtl::OUString               maViewBox;
122 
123 public:
124     TYPEINFO();
125 
126     SdXML3DPolygonBasedShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
127         const rtl::OUString& rLocalName,
128         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
129         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
130         sal_Bool bTemporaryShape);
131     virtual ~SdXML3DPolygonBasedShapeContext();
132 
133     virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
134     virtual void EndElement();
135 };
136 
137 //////////////////////////////////////////////////////////////////////////////
138 // dr3d:3dlathe context
139 
140 class SdXML3DLatheObjectShapeContext : public SdXML3DPolygonBasedShapeContext
141 {
142 public:
143     TYPEINFO();
144 
145     SdXML3DLatheObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
146         const rtl::OUString& rLocalName,
147         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
148         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
149         sal_Bool bTemporaryShape);
150     virtual ~SdXML3DLatheObjectShapeContext();
151 
152     virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
153     virtual void EndElement();
154 };
155 
156 //////////////////////////////////////////////////////////////////////////////
157 // dr3d:3dextrude context
158 
159 class SdXML3DExtrudeObjectShapeContext : public SdXML3DPolygonBasedShapeContext
160 {
161 public:
162     TYPEINFO();
163 
164     SdXML3DExtrudeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
165         const rtl::OUString& rLocalName,
166         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
167         com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
168         sal_Bool bTemporaryShape);
169     virtual ~SdXML3DExtrudeObjectShapeContext();
170 
171     virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
172     virtual void EndElement();
173 };
174 
175 #endif  //  _XIMP3DOBJECT_HXX
176