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_RENDERGRAPHICPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_RENDERGRAPHICPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
33 : : #include <basegfx/matrix/b2dhommatrix.hxx>
34 : : #include <vcl/rendergraphic.hxx>
35 : : #include <memory>
36 : :
37 : : //////////////////////////////////////////////////////////////////////////////
38 : : // RenderGraphicPrimitive2D class
39 : :
40 : : namespace vcl { class RenderGraphicRasterizer; }
41 : :
42 : : namespace drawinglayer
43 : : {
44 : : namespace primitive2d
45 : : {
46 : : /** RenderGraphicPrimitive2D class
47 : :
48 : : This class is the central primitive for RenderGraphic-based primitives.
49 : : */
50 [ # # ][ # # ]: 0 : class RenderGraphicPrimitive2D : public BasePrimitive2D
[ # # ][ # # ]
51 : : {
52 : : private:
53 : : /// the RenderGraphic data
54 : : vcl::RenderGraphic maRenderGraphic;
55 : : mutable std::auto_ptr< vcl::RenderGraphicRasterizer > mapCurrentRasterizer;
56 : :
57 : : /** the object transformation from unit coordinates, defining
58 : : size, shear, rotate and position
59 : : */
60 : : basegfx::B2DHomMatrix maTransform;
61 : :
62 : : public:
63 : : /// constructor
64 : : RenderGraphicPrimitive2D(
65 : : const vcl::RenderGraphic& rRenderGraphic,
66 : : const basegfx::B2DHomMatrix& rTransform);
67 : :
68 : : /// data read access
69 : 0 : inline const vcl::RenderGraphic& getRenderGraphic() const { return maRenderGraphic; }
70 : 0 : inline const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
71 : :
72 : : // access to latest used vcl::GraphicRasterizer for possibly reusing
73 : : // an already rendered vcl::RenderGraphic with the same transform
74 : : // properties during the next rendering process
75 : : inline const vcl::RenderGraphicRasterizer* getCurrentRasterizer() const { return( mapCurrentRasterizer.get() ); }
76 : :
77 : : /// compare operator
78 : : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
79 : :
80 : : /// get range
81 : : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
82 : :
83 : : /// provide unique ID
84 : : DeclPrimitrive2DIDBlock()
85 : : };
86 : : } // end of namespace primitive2d
87 : : } // end of namespace drawinglayer
88 : :
89 : : //////////////////////////////////////////////////////////////////////////////
90 : :
91 : : #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_RENDERGRAPHICPRIMITIVE2D_HXX
92 : :
93 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|