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_PATTERNFILLPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
26 #include <basegfx/polygon/b2dpolypolygon.hxx>
30 namespace drawinglayer
34 /** PatternFillPrimitive2D class
36 This primitive allows filling a given tools::PolyPolygon with a pattern
37 defined by a sequence of primitives which are mapped to the unit range.
38 The pattern is defined using a reference range which defines a rectangular
39 area relative to the tools::PolyPolygon (in unit coordinates) which is virtually
42 class DRAWINGLAYER_DLLPUBLIC PatternFillPrimitive2D
: public BufferedDecompositionPrimitive2D
45 const basegfx::B2DPolyPolygon maMask
;
46 const Primitive2DSequence maChildren
;
47 const basegfx::B2DRange maReferenceRange
;
50 /// create local decomposition
51 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
55 PatternFillPrimitive2D(
56 const basegfx::B2DPolyPolygon
& rMask
,
57 const Primitive2DSequence
& rChildren
,
58 const basegfx::B2DRange
& rReferenceRange
);
61 const basegfx::B2DPolyPolygon
& getMask() const { return maMask
; }
62 const Primitive2DSequence
& getChildren() const { return maChildren
; }
63 const basegfx::B2DRange
& getReferenceRange() const { return maReferenceRange
; }
66 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
69 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
72 DeclPrimitive2DIDBlock()
74 } // end of namespace primitive2d
75 } // end of namespace drawinglayer
79 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */