1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
27 #include <basegfx/color/bcolor.hxx>
31 namespace drawinglayer
35 /** ShadowPrimitive2D class
37 This primitive defines a generic shadow geometry construction
38 for 2D objects. It decomposes to a TransformPrimitive2D embedded
39 into a ModifiedColorPrimitive2D.
41 It's for primtive usage convenience, so that not everyone has
42 to implement the generic shadow construction by himself.
44 The same geometry as sequence of primitives is used as geometry and
45 as shadow. Since these are RefCounted Uno-Api objects, no extra objects
46 are needed for the shadow itself; all the local decompositions of the
47 original geometry can be reused from the renderer for shadow visualisation.
49 class DRAWINGLAYER_DLLPUBLIC ShadowPrimitive2D
: public GroupPrimitive2D
52 /// the shadow transformation, normally just an offset
53 basegfx::B2DHomMatrix maShadowTransform
;
55 /// the shadow color to which all geometry is to be forced
56 basegfx::BColor maShadowColor
;
61 const basegfx::B2DHomMatrix
& rShadowTransform
,
62 const basegfx::BColor
& rShadowColor
,
63 const Primitive2DSequence
& rChildren
);
66 const basegfx::B2DHomMatrix
& getShadowTransform() const { return maShadowTransform
; }
67 const basegfx::BColor
& getShadowColor() const { return maShadowColor
; }
70 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
73 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
75 /// create decomposition
76 virtual Primitive2DSequence
get2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
79 DeclPrimitive2DIDBlock()
81 } // end of namespace primitive2d
82 } // end of namespace drawinglayer
86 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SHADOWPRIMITIVE2D_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */