/src/libreoffice/svx/inc/extrud3d.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 | | #pragma once |
21 | | |
22 | | #include <config_options.h> |
23 | | #include <svl/intitem.hxx> |
24 | | #include <svl/itemset.hxx> |
25 | | #include <svx/obj3d.hxx> |
26 | | #include <svx/svxdllapi.h> |
27 | | #include <svx/svddef.hxx> |
28 | | #include <svx/svx3ditems.hxx> |
29 | | |
30 | | class E3dDefaultAttributes; |
31 | | |
32 | | /************************************************************************* |
33 | | |* |
34 | | |* 3D extrusion object created from the provided 2D polygon |
35 | | |* |
36 | | \************************************************************************/ |
37 | | |
38 | | class SAL_WARN_UNUSED E3dExtrudeObj final : public E3dCompoundObject |
39 | | { |
40 | | private: |
41 | | // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid() |
42 | | friend class sdr::properties::E3dExtrudeProperties; |
43 | | |
44 | | // geometry, which determines the object |
45 | | basegfx::B2DPolyPolygon maExtrudePolygon; |
46 | | |
47 | | virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; |
48 | | virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override; |
49 | | void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); |
50 | | |
51 | | private: |
52 | | // protected destructor - due to final, make private |
53 | | virtual ~E3dExtrudeObj() override; |
54 | | |
55 | | public: |
56 | | SVXCORE_DLLPUBLIC E3dExtrudeObj( |
57 | | SdrModel& rSdrModel, |
58 | | const E3dDefaultAttributes& rDefault, |
59 | | basegfx::B2DPolyPolygon aPP, |
60 | | double fDepth); |
61 | | E3dExtrudeObj(SdrModel& rSdrModel, E3dExtrudeObj const & rSource); |
62 | | E3dExtrudeObj(SdrModel& rSdrModel); |
63 | | |
64 | | // PercentDiagonal: 0..100, before 0.0..0.5 |
65 | | sal_uInt16 GetPercentDiagonal() const |
66 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL).GetValue(); } |
67 | | |
68 | | // BackScale: 0..100, before 0.0..1.0 |
69 | | sal_uInt16 GetPercentBackScale() const |
70 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE).GetValue(); } |
71 | | |
72 | | // BackScale: 0..100, before 0.0..1.0 |
73 | | sal_uInt32 GetExtrudeDepth() const |
74 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH).GetValue(); } |
75 | | |
76 | | // #107245# GetSmoothNormals() for bExtrudeSmoothed |
77 | | bool GetSmoothNormals() const |
78 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS).GetValue(); } |
79 | | |
80 | | // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack |
81 | | bool GetSmoothLids() const |
82 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS).GetValue(); } |
83 | | |
84 | | // #107245# GetCharacterMode() for bExtrudeCharacterMode |
85 | | bool GetCharacterMode() const |
86 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE).GetValue(); } |
87 | | |
88 | | // #107245# GetCloseFront() for bExtrudeCloseFront |
89 | | bool GetCloseFront() const |
90 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT).GetValue(); } |
91 | | |
92 | | // #107245# GetCloseBack() for bExtrudeCloseBack |
93 | | bool GetCloseBack() const |
94 | 0 | { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK).GetValue(); } |
95 | | |
96 | | virtual SdrObjKind GetObjIdentifier() const override; |
97 | | |
98 | | virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override; |
99 | | |
100 | | // TakeObjName...() is for the display in the UI (for example "3 frames selected") |
101 | | virtual OUString TakeObjNameSingul() const override; |
102 | | virtual OUString TakeObjNamePlural() const override; |
103 | | |
104 | | // set/get local parameters with geometry regeneration |
105 | | void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew); |
106 | 0 | const basegfx::B2DPolyPolygon &GetExtrudePolygon() const { return maExtrudePolygon; } |
107 | | |
108 | | virtual bool IsBreakObjPossible() override; |
109 | | virtual rtl::Reference<SdrAttrObj> GetBreakObj() override; |
110 | | }; |
111 | | |
112 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |