xref: /trunk/main/xmloff/source/draw/ximp3dobject.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _XIMP3DOBJECT_HXX
29*cdf0e10cSrcweir #define _XIMP3DOBJECT_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx>
32*cdf0e10cSrcweir #include "sdxmlimp_impl.hxx"
33*cdf0e10cSrcweir #include <xmloff/nmspmap.hxx>
34*cdf0e10cSrcweir #include <com/sun/star/drawing/XShapes.hpp>
35*cdf0e10cSrcweir #include <tools/rtti.hxx>
36*cdf0e10cSrcweir #include <com/sun/star/drawing/HomogenMatrix.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/drawing/Direction3D.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/drawing/Position3D.hpp>
39*cdf0e10cSrcweir #include "ximpshap.hxx"
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
42*cdf0e10cSrcweir // common shape context
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir class SdXML3DObjectContext : public SdXMLShapeContext
45*cdf0e10cSrcweir {
46*cdf0e10cSrcweir protected:
47*cdf0e10cSrcweir 	// the shape group this object should be created inside
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 	com::sun::star::drawing::HomogenMatrix mxHomMat;
50*cdf0e10cSrcweir 	sal_Bool						mbSetTransform;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir /*
53*cdf0e10cSrcweir 	void SetStyle();
54*cdf0e10cSrcweir 	void AddShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape);
55*cdf0e10cSrcweir */
56*cdf0e10cSrcweir public:
57*cdf0e10cSrcweir 	TYPEINFO();
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir 	SdXML3DObjectContext( SvXMLImport& rImport,
60*cdf0e10cSrcweir 		sal_uInt16 nPrfx,
61*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
62*cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
63*cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
64*cdf0e10cSrcweir         sal_Bool bTemporaryShape);
65*cdf0e10cSrcweir 	virtual ~SdXML3DObjectContext();
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
68*cdf0e10cSrcweir 	virtual void EndElement();
69*cdf0e10cSrcweir };
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
72*cdf0e10cSrcweir // dr3d:3dcube context
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir class SdXML3DCubeObjectShapeContext : public SdXML3DObjectContext
75*cdf0e10cSrcweir {
76*cdf0e10cSrcweir 	::basegfx::B3DVector	maMinEdge;
77*cdf0e10cSrcweir 	::basegfx::B3DVector	maMaxEdge;
78*cdf0e10cSrcweir 	sal_Bool					mbMinEdgeUsed;
79*cdf0e10cSrcweir 	sal_Bool					mbMaxEdgeUsed;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir public:
82*cdf0e10cSrcweir 	TYPEINFO();
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	SdXML3DCubeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
85*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
86*cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
87*cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
88*cdf0e10cSrcweir         sal_Bool bTemporaryShape);
89*cdf0e10cSrcweir 	virtual ~SdXML3DCubeObjectShapeContext();
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
92*cdf0e10cSrcweir 	virtual void EndElement();
93*cdf0e10cSrcweir };
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
96*cdf0e10cSrcweir // dr3d:3dsphere context
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir class SdXML3DSphereObjectShapeContext : public SdXML3DObjectContext
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir 	::basegfx::B3DVector	maCenter;
101*cdf0e10cSrcweir 	::basegfx::B3DVector	maSize;
102*cdf0e10cSrcweir 	sal_Bool					mbCenterUsed;
103*cdf0e10cSrcweir 	sal_Bool					mbSizeUsed;
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir public:
106*cdf0e10cSrcweir 	TYPEINFO();
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir 	SdXML3DSphereObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
109*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
110*cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
111*cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
112*cdf0e10cSrcweir         sal_Bool bTemporaryShape);
113*cdf0e10cSrcweir 	virtual ~SdXML3DSphereObjectShapeContext();
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
116*cdf0e10cSrcweir 	virtual void EndElement();
117*cdf0e10cSrcweir };
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
120*cdf0e10cSrcweir // polygonbased context
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir class SdXML3DPolygonBasedShapeContext : public SdXML3DObjectContext
123*cdf0e10cSrcweir {
124*cdf0e10cSrcweir 	rtl::OUString				maPoints;
125*cdf0e10cSrcweir 	rtl::OUString				maViewBox;
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir public:
128*cdf0e10cSrcweir 	TYPEINFO();
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 	SdXML3DPolygonBasedShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
131*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
132*cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
133*cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
134*cdf0e10cSrcweir         sal_Bool bTemporaryShape);
135*cdf0e10cSrcweir 	virtual ~SdXML3DPolygonBasedShapeContext();
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
138*cdf0e10cSrcweir 	virtual void EndElement();
139*cdf0e10cSrcweir };
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
142*cdf0e10cSrcweir // dr3d:3dlathe context
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir class SdXML3DLatheObjectShapeContext : public SdXML3DPolygonBasedShapeContext
145*cdf0e10cSrcweir {
146*cdf0e10cSrcweir public:
147*cdf0e10cSrcweir 	TYPEINFO();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 	SdXML3DLatheObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
150*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
151*cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
152*cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
153*cdf0e10cSrcweir         sal_Bool bTemporaryShape);
154*cdf0e10cSrcweir 	virtual ~SdXML3DLatheObjectShapeContext();
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
157*cdf0e10cSrcweir 	virtual void EndElement();
158*cdf0e10cSrcweir };
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
161*cdf0e10cSrcweir // dr3d:3dextrude context
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir class SdXML3DExtrudeObjectShapeContext : public SdXML3DPolygonBasedShapeContext
164*cdf0e10cSrcweir {
165*cdf0e10cSrcweir public:
166*cdf0e10cSrcweir 	TYPEINFO();
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 	SdXML3DExtrudeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
169*cdf0e10cSrcweir 		const rtl::OUString& rLocalName,
170*cdf0e10cSrcweir 		const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
171*cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
172*cdf0e10cSrcweir         sal_Bool bTemporaryShape);
173*cdf0e10cSrcweir 	virtual ~SdXML3DExtrudeObjectShapeContext();
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 	virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
176*cdf0e10cSrcweir 	virtual void EndElement();
177*cdf0e10cSrcweir };
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir #endif	//  _XIMP3DOBJECT_HXX
180