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