xref: /trunk/main/svx/inc/svx/polygn3d.hxx (revision a5258243)
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 _E3D_POLYGON3D_HXX
29 #define _E3D_POLYGON3D_HXX
30 
31 #include <svx/obj3d.hxx>
32 #include "svx/svxdllapi.h"
33 
34 class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject
35 {
36 private:
37 	// Parameter
38 	basegfx::B3DPolyPolygon	aPolyPoly3D;
39 	basegfx::B3DPolyPolygon	aPolyNormals3D;
40 	basegfx::B2DPolyPolygon	aPolyTexture2D;
41 	sal_Bool			bLineOnly;
42 
43 	SVX_DLLPRIVATE void CreateDefaultNormals();
44 	SVX_DLLPRIVATE void CreateDefaultTexture();
45 
46 protected:
47     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
48 
49 public:
50 	void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
51 	void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
52 	void SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyPoly2D);
53 
54 	TYPEINFO();
55 
56 	E3dPolygonObj(
57 		E3dDefaultAttributes& rDefault,
58 		const basegfx::B3DPolyPolygon& rPolyPoly3D,
59 		sal_Bool bLinOnly=sal_False);
60 	E3dPolygonObj(
61 		E3dDefaultAttributes& rDefault,
62 		const basegfx::B3DPolyPolygon& rPolyPoly3D,
63 		const basegfx::B3DPolyPolygon& rPolyNormals3D,
64 		sal_Bool bLinOnly=sal_False);
65 	E3dPolygonObj(
66 		E3dDefaultAttributes& rDefault,
67 		const basegfx::B3DPolyPolygon& rPolyPoly3D,
68 		const basegfx::B3DPolyPolygon& rPolyNormals3D,
69 		const basegfx::B2DPolyPolygon& rPolyTexture2D,
70 		sal_Bool bLinOnly=sal_False);
71 
72 	E3dPolygonObj();
73 	virtual ~E3dPolygonObj();
74 
75 	const basegfx::B3DPolyPolygon& GetPolyPolygon3D() const { return aPolyPoly3D; }
76 	const basegfx::B3DPolyPolygon& GetPolyNormals3D() const { return aPolyNormals3D; }
77 	const basegfx::B2DPolyPolygon& GetPolyTexture2D() const { return aPolyTexture2D; }
78 
79 	virtual sal_uInt16 GetObjIdentifier() const;
80 	virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
81 
82 	virtual void operator=(const SdrObject&);
83 
84 	// LineOnly?
85 	sal_Bool GetLineOnly() { return bLineOnly; }
86 	void SetLineOnly(sal_Bool bNew);
87 };
88 
89 #endif			// _E3D_POLYGON3D_HXX
90