1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX 29 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX 30 31 #include <drawinglayer/drawinglayerdllapi.h> 32 #include <drawinglayer/primitive3d/groupprimitive3d.hxx> 33 #include <basegfx/matrix/b2dhommatrix.hxx> 34 #include <basegfx/color/bcolor.hxx> 35 36 ////////////////////////////////////////////////////////////////////////////// 37 38 namespace drawinglayer 39 { 40 namespace primitive3d 41 { 42 /** ShadowPrimitive3D class 43 44 This 3D grouping primitive is used to define a shadow for 45 3d geometry by embedding it. The shadow of 3D objects are 46 2D polygons, so the shadow transformation is a 2D transformation. 47 48 If the Shadow3D flag is set, the shadow definition has to be 49 combined with the scene and camera definition to create the correct 50 projected shadow 2D-Polygons. 51 */ 52 class DRAWINGLAYER_DLLPUBLIC ShadowPrimitive3D : public GroupPrimitive3D 53 { 54 protected: 55 /// 2D shadow definition 56 basegfx::B2DHomMatrix maShadowTransform; 57 basegfx::BColor maShadowColor; 58 double mfShadowTransparence; 59 60 /// bitfield 61 unsigned mbShadow3D : 1; 62 63 public: 64 /// constructor 65 ShadowPrimitive3D( 66 const basegfx::B2DHomMatrix& rShadowTransform, 67 const basegfx::BColor& rShadowColor, 68 double fShadowTransparence, 69 bool bShadow3D, 70 const Primitive3DSequence& rChildren); 71 72 /// data read access 73 const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; } 74 const basegfx::BColor& getShadowColor() const { return maShadowColor; } 75 double getShadowTransparence() const { return mfShadowTransparence; } 76 bool getShadow3D() const { return mbShadow3D; } 77 78 /// compare operator 79 virtual bool operator==(const BasePrimitive3D& rPrimitive) const; 80 81 /// provide unique ID 82 DeclPrimitrive3DIDBlock() 83 }; 84 } // end of namespace primitive3d 85 } // end of namespace drawinglayer 86 87 ////////////////////////////////////////////////////////////////////////////// 88 89 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX 90 91 ////////////////////////////////////////////////////////////////////////////// 92 // eof 93