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_PATTERNFILLPRIMITIVE2D_HXX
21 : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
22 :
23 : #include <drawinglayer/drawinglayerdllapi.h>
24 : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 : #include <basegfx/matrix/b2dhommatrix.hxx>
26 : #include <basegfx/polygon/b2dpolypolygon.hxx>
27 :
28 :
29 :
30 : namespace drawinglayer
31 : {
32 : namespace primitive2d
33 : {
34 : /** PatternFillPrimitive2D class
35 :
36 : This primitive allows filling a given 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 PolyPolygon (in unit coordinates) which is virtually
40 : infinitely repeated.
41 : */
42 0 : class DRAWINGLAYER_DLLPUBLIC PatternFillPrimitive2D : public BufferedDecompositionPrimitive2D
43 : {
44 : private:
45 : const basegfx::B2DPolyPolygon maMask;
46 : const Primitive2DSequence maChildren;
47 : const basegfx::B2DRange maReferenceRange;
48 :
49 : protected:
50 : /// create local decomposition
51 : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
52 :
53 : public:
54 : /// constructor
55 : PatternFillPrimitive2D(
56 : const basegfx::B2DPolyPolygon& rMask,
57 : const Primitive2DSequence& rChildren,
58 : const basegfx::B2DRange& rReferenceRange);
59 :
60 : /// data read access
61 0 : const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
62 0 : const Primitive2DSequence& getChildren() const { return maChildren; }
63 0 : const basegfx::B2DRange& getReferenceRange() const { return maReferenceRange; }
64 :
65 : /// compare operator
66 : virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;
67 :
68 : /// get range
69 : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
70 :
71 : /// provide unique ID
72 : DeclPrimitive2DIDBlock()
73 : };
74 : } // end of namespace primitive2d
75 : } // end of namespace drawinglayer
76 :
77 :
78 :
79 : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PATTERNFILLPRIMITIVE2D_HXX
80 :
81 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|