Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
21 : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
22 :
23 : #include <drawinglayer/drawinglayerdllapi.h>
24 :
25 : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 : #include <drawinglayer/attribute/fillhatchattribute.hxx>
27 : #include <basegfx/color/bcolor.hxx>
28 :
29 : //////////////////////////////////////////////////////////////////////////////
30 : // FillHatchPrimitive2D class
31 :
32 : namespace drawinglayer
33 : {
34 : namespace primitive2d
35 : {
36 : /** FillHatchPrimitive2D class
37 :
38 : This class defines a hatch filling for a rectangular area. The
39 : Range is defined by the Transformation, the hatch by the FillHatchAttribute.
40 : If the background is to be filled, a flag in FillHatchAttribute is set and
41 : the BColor defines the background color.
42 :
43 : The decomposition will deliver the hatch lines.
44 : */
45 0 : class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D : public BufferedDecompositionPrimitive2D
46 : {
47 : private:
48 : /// the geometric definition
49 : basegfx::B2DRange maObjectRange;
50 :
51 : /// the hatch definition
52 : attribute::FillHatchAttribute maFillHatch;
53 :
54 : /// hatch background color (if used)
55 : basegfx::BColor maBColor;
56 :
57 : protected:
58 : /// local decomposition.
59 : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
60 :
61 : public:
62 : /// constructor
63 : FillHatchPrimitive2D(
64 : const basegfx::B2DRange& rObjectRange,
65 : const basegfx::BColor& rBColor,
66 : const attribute::FillHatchAttribute& rFillHatch);
67 :
68 : /// data read access
69 0 : const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
70 0 : const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
71 0 : const basegfx::BColor& getBColor() const { return maBColor; }
72 :
73 : /// compare operator
74 : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
75 :
76 : /// get range
77 : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
78 :
79 : /// provide unique ID
80 : DeclPrimitrive2DIDBlock()
81 : };
82 : } // end of namespace primitive2d
83 : } // end of namespace drawinglayer
84 :
85 : //////////////////////////////////////////////////////////////////////////////
86 :
87 : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|