xref: /trunk/main/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive3d/groupprimitive3d.hxx>
29 #include <basegfx/matrix/b2dhommatrix.hxx>
30 #include <basegfx/color/bcolor.hxx>
31 
32 //////////////////////////////////////////////////////////////////////////////
33 
34 namespace drawinglayer
35 {
36     namespace primitive3d
37     {
38         /** ShadowPrimitive3D class
39 
40             This 3D grouping primitive is used to define a shadow for
41             3d geometry by embedding it. The shadow of 3D objects are
42             2D polygons, so the shadow transformation is a 2D transformation.
43 
44             If the Shadow3D flag is set, the shadow definition has to be
45             combined with the scene and camera definition to create the correct
46             projected shadow 2D-Polygons.
47          */
48         class DRAWINGLAYER_DLLPUBLIC ShadowPrimitive3D : public GroupPrimitive3D
49         {
50         protected:
51             /// 2D shadow definition
52             basegfx::B2DHomMatrix                   maShadowTransform;
53             basegfx::BColor                         maShadowColor;
54             double                                  mfShadowTransparence;
55 
56             /// bitfield
57             unsigned                                mbShadow3D : 1;
58 
59         public:
60             /// constructor
61             ShadowPrimitive3D(
62                 const basegfx::B2DHomMatrix& rShadowTransform,
63                 const basegfx::BColor& rShadowColor,
64                 double fShadowTransparence,
65                 bool bShadow3D,
66                 const Primitive3DSequence& rChildren);
67 
68             /// data read access
getShadowTransform() const69             const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
getShadowColor() const70             const basegfx::BColor& getShadowColor() const { return maShadowColor; }
getShadowTransparence() const71             double getShadowTransparence() const { return mfShadowTransparence; }
getShadow3D() const72             bool getShadow3D() const { return mbShadow3D; }
73 
74             /// compare operator
75             virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
76 
77             /// provide unique ID
78             DeclPrimitrive3DIDBlock()
79         };
80     } // end of namespace primitive3d
81 } // end of namespace drawinglayer
82 
83 //////////////////////////////////////////////////////////////////////////////
84 
85 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SHADOWPRIMITIVE3D_HXX
86 
87 //////////////////////////////////////////////////////////////////////////////
88 // eof
89