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_SPHERE3D_HXX
21 #define INCLUDED_SVX_SPHERE3D_HXX
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>
29 class E3dDefaultAttributes
;
32 * SphereObject with diameter r3DSize.
33 * The count of planes depends on the horizontal and vertical segment count.
35 class SVXCORE_DLLPUBLIC E3dSphereObj final
: public E3dCompoundObject
38 basegfx::B3DPoint aCenter
;
39 basegfx::B3DVector aSize
;
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 ~E3dSphereObj() override
;
52 const E3dDefaultAttributes
& rDefault
,
53 const basegfx::B3DPoint
& rCenter
,
54 const basegfx::B3DVector
& r3DSize
);
56 // FG: This constructor is only called from MakeObject from the 3d-Objectfactory
57 // when a document with a sphere is loaded. This constructor does not call
58 // CreateSphere, or create any spheres.
59 E3dSphereObj(SdrModel
& rSdrModel
);
60 E3dSphereObj(SdrModel
& rSdrModel
, E3dSphereObj
const & rSource
);
62 // horizontal segments:
63 sal_uInt32
GetHorizontalSegments() const
64 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS
).GetValue(); }
67 sal_uInt32
GetVerticalSegments() const
68 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS
).GetValue(); }
70 virtual SdrObjKind
GetObjIdentifier() const override
;
71 virtual rtl::Reference
<SdrObject
> DoConvertToPolyObj(bool bBezier
, bool bAddText
) const override
;
73 virtual rtl::Reference
<SdrObject
> CloneSdrObject(SdrModel
& rTargetModel
) const override
;
75 const basegfx::B3DPoint
& Center() const { return aCenter
; }
76 const basegfx::B3DVector
& Size() const { return aSize
; }
78 // set local parameters when the geometry is recreated
79 void SetCenter(const basegfx::B3DPoint
& rNew
);
80 void SetSize(const basegfx::B3DVector
& rNew
);
82 // TakeObjName...() is for displaying in the UI, eg "3 selected frames."
83 virtual OUString
TakeObjNameSingul() const override
;
84 virtual OUString
TakeObjNamePlural() const override
;
87 #endif // INCLUDED_SVX_SPHERE3D_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */