Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / cube3d.hxx
blobe065eef242c51574b4c1d3448ffa862636731bff
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_CUBE3D_HXX
21 #define INCLUDED_SVX_CUBE3D_HXX
23 #include <basegfx/point/b3dpoint.hxx>
24 #include <basegfx/vector/b3dvector.hxx>
25 #include <rtl/ustring.hxx>
26 #include <sal/types.h>
27 #include <svx/obj3d.hxx>
28 #include <svx/svdobj.hxx>
29 #include <svx/svxdllapi.h>
30 #include <o3tl/typed_flags_set.hxx>
32 namespace sdr { namespace contact { class ViewContact; } }
34 class E3dDefaultAttributes;
36 /*************************************************************************
38 |* |
39 |* Create a 3D cuboid; aPos: Center or left, bottom, behind |__
40 |* (depending on bPosIsCenter) /
41 |* nSideFlags indicates, if only some of the cuboid surfaces can
42 |* be created; the corresponding bits are defined in the enum.
43 |* The flag bDblSided indicates whether the created surfaces are
44 |* two-sided (which only makes sense if not all of the surfaces were
45 |* created).
47 \************************************************************************/
49 enum class CubeFaces
51 Bottom = 0x0001,
52 Back = 0x0002,
53 Left = 0x0004,
54 Top = 0x0008,
55 Right = 0x0010,
56 Front = 0x0020,
57 Full = Bottom | Back | Left | Top | Right | Front
59 namespace o3tl
61 template<> struct typed_flags<CubeFaces> : is_typed_flags<CubeFaces, 0x003f> {};
64 class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
66 private:
67 // Parameter
68 basegfx::B3DPoint aCubePos;
69 basegfx::B3DVector aCubeSize;
70 CubeFaces nSideFlags;
72 // BOOLeans
73 bool bPosIsCenter : 1;
75 protected:
76 void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
77 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
79 public:
80 E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize);
81 E3dCubeObj();
83 virtual sal_uInt16 GetObjIdentifier() const override;
84 virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
86 virtual E3dCubeObj* Clone() const override;
88 // Set local parameters with geometry recreation
89 void SetCubePos(const basegfx::B3DPoint& rNew);
90 const basegfx::B3DPoint& GetCubePos() const { return aCubePos; }
92 void SetCubeSize(const basegfx::B3DVector& rNew);
93 const basegfx::B3DVector& GetCubeSize() const { return aCubeSize; }
95 void SetPosIsCenter(bool bNew);
96 bool GetPosIsCenter() const { return bPosIsCenter; }
98 // TakeObjName...() is for the display in the UI, for example "3 frames selected".
99 virtual OUString TakeObjNameSingul() const override;
100 virtual OUString TakeObjNamePlural() const override;
103 #endif // INCLUDED_SVX_CUBE3D_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */