Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
21 : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
22 :
23 : #include <drawinglayer/drawinglayerdllapi.h>
24 :
25 : #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
26 :
27 :
28 :
29 : namespace drawinglayer
30 : {
31 : namespace primitive2d
32 : {
33 : /** UnifiedTransparencePrimitive2D class
34 :
35 : This primitive encapsualtes a child hierarchy and defines
36 : that it shall be visualized with the given transparency. That
37 : transparency is unique for all contained geometry, so that
38 : e.g. overlapping polygons in the child geometry will not show
39 : regions of combined transparency, but be all rendered with the
40 : defined, single transparency.
41 : */
42 4002 : class DRAWINGLAYER_DLLPUBLIC UnifiedTransparencePrimitive2D : public GroupPrimitive2D
43 : {
44 : private:
45 : /// the unified transparence
46 : double mfTransparence;
47 :
48 : public:
49 : /// constructor
50 : UnifiedTransparencePrimitive2D(
51 : const Primitive2DSequence& rChildren,
52 : double fTransparence);
53 :
54 : /// data read access
55 10066 : double getTransparence() const { return mfTransparence; }
56 :
57 : /// compare operator
58 : virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;
59 :
60 : /// own getB2DRange implementation to include transparent geometries to BoundRect calculations
61 : virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
62 :
63 : /// create decomposition
64 : virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
65 :
66 : /// provide unique ID
67 : DeclPrimitive2DIDBlock()
68 : };
69 : } // end of namespace primitive2d
70 : } // end of namespace drawinglayer
71 :
72 :
73 :
74 : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|