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_MARKERARRAYPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <basegfx/color/bcolor.hxx>
27 #include <vcl/bitmapex.hxx>
30 // MarkerArrayPrimitive2D class
32 namespace drawinglayer
36 /** MarkerArrayPrimitive2D class
38 This primtive defines an array of markers. Their size is defined
39 in pixels and independent from the view transformation which makes
40 this primitive highly view-dependent. It is also transformation
41 invariant, so that the bitmap is always visualized unscaled and
43 It is used e.g. for grid position visualisation. The given Bitmap
44 (with transparence) is defined to be visible centered at each of the given
46 It decomposes to the needed number of BitmapPrimitive2D's, so it would
47 be efficient to handle it directly in a renderer.
49 class DRAWINGLAYER_DLLPUBLIC MarkerArrayPrimitive2D
: public BufferedDecompositionPrimitive2D
52 /// the positions for the marker
53 std::vector
< basegfx::B2DPoint
> maPositions
;
55 /// the marker definintion to visualize
59 /// create local decomposition
60 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
64 MarkerArrayPrimitive2D(
65 const std::vector
< basegfx::B2DPoint
>& rPositions
,
66 const BitmapEx
& rMarker
);
69 const std::vector
< basegfx::B2DPoint
>& getPositions() const { return maPositions
; }
70 const BitmapEx
& getMarker() const { return maMarker
; }
73 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const SAL_OVERRIDE
;
76 virtual basegfx::B2DRange
getB2DRange(const geometry::ViewInformation2D
& rViewInformation
) const SAL_OVERRIDE
;
79 DeclPrimitive2DIDBlock()
81 } // end of namespace primitive2d
82 } // end of namespace drawinglayer
86 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */