1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive3d/groupprimitive3d.hxx>
26 #include <drawinglayer/attribute/fillgraphicattribute.hxx>
27 #include <basegfx/matrix/b2dhommatrix.hxx>
28 #include <basegfx/vector/b2dvector.hxx>
29 #include <drawinglayer/attribute/fillgradientattribute.hxx>
32 namespace drawinglayer
36 /** TexturePrimitive3D class
38 This 3D grouping primitive is used to define a texture for
39 3d geometry by embedding it. It is used as bae class for
40 extended texture definitions
42 class DRAWINGLAYER_DLLPUBLIC TexturePrimitive3D
: public GroupPrimitive3D
45 /// texture geometry definition
46 basegfx::B2DVector maTextureSize
;
48 /// flag if texture shall be modulated with white interpolated color
51 /// flag if texture shall be filtered
57 const Primitive3DContainer
& rChildren
,
58 const basegfx::B2DVector
& rTextureSize
,
63 const basegfx::B2DVector
& getTextureSize() const { return maTextureSize
; }
64 bool getModulate() const { return mbModulate
; }
65 bool getFilter() const { return mbFilter
; }
68 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const override
;
70 } // end of namespace primitive3d
71 } // end of namespace drawinglayer
74 namespace drawinglayer
78 /** UnifiedTransparenceTexturePrimitive3D class
80 This 3D primitive expands TexturePrimitive3D to a unified
81 transparence texture definition. All 3D primitives
82 embedded here will be shown with the given transparency.
84 class DRAWINGLAYER_DLLPUBLIC UnifiedTransparenceTexturePrimitive3D
: public TexturePrimitive3D
87 /// transparency definition
88 double mfTransparence
;
92 UnifiedTransparenceTexturePrimitive3D(
94 const Primitive3DContainer
& rChildren
);
97 double getTransparence() const { return mfTransparence
; }
100 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const override
;
102 /// own getB3DRange implementation to include transparent geometries to BoundRect calculations
103 virtual basegfx::B3DRange
getB3DRange(const geometry::ViewInformation3D
& rViewInformation
) const override
;
105 /// local decomposition.
106 virtual Primitive3DContainer
get3DDecomposition(const geometry::ViewInformation3D
& rViewInformation
) const override
;
108 /// provide unique ID
109 DeclPrimitive3DIDBlock()
111 } // end of namespace primitive3d
112 } // end of namespace drawinglayer
115 namespace drawinglayer
117 namespace primitive3d
119 /** GradientTexturePrimitive3D class
121 This 3D primitive expands TexturePrimitive3D to a gradient texture
122 definition. All 3D primitives embedded here will be shown with the
125 class DRAWINGLAYER_DLLPUBLIC GradientTexturePrimitive3D
: public TexturePrimitive3D
128 /// the gradient definition
129 attribute::FillGradientAttribute maGradient
;
133 GradientTexturePrimitive3D(
134 const attribute::FillGradientAttribute
& rGradient
,
135 const Primitive3DContainer
& rChildren
,
136 const basegfx::B2DVector
& rTextureSize
,
141 const attribute::FillGradientAttribute
& getGradient() const { return maGradient
; }
144 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const override
;
146 /// provide unique ID
147 DeclPrimitive3DIDBlock()
149 } // end of namespace primitive3d
150 } // end of namespace drawinglayer
153 namespace drawinglayer
155 namespace primitive3d
157 /** BitmapTexturePrimitive3D class
159 This 3D primitive expands TexturePrimitive3D to a bitmap texture
160 definition. All 3D primitives embedded here will be shown with the
161 defined bitmap (maybe tiled if defined).
163 class DRAWINGLAYER_DLLPUBLIC BitmapTexturePrimitive3D
: public TexturePrimitive3D
166 /// bitmap fill attribute
167 attribute::FillGraphicAttribute maFillGraphicAttribute
;
171 BitmapTexturePrimitive3D(
172 const attribute::FillGraphicAttribute
& rFillGraphicAttribute
,
173 const Primitive3DContainer
& rChildren
,
174 const basegfx::B2DVector
& rTextureSize
,
179 const attribute::FillGraphicAttribute
& getFillGraphicAttribute() const { return maFillGraphicAttribute
; }
182 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const override
;
184 /// provide unique ID
185 DeclPrimitive3DIDBlock()
187 } // end of namespace primitive3d
188 } // end of namespace drawinglayer
191 namespace drawinglayer
193 namespace primitive3d
195 /** TransparenceTexturePrimitive3D class
197 This 3D primitive expands TexturePrimitive3D to a transparence texture
198 definition. For transparence definition, a gradient is used. The values in
199 that gradient will be interpreted as luminance Transparence-Values. All 3D
200 primitives embedded here will be shown with the defined transparence.
202 class DRAWINGLAYER_DLLPUBLIC TransparenceTexturePrimitive3D
: public GradientTexturePrimitive3D
206 TransparenceTexturePrimitive3D(
207 const attribute::FillGradientAttribute
& rGradient
,
208 const Primitive3DContainer
& rChildren
,
209 const basegfx::B2DVector
& rTextureSize
);
212 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const override
;
214 /// provide unique ID
215 DeclPrimitive3DIDBlock()
217 } // end of namespace primitive3d
218 } // end of namespace drawinglayer
221 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
223 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */