build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / drawinglayer / primitive2d / transformprimitive2d.hxx
blob38e4543eed523a3b65a3712de8121c2b672ad632
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_TRANSFORMPRIMITIVE2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
29 namespace drawinglayer
31 namespace primitive2d
33 /** TransformPrimitive2D class
35 This is one of the basic grouping primitives and it provides
36 embedding a sequence of primitives (a geometry) into a
37 transformation. All renderers have to handle this, usually by
38 building a current transformation stack (linear combination)
39 and applying this to all to-be-rendered geometry. If not handling
40 this, the output will be mostly wrong since this primitive is
41 widely used.
43 It does transform by embedding an existing geometry into a
44 transformation as Child-content. This allows re-usage of the
45 refcounted Uno-Api primitives and their existing, buffered
46 decompositions.
48 It could e.g. be used to show a single object geometry in 1000
49 different, transformed states without the need to create those
50 thousand primitive contents.
52 class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D : public GroupPrimitive2D
54 private:
55 // the transformation to apply to the child geometry
56 basegfx::B2DHomMatrix maTransformation;
58 public:
59 /// constructor
60 TransformPrimitive2D(
61 const basegfx::B2DHomMatrix& rTransformation,
62 const Primitive2DContainer& rChildren);
64 /// data read access
65 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
67 /// compare operator
68 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
70 /// get range
71 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
73 /// provide unique ID
74 DeclPrimitive2DIDBlock()
76 } // end of namespace primitive2d
77 } // end of namespace drawinglayer
80 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */