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_MARKERARRAYPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <basegfx/color/bcolor.hxx>
36 : : #include <vcl/bitmapex.hxx>
37 : :
38 : : //////////////////////////////////////////////////////////////////////////////
39 : : // MarkerArrayPrimitive2D class
40 : :
41 : : namespace drawinglayer
42 : : {
43 : : namespace primitive2d
44 : : {
45 : : /** MarkerArrayPrimitive2D class
46 : :
47 : : This primtive defines an array of markers. Their size is defined
48 : : in pixels and independent from the view transformation which makes
49 : : this primitive highly view-dependent. It is also transformation
50 : : invariant, so that the bitmap is always visualized unscaled and
51 : : unrotated.
52 : : It is used e.g. for grid position visualisation. The given Bitmap
53 : : (with transparence) is defined to be visible centered at each of the given
54 : : positions.
55 : : It decomposes to the needed number of BitmapPrimitive2D's, so it would
56 : : be efficient to handle it directly in a renderer.
57 : : */
58 [ # # ][ # # ]: 0 : class DRAWINGLAYER_DLLPUBLIC MarkerArrayPrimitive2D : public BufferedDecompositionPrimitive2D
59 : : {
60 : : private:
61 : : /// the positions for the marker
62 : : std::vector< basegfx::B2DPoint > maPositions;
63 : :
64 : : /// the marker definintion to visualize
65 : : BitmapEx maMarker;
66 : :
67 : : protected:
68 : : /// create local decomposition
69 : : virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
70 : :
71 : : public:
72 : : /// constructor
73 : : MarkerArrayPrimitive2D(
74 : : const std::vector< basegfx::B2DPoint >& rPositions,
75 : : const BitmapEx& rMarker);
76 : :
77 : : /// data read access
78 : 0 : const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
79 : 0 : const BitmapEx& getMarker() const { return maMarker; }
80 : :
81 : : /// compare operator
82 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
83 : :
84 : : /// get range
85 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
86 : :
87 : : /// provide unique ID
88 : : DeclPrimitrive2DIDBlock()
89 : : };
90 : : } // end of namespace primitive2d
91 : : } // end of namespace drawinglayer
92 : :
93 : : //////////////////////////////////////////////////////////////////////////////
94 : :
95 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MARKERARRAYPRIMITIVE2D_HXX
96 : :
97 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|