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_TRANSFORMPRIMITIVE2D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : :
37 : : //////////////////////////////////////////////////////////////////////////////
38 : :
39 : : namespace drawinglayer
40 : : {
41 : : namespace primitive2d
42 : : {
43 : : /** TransformPrimitive2D class
44 : :
45 : : This is one of the basic grouping primitives and it provides
46 : : embedding a sequence of primitives (a geometry) into a
47 : : transformation. All renderers have to handle this, usually by
48 : : building a current transformation stack (linear combination)
49 : : and applying this to all to-be-rendered geometry. If not handling
50 : : this, the output will be mostly wrong since this primitive is
51 : : widely used.
52 : :
53 : : It does transform by embedding an existing geometry into a
54 : : transformation as Child-content. This allows re-usage of the
55 : : refcounted Uno-Api primitives and their existung, buffered
56 : : decompositions.
57 : :
58 : : It could e.g. be used to show a single object geometry in 1000
59 : : different, transformed states without the need to create those
60 : : thousand primitive contents.
61 : : */
62 [ + - ][ - + ]: 7912 : class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D : public GroupPrimitive2D
63 : : {
64 : : private:
65 : : // the transformation to apply to the child geometry
66 : : basegfx::B2DHomMatrix maTransformation;
67 : :
68 : : public:
69 : : /// constructor
70 : : TransformPrimitive2D(
71 : : const basegfx::B2DHomMatrix& rTransformation,
72 : : const Primitive2DSequence& rChildren);
73 : :
74 : : /// data read access
75 : 24893 : const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
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_TRANSFORMPRIMITIVE2D_HXX
92 : :
93 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|