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>
33 namespace drawinglayer
37 /** TexturePrimitive3D class
39 This 3D grouping primitive is used to define a texture for
40 3d geometry by embedding it. It is used as bae class for
41 extended texture definitions
43 class DRAWINGLAYER_DLLPUBLIC TexturePrimitive3D
: public GroupPrimitive3D
46 /// texture geometry definition
47 basegfx::B2DVector maTextureSize
;
50 /// flag if texture shall be modulated with white interpolated color
53 /// flag if texture shall be filtered
59 const Primitive3DSequence
& rChildren
,
60 const basegfx::B2DVector
& rTextureSize
,
65 const basegfx::B2DVector
& getTextureSize() const { return maTextureSize
; }
66 bool getModulate() const { return mbModulate
; }
67 bool getFilter() const { return mbFilter
; }
70 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const SAL_OVERRIDE
;
72 } // end of namespace primitive3d
73 } // end of namespace drawinglayer
77 namespace drawinglayer
81 /** UnifiedTransparenceTexturePrimitive3D class
83 This 3D primitive expands TexturePrimitive3D to a unified
84 transparence texture definition. All 3D primitives
85 embedded here will be shown with the given transparency.
87 class DRAWINGLAYER_DLLPUBLIC UnifiedTransparenceTexturePrimitive3D
: public TexturePrimitive3D
90 /// transparency definition
91 double mfTransparence
;
95 UnifiedTransparenceTexturePrimitive3D(
97 const Primitive3DSequence
& rChildren
);
100 double getTransparence() const { return mfTransparence
; }
103 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const SAL_OVERRIDE
;
105 /// own getB3DRange implementation to include transparent geometries to BoundRect calculations
106 virtual basegfx::B3DRange
getB3DRange(const geometry::ViewInformation3D
& rViewInformation
) const SAL_OVERRIDE
;
108 /// local decomposition.
109 virtual Primitive3DSequence
get3DDecomposition(const geometry::ViewInformation3D
& rViewInformation
) const SAL_OVERRIDE
;
111 /// provide unique ID
112 DeclPrimitive3DIDBlock()
114 } // end of namespace primitive3d
115 } // end of namespace drawinglayer
119 namespace drawinglayer
121 namespace primitive3d
123 /** GradientTexturePrimitive3D class
125 This 3D primitive expands TexturePrimitive3D to a gradient texture
126 definition. All 3D primitives embedded here will be shown with the
129 class DRAWINGLAYER_DLLPUBLIC GradientTexturePrimitive3D
: public TexturePrimitive3D
132 /// the gradient definition
133 attribute::FillGradientAttribute maGradient
;
137 GradientTexturePrimitive3D(
138 const attribute::FillGradientAttribute
& rGradient
,
139 const Primitive3DSequence
& rChildren
,
140 const basegfx::B2DVector
& rTextureSize
,
145 const attribute::FillGradientAttribute
& getGradient() const { return maGradient
; }
148 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const SAL_OVERRIDE
;
150 /// provide unique ID
151 DeclPrimitive3DIDBlock()
153 } // end of namespace primitive3d
154 } // end of namespace drawinglayer
158 namespace drawinglayer
160 namespace primitive3d
162 /** BitmapTexturePrimitive3D class
164 This 3D primitive expands TexturePrimitive3D to a bitmap texture
165 definition. All 3D primitives embedded here will be shown with the
166 defined bitmap (maybe tiled if defined).
168 class DRAWINGLAYER_DLLPUBLIC BitmapTexturePrimitive3D
: public TexturePrimitive3D
171 /// bitmap fill attribute
172 attribute::FillGraphicAttribute maFillGraphicAttribute
;
176 BitmapTexturePrimitive3D(
177 const attribute::FillGraphicAttribute
& rFillGraphicAttribute
,
178 const Primitive3DSequence
& rChildren
,
179 const basegfx::B2DVector
& rTextureSize
,
184 const attribute::FillGraphicAttribute
& getFillGraphicAttribute() const { return maFillGraphicAttribute
; }
187 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const SAL_OVERRIDE
;
189 /// provide unique ID
190 DeclPrimitive3DIDBlock()
192 } // end of namespace primitive3d
193 } // end of namespace drawinglayer
197 namespace drawinglayer
199 namespace primitive3d
201 /** TransparenceTexturePrimitive3D class
203 This 3D primitive expands TexturePrimitive3D to a transparence texture
204 definition. For transparence definition, a gradient is used. The values in
205 that gradient will be interpreted as luminance Transparence-Values. All 3D
206 primitives embedded here will be shown with the defined transparence.
208 class DRAWINGLAYER_DLLPUBLIC TransparenceTexturePrimitive3D
: public GradientTexturePrimitive3D
212 TransparenceTexturePrimitive3D(
213 const attribute::FillGradientAttribute
& rGradient
,
214 const Primitive3DSequence
& rChildren
,
215 const basegfx::B2DVector
& rTextureSize
);
218 virtual bool operator==(const BasePrimitive3D
& rPrimitive
) const SAL_OVERRIDE
;
220 /// provide unique ID
221 DeclPrimitive3DIDBlock()
223 } // end of namespace primitive3d
224 } // end of namespace drawinglayer
228 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
230 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */