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_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX 29 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX 30 31 #include <drawinglayer/drawinglayerdllapi.h> 32 #include <drawinglayer/primitive2d/groupprimitive2d.hxx> 33 #include <basegfx/matrix/b2dhommatrix.hxx> 34 #include <basegfx/color/bcolor.hxx> 35 36 ////////////////////////////////////////////////////////////////////////////// 37 38 namespace drawinglayer 39 { 40 namespace primitive2d 41 { 42 /** ShadowPrimitive2D class 43 44 This primitive defines a generic shadow geometry construction 45 for 2D objects. It decomposes to a TransformPrimitive2D embedded 46 into a ModifiedColorPrimitive2D. 47 48 It's for primtive usage convenience, so that not everyone has 49 to implement the generic shadow construction by himself. 50 51 The same geometry as sequence of primitives is used as geometry and 52 as shadow. Since these are RefCounted Uno-Api objects, no extra objects 53 are needed for the shadow itself; all the local decompositions of the 54 original geometry can be reused from the renderer for shadow visualisation. 55 */ 56 class DRAWINGLAYER_DLLPUBLIC ShadowPrimitive2D : public GroupPrimitive2D 57 { 58 private: 59 /// the shadow transformation, normally just an offset 60 basegfx::B2DHomMatrix maShadowTransform; 61 62 /// the shadow color to which all geometry is to be forced 63 basegfx::BColor maShadowColor; 64 65 public: 66 /// constructor 67 ShadowPrimitive2D( 68 const basegfx::B2DHomMatrix& rShadowTransform, 69 const basegfx::BColor& rShadowColor, 70 const Primitive2DSequence& rChildren); 71 72 /// data read access 73 const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; } 74 const basegfx::BColor& getShadowColor() const { return maShadowColor; } 75 76 /// compare operator 77 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 78 79 /// get range 80 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; 81 82 /// create decomposition 83 virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 84 85 /// provide unique ID 86 DeclPrimitrive2DIDBlock() 87 }; 88 } // end of namespace primitive2d 89 } // end of namespace drawinglayer 90 91 ////////////////////////////////////////////////////////////////////////////// 92 93 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX 94 95 ////////////////////////////////////////////////////////////////////////////// 96 // eof 97