/src/libreoffice/include/svx/cube3d.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #ifndef INCLUDED_SVX_CUBE3D_HXX |
21 | | #define INCLUDED_SVX_CUBE3D_HXX |
22 | | |
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/svxdllapi.h> |
29 | | |
30 | | class E3dDefaultAttributes; |
31 | | |
32 | | /************************************************************************* |
33 | | |* |
34 | | |* | |
35 | | |* Create a 3D cuboid; aPos: Center or left, bottom, behind |__ |
36 | | |* (depending on bPosIsCenter) / |
37 | | |* nSideFlags indicates, if only some of the cuboid surfaces can |
38 | | |* be created; the corresponding bits are defined in the enum. |
39 | | |* The flag bDblSided indicates whether the created surfaces are |
40 | | |* two-sided (which only makes sense if not all of the surfaces were |
41 | | |* created). |
42 | | |* |
43 | | \************************************************************************/ |
44 | | |
45 | | class SAL_WARN_UNUSED E3dCubeObj final : public E3dCompoundObject |
46 | | { |
47 | | // Parameter |
48 | | basegfx::B3DPoint m_aCubePos; |
49 | | basegfx::B3DVector m_aCubeSize; |
50 | | |
51 | | // BOOLeans |
52 | | bool m_bPosIsCenter : 1; |
53 | | |
54 | | void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); |
55 | | virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; |
56 | | |
57 | | private: |
58 | | // protected destructor - due to final, make private |
59 | | virtual ~E3dCubeObj() override; |
60 | | |
61 | | public: |
62 | | SVXCORE_DLLPUBLIC E3dCubeObj(SdrModel& rSdrModel, |
63 | | const E3dDefaultAttributes& rDefault, |
64 | | const basegfx::B3DPoint& aPos, |
65 | | const basegfx::B3DVector& r3DSize); |
66 | | E3dCubeObj(SdrModel& rSdrModel, E3dCubeObj const &); |
67 | | E3dCubeObj(SdrModel& rSdrModel); |
68 | | |
69 | | virtual SdrObjKind GetObjIdentifier() const override; |
70 | | virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override; |
71 | | |
72 | | virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override; |
73 | | |
74 | | // Set local parameters with geometry recreation |
75 | | void SetCubePos(const basegfx::B3DPoint& rNew); |
76 | 0 | const basegfx::B3DPoint& GetCubePos() const { return m_aCubePos; } |
77 | | |
78 | | void SetCubeSize(const basegfx::B3DVector& rNew); |
79 | 0 | const basegfx::B3DVector& GetCubeSize() const { return m_aCubeSize; } |
80 | | |
81 | | void SetPosIsCenter(bool bNew); |
82 | 0 | bool GetPosIsCenter() const { return m_bPosIsCenter; } |
83 | | |
84 | | // TakeObjName...() is for the display in the UI, for example "3 frames selected". |
85 | | virtual OUString TakeObjNameSingul() const override; |
86 | | virtual OUString TakeObjNamePlural() const override; |
87 | | }; |
88 | | |
89 | | #endif // INCLUDED_SVX_CUBE3D_HXX |
90 | | |
91 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |