Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/primitivetools2d.hxx>
35 : : #include <vcl/bitmapex.hxx>
36 : : #include <basegfx/matrix/b2dhommatrix.hxx>
37 : :
38 : : //////////////////////////////////////////////////////////////////////////////
39 : : // DiscreteShadowPrimitive2D class
40 : :
41 : : namespace drawinglayer
42 : : {
43 : : namespace primitive2d
44 : : {
45 : : /** DiscreteShadow data class
46 : :
47 : : */
48 [ + - ][ + - ]: 4016 : class DRAWINGLAYER_DLLPUBLIC DiscreteShadow
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
49 : : {
50 : : private:
51 : : /// the original shadow BitmapEx in a special form
52 : : BitmapEx maBitmapEx;
53 : :
54 : : /// buffered extracted parts of CombinedShadow for easier usage
55 : : BitmapEx maTopLeft;
56 : : BitmapEx maTop;
57 : : BitmapEx maTopRight;
58 : : BitmapEx maRight;
59 : : BitmapEx maBottomRight;
60 : : BitmapEx maBottom;
61 : : BitmapEx maBottomLeft;
62 : : BitmapEx maLeft;
63 : :
64 : : public:
65 : : /// constructor
66 : : explicit DiscreteShadow(const BitmapEx& rBitmapEx);
67 : :
68 : : /// data read access
69 : 17027 : const BitmapEx& getBitmapEx() const { return maBitmapEx; }
70 : :
71 : : /// compare operator
72 : 2933 : bool operator==(const DiscreteShadow& rCompare) const
73 : : {
74 : 2933 : return getBitmapEx() == rCompare.getBitmapEx();
75 : : }
76 : :
77 : : /// helper accesses which create on-demand needed segments
78 : : const BitmapEx& getTopLeft() const;
79 : : const BitmapEx& getTop() const;
80 : : const BitmapEx& getTopRight() const;
81 : : const BitmapEx& getRight() const;
82 : : const BitmapEx& getBottomRight() const;
83 : : const BitmapEx& getBottom() const;
84 : : const BitmapEx& getBottomLeft() const;
85 : : const BitmapEx& getLeft() const;
86 : : };
87 : :
88 : : /** DiscreteShadowPrimitive2D class
89 : :
90 : : */
91 [ + - ][ + - ]: 3952 : class DRAWINGLAYER_DLLPUBLIC DiscreteShadowPrimitive2D : public DiscreteMetricDependentPrimitive2D
[ - + ]
92 : : {
93 : : private:
94 : : // the object transformation of the rectangular object
95 : : basegfx::B2DHomMatrix maTransform;
96 : :
97 : : // the bitmap shadow data
98 : : DiscreteShadow maDiscreteShadow;
99 : :
100 : : protected:
101 : : /// create local decomposition
102 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
103 : :
104 : : public:
105 : : /// constructor
106 : : DiscreteShadowPrimitive2D(
107 : : const basegfx::B2DHomMatrix& rTransform,
108 : : const DiscreteShadow& rDiscreteShadow);
109 : :
110 : : /// data read access
111 : 11428 : const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
112 : 14924 : const DiscreteShadow& getDiscreteShadow() const { return maDiscreteShadow; }
113 : :
114 : : /// compare operator
115 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
116 : :
117 : : /// get range
118 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
119 : :
120 : : /// provide unique ID
121 : : DeclPrimitrive2DIDBlock()
122 : : };
123 : : } // end of namespace primitive2d
124 : : } // end of namespace drawinglayer
125 : :
126 : : //////////////////////////////////////////////////////////////////////////////
127 : :
128 : : #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
129 : :
130 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|