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_FILLHATCHPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <drawinglayer/attribute/fillhatchattribute.hxx>
36 : : #include <basegfx/color/bcolor.hxx>
37 : :
38 : : //////////////////////////////////////////////////////////////////////////////
39 : : // FillHatchPrimitive2D class
40 : :
41 : : namespace drawinglayer
42 : : {
43 : : namespace primitive2d
44 : : {
45 : : /** FillHatchPrimitive2D class
46 : :
47 : : This class defines a hatch filling for a rectangular area. The
48 : : Range is defined by the Transformation, the hatch by the FillHatchAttribute.
49 : : If the background is to be filled, a flag in FillHatchAttribute is set and
50 : : the BColor defines the background color.
51 : :
52 : : The decomposition will deliver the hatch lines.
53 : : */
54 [ + - ][ - + ]: 2532 : class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D : public BufferedDecompositionPrimitive2D
55 : : {
56 : : private:
57 : : /// the geometric definition
58 : : basegfx::B2DRange maObjectRange;
59 : :
60 : : /// the hatch definition
61 : : attribute::FillHatchAttribute maFillHatch;
62 : :
63 : : /// hatch background color (if used)
64 : : basegfx::BColor maBColor;
65 : :
66 : : protected:
67 : : /// local decomposition.
68 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
69 : :
70 : : public:
71 : : /// constructor
72 : : FillHatchPrimitive2D(
73 : : const basegfx::B2DRange& rObjectRange,
74 : : const basegfx::BColor& rBColor,
75 : : const attribute::FillHatchAttribute& rFillHatch);
76 : :
77 : : /// data read access
78 : 616 : const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
79 : 616 : const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
80 : 616 : const basegfx::BColor& getBColor() const { return maBColor; }
81 : :
82 : : /// compare operator
83 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
84 : :
85 : : /// get range
86 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
87 : :
88 : : /// provide unique ID
89 : : DeclPrimitrive2DIDBlock()
90 : : };
91 : : } // end of namespace primitive2d
92 : : } // end of namespace drawinglayer
93 : :
94 : : //////////////////////////////////////////////////////////////////////////////
95 : :
96 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
97 : :
98 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|