Update git submodules
[LibreOffice.git] / include / drawinglayer / primitive2d / unifiedtransparenceprimitive2d.hxx
blobb5a75f295cbe0802f8d10a8f956c3150485348a0
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>
27 namespace drawinglayer::primitive2d
29 /** UnifiedTransparencePrimitive2D class
31 This primitive encapsulates a child hierarchy and defines
32 that it shall be visualized with the given transparency. That
33 transparency is unique for all contained geometry, so that
34 e.g. overlapping polygons in the child geometry will not show
35 regions of combined transparency, but be all rendered with the
36 defined, single transparency.
38 class DRAWINGLAYER_DLLPUBLIC UnifiedTransparencePrimitive2D final : public GroupPrimitive2D
40 private:
41 /// the unified transparence
42 double mfTransparence;
44 public:
45 /// constructor
46 UnifiedTransparencePrimitive2D(
47 Primitive2DContainer&& rChildren,
48 double fTransparence);
50 /// data read access
51 double getTransparence() const { return mfTransparence; }
53 /// compare operator
54 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
56 /// own getB2DRange implementation to include transparent geometries to BoundRect calculations
57 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
59 /// create decomposition
60 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
62 /// provide unique ID
63 virtual sal_uInt32 getPrimitive2DID() const override;
65 } // end of namespace drawinglayer::primitive2d
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */