nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive2d / transformprimitive2d.hxx
blob25549e633ad9903523193d0fb679a8755f6869b0
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 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
28 namespace drawinglayer::primitive2d
30 /** TransformPrimitive2D class
32 This is one of the basic grouping primitives and it provides
33 embedding a sequence of primitives (a geometry) into a
34 transformation. All renderers have to handle this, usually by
35 building a current transformation stack (linear combination)
36 and applying this to all to-be-rendered geometry. If not handling
37 this, the output will be mostly wrong since this primitive is
38 widely used.
40 It does transform by embedding an existing geometry into a
41 transformation as Child-content. This allows re-usage of the
42 refcounted Uno-Api primitives and their existing, buffered
43 decompositions.
45 It could e.g. be used to show a single object geometry in 1000
46 different, transformed states without the need to create those
47 thousand primitive contents.
49 class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D final : public GroupPrimitive2D
51 private:
52 // the transformation to apply to the child geometry
53 basegfx::B2DHomMatrix maTransformation;
55 public:
56 /// constructor
57 TransformPrimitive2D(
58 const basegfx::B2DHomMatrix& rTransformation,
59 const Primitive2DContainer& rChildren);
61 /// data read access
62 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
64 /// compare operator
65 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
67 /// get range
68 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
70 /// provide unique ID
71 virtual sal_uInt32 getPrimitive2DID() const override;
73 } // end of namespace drawinglayer::primitive2d
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */