xref: /trunk/main/svx/inc/svx/cube3d.hxx (revision cdf0e10c)
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_CUBE3D_HXX
29 #define _E3D_CUBE3D_HXX
30 
31 #include <svx/obj3d.hxx>
32 #include "svx/svxdllapi.h"
33 
34 /*************************************************************************
35 |*
36 |*                                                              |
37 |* 3D-Quader erzeugen; aPos: Zentrum oder links, unten, hinten  |__
38 |*                           (abhaengig von bPosIsCenter)      /
39 |* Mit nSideFlags kann angegeben werden, ob nur ein Teil der
40 |* Quaderflaechen erzeugt werden kann; die entsprechenden Bits
41 |* sind in dem enum definiert. Das Flag bDblSided legt fest,
42 |* ob die erzeugten Flaechen doppelseitig sind (nur sinnvoll,
43 |* wenn nicht alle Flaechen erzeugt wurden).
44 |*
45 \************************************************************************/
46 
47 enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004,
48 	   CUBE_TOP = 0x0008, CUBE_RIGHT = 0x0010, CUBE_FRONT = 0x0020,
49 	   CUBE_FULL = 0x003F, CUBE_OPEN_TB = 0x0036, CUBE_OPEN_LR = 0x002B,
50 	   CUBE_OPEN_FB = 0x001D };
51 
52 class SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
53 {
54 private:
55 	// Parameter
56 	basegfx::B3DPoint					aCubePos;
57 	basegfx::B3DVector					aCubeSize;
58 	sal_uInt16								nSideFlags;
59 
60 	// BOOLeans
61 	unsigned							bPosIsCenter : 1;
62 
63 protected:
64 	void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
65 	virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
66 
67 public:
68 	TYPEINFO();
69 	E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize);
70 	E3dCubeObj();
71 
72 	virtual sal_uInt16 GetObjIdentifier() const;
73 	virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier) const;
74 
75 	virtual void operator=(const SdrObject&);
76 
77 	// Lokale Parameter setzen mit Geometrieneuerzeugung
78 	void SetCubePos(const basegfx::B3DPoint& rNew);
79 	const basegfx::B3DPoint& GetCubePos() { return aCubePos; }
80 
81 	void SetCubeSize(const basegfx::B3DVector& rNew);
82 	const basegfx::B3DVector& GetCubeSize() { return aCubeSize; }
83 
84 	void SetPosIsCenter(sal_Bool bNew);
85 	sal_Bool GetPosIsCenter() { return (sal_Bool)bPosIsCenter; }
86 
87 	void SetSideFlags(sal_uInt16 nNew);
88 	sal_uInt16 GetSideFlags() { return nSideFlags; }
89 
90 	// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
91 	virtual void TakeObjNameSingul(String& rName) const;
92 	virtual void TakeObjNamePlural(String& rName) const;
93 };
94 
95 #endif			// _E3D_CUBE3D_HXX
96