xref: /AOO41X/main/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx (revision 4f506f19cd544df9572ed8c88b6bdbc6c8f33210)
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_POLYPOLYGONPRIMITIVE3D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
29 #include <basegfx/polygon/b3dpolypolygon.hxx>
30 #include <drawinglayer/attribute/materialattribute3d.hxx>
31 
32 //////////////////////////////////////////////////////////////////////////////
33 
34 namespace drawinglayer
35 {
36     namespace primitive3d
37     {
38         /** PolyPolygonMaterialPrimitive3D class
39 
40             This primitive defines a planar 3D PolyPolygon filled with a single color.
41             This is one of the non-decomposable primitives, so a renderer
42             should proccess it.
43 
44             It is assumed here that the PolyPolgon is a single plane in 3D.
45          */
46         class DRAWINGLAYER_DLLPUBLIC PolyPolygonMaterialPrimitive3D : public BasePrimitive3D
47         {
48         private:
49             /// the PolyPolygon geometry
50             basegfx::B3DPolyPolygon                     maPolyPolygon;
51 
52             /// the fill parameters
53             attribute::MaterialAttribute3D              maMaterial;
54 
55             /// bitfield
56             unsigned                                    mbDoubleSided : 1;
57 
58         public:
59             /// constructor
60             PolyPolygonMaterialPrimitive3D(
61                 const basegfx::B3DPolyPolygon& rPolyPolygon,
62                 const attribute::MaterialAttribute3D& rMaterial,
63                 bool bDoubleSided);
64 
65             /// data read access
getB3DPolyPolygon() const66             const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
getMaterial() const67             const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
getDoubleSided() const68             bool getDoubleSided() const { return mbDoubleSided; }
69 
70             /// compare operator
71             virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
72 
73             /// get range
74             virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
75 
76             /// provide unique ID
77             DeclPrimitrive3DIDBlock()
78         };
79     } // end of namespace primitive3d
80 } // end of namespace drawinglayer
81 
82 //////////////////////////////////////////////////////////////////////////////
83 
84 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
85 
86 //////////////////////////////////////////////////////////////////////////////
87 // eof
88