1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
29 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
30 
31 #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
32 #include <basegfx/polygon/b3dpolypolygon.hxx>
33 #include <drawinglayer/attribute/materialattribute3d.hxx>
34 
35 //////////////////////////////////////////////////////////////////////////////
36 
37 namespace drawinglayer
38 {
39 	namespace primitive3d
40 	{
41         /** PolyPolygonMaterialPrimitive3D class
42 
43             This primitive defines a planar 3D PolyPolygon filled with a single color.
44             This is one of the non-decomposable primitives, so a renderer
45             should proccess it.
46 
47             It is assumed here that the PolyPolgon is a single plane in 3D.
48          */
49 		class PolyPolygonMaterialPrimitive3D : public BasePrimitive3D
50 		{
51 		private:
52             /// the PolyPolygon geometry
53 			basegfx::B3DPolyPolygon						maPolyPolygon;
54 
55             /// the fill parameters
56 			attribute::MaterialAttribute3D				maMaterial;
57 
58 			/// bitfield
59 			unsigned									mbDoubleSided : 1;
60 
61 		public:
62             /// constructor
63 			PolyPolygonMaterialPrimitive3D(
64 				const basegfx::B3DPolyPolygon& rPolyPolygon,
65 				const attribute::MaterialAttribute3D& rMaterial,
66 				bool bDoubleSided);
67 
68 			/// data read access
69 			const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
70 			const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
71 			bool getDoubleSided() const { return mbDoubleSided; }
72 
73 			/// compare operator
74 			virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
75 
76 			/// get range
77 			virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
78 
79 			/// provide unique ID
80 			DeclPrimitrive3DIDBlock()
81 		};
82 	} // end of namespace primitive3d
83 } // end of namespace drawinglayer
84 
85 //////////////////////////////////////////////////////////////////////////////
86 
87 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYPOLYGONPRIMITIVE3D_HXX
88 
89 //////////////////////////////////////////////////////////////////////////////
90 // eof
91