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