Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _E3D_CUBE3D_HXX
30 : : #define _E3D_CUBE3D_HXX
31 : :
32 : : #include <svx/obj3d.hxx>
33 : : #include "svx/svxdllapi.h"
34 : :
35 : : /*************************************************************************
36 : : |*
37 : : |* |
38 : : |* Create a 3D cuboid; aPos: Center oder left, bottom, behind |__
39 : : |* (depending on bPosIsCenter) /
40 : : |* nSideFlags indicates, if only some of the cuboid surfaces can
41 : : |* be created; the corresponding bits are defined in the enum.
42 : : |* The flag bDblSided indicates whether the created surfaces are
43 : : |* two-sided (which only makes sense if not all of the surfaces were
44 : : |* created).
45 : : |*
46 : : \************************************************************************/
47 : :
48 : : enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004,
49 : : CUBE_TOP = 0x0008, CUBE_RIGHT = 0x0010, CUBE_FRONT = 0x0020,
50 : : CUBE_FULL = 0x003F, CUBE_OPEN_TB = 0x0036, CUBE_OPEN_LR = 0x002B,
51 : : CUBE_OPEN_FB = 0x001D };
52 : :
53 [ # # ]: 0 : class SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
54 : : {
55 : : private:
56 : : // Parameter
57 : : basegfx::B3DPoint aCubePos;
58 : : basegfx::B3DVector aCubeSize;
59 : : sal_uInt16 nSideFlags;
60 : :
61 : : // BOOLeans
62 : : unsigned bPosIsCenter : 1;
63 : :
64 : : protected:
65 : : void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
66 : : virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
67 : :
68 : : public:
69 : : TYPEINFO();
70 : : E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize);
71 : : E3dCubeObj();
72 : :
73 : : virtual sal_uInt16 GetObjIdentifier() const;
74 : : virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier) const;
75 : :
76 : : virtual E3dCubeObj* Clone() const;
77 : :
78 : : // Set local parameters with geometry recreation
79 : : void SetCubePos(const basegfx::B3DPoint& rNew);
80 : 0 : const basegfx::B3DPoint& GetCubePos() { return aCubePos; }
81 : :
82 : : void SetCubeSize(const basegfx::B3DVector& rNew);
83 : 0 : const basegfx::B3DVector& GetCubeSize() { return aCubeSize; }
84 : :
85 : : void SetPosIsCenter(sal_Bool bNew);
86 : 0 : sal_Bool GetPosIsCenter() { return (sal_Bool)bPosIsCenter; }
87 : :
88 : : sal_uInt16 GetSideFlags() { return nSideFlags; }
89 : :
90 : : // TakeObjName...() is for the display in the UI, for example "3 frames selected".
91 : : virtual void TakeObjNameSingul(String& rName) const;
92 : : virtual void TakeObjNamePlural(String& rName) const;
93 : : };
94 : :
95 : : #endif // _E3D_CUBE3D_HXX
96 : :
97 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|