1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_EXTRUD3D_HXX
21 #define INCLUDED_SVX_EXTRUD3D_HXX
23 #include <svx/obj3d.hxx>
24 #include <svx/svxdllapi.h>
26 /*************************************************************************
28 |* 3D extrusion object created from the provided 2D polygon
30 \************************************************************************/
32 class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dExtrudeObj final
: public E3dCompoundObject
35 // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid()
36 friend class sdr::properties::E3dExtrudeProperties
;
38 // geometry, which determines the object
39 basegfx::B2DPolyPolygon maExtrudePolygon
;
41 virtual std::unique_ptr
<sdr::contact::ViewContact
> CreateObjectSpecificViewContact() override
;
42 virtual std::unique_ptr
<sdr::properties::BaseProperties
> CreateObjectSpecificProperties() override
;
43 void SetDefaultAttributes(const E3dDefaultAttributes
& rDefault
);
46 // protected destructor - due to final, make private
47 virtual ~E3dExtrudeObj() override
;
52 const E3dDefaultAttributes
& rDefault
,
53 const basegfx::B2DPolyPolygon
& rPP
,
55 E3dExtrudeObj(SdrModel
& rSdrModel
);
57 // PercentDiagonal: 0..100, before 0.0..0.5
58 sal_uInt16
GetPercentDiagonal() const
59 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL
).GetValue(); }
61 // BackScale: 0..100, before 0.0..1.0
62 sal_uInt16
GetPercentBackScale() const
63 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE
).GetValue(); }
65 // BackScale: 0..100, before 0.0..1.0
66 sal_uInt32
GetExtrudeDepth() const
67 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH
).GetValue(); }
69 // #107245# GetSmoothNormals() for bExtrudeSmoothed
70 bool GetSmoothNormals() const
71 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS
).GetValue(); }
73 // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack
74 bool GetSmoothLids() const
75 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS
).GetValue(); }
77 // #107245# GetCharacterMode() for bExtrudeCharacterMode
78 bool GetCharacterMode() const
79 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE
).GetValue(); }
81 // #107245# GetCloseFront() for bExtrudeCloseFront
82 bool GetCloseFront() const
83 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT
).GetValue(); }
85 // #107245# GetCloseBack() for bExtrudeCloseBack
86 bool GetCloseBack() const
87 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK
).GetValue(); }
89 virtual sal_uInt16
GetObjIdentifier() const override
;
91 virtual E3dExtrudeObj
* CloneSdrObject(SdrModel
& rTargetModel
) const override
;
93 // implemented mainly for the purposes of Clone()
94 E3dExtrudeObj
& operator=(const E3dExtrudeObj
& rObj
);
96 // TakeObjName...() is for the display in the UI (for example "3 frames selected")
97 virtual OUString
TakeObjNameSingul() const override
;
98 virtual OUString
TakeObjNamePlural() const override
;
100 // set/get local parameters with geometry regeneration
101 void SetExtrudePolygon(const basegfx::B2DPolyPolygon
&rNew
);
102 const basegfx::B2DPolyPolygon
&GetExtrudePolygon() const { return maExtrudePolygon
; }
104 virtual bool IsBreakObjPossible() override
;
105 virtual std::unique_ptr
<SdrAttrObj
,SdrObjectFreeOp
> GetBreakObj() override
;
108 #endif // INCLUDED_SVX_EXTRUD3D_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */