LibreOffice Module svx (master) 1
sphere3d.hxx
Go to the documentation of this file.
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_SPHERE3D_HXX
21#define INCLUDED_SVX_SPHERE3D_HXX
22
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
29class E3dDefaultAttributes;
30
36{
37private:
40
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);
44
45private:
46 // protected destructor - due to final, make private
47 virtual ~E3dSphereObj() override;
48
49public:
51 SdrModel& rSdrModel,
52 const E3dDefaultAttributes& rDefault,
53 const basegfx::B3DPoint& rCenter,
54 const basegfx::B3DVector& r3DSize);
55
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);
61
62 // horizontal segments:
63 sal_uInt32 GetHorizontalSegments() const
64 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS).GetValue(); }
65
66 // VerticalSegments:
67 sal_uInt32 GetVerticalSegments() const
68 { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue(); }
69
70 virtual SdrObjKind GetObjIdentifier() const override;
71 virtual rtl::Reference<SdrObject> DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
72
73 virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
74
75 const basegfx::B3DPoint& Center() const { return aCenter; }
76 const basegfx::B3DVector& Size() const { return aSize; }
77
78 // set local parameters when the geometry is recreated
79 void SetCenter(const basegfx::B3DPoint& rNew);
80 void SetSize(const basegfx::B3DVector& rNew);
81
82 // TakeObjName...() is for displaying in the UI, eg "3 selected frames."
83 virtual OUString TakeObjNameSingul() const override;
84 virtual OUString TakeObjNamePlural() const override;
85};
86
87#endif // INCLUDED_SVX_SPHERE3D_HXX
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SdrObjKind GetObjIdentifier() const override
Definition: obj3d.cxx:545
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: obj3d.cxx:596
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: obj3d.cxx:449
virtual OUString TakeObjNamePlural() const override
Definition: obj3d.cxx:395
virtual OUString TakeObjNameSingul() const override
Definition: obj3d.cxx:382
SphereObject with diameter r3DSize.
Definition: sphere3d.hxx:36
const basegfx::B3DPoint & Center() const
Definition: sphere3d.hxx:75
const basegfx::B3DVector & Size() const
Definition: sphere3d.hxx:76
sal_uInt32 GetHorizontalSegments() const
Definition: sphere3d.hxx:63
basegfx::B3DPoint aCenter
Definition: sphere3d.hxx:38
sal_uInt32 GetVerticalSegments() const
Definition: sphere3d.hxx:67
basegfx::B3DVector aSize
Definition: sphere3d.hxx:39
virtual rtl::Reference< SdrObject > DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2639
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:256
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1969
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_VERT_SEGS(SDRATTR_3DOBJ_FIRST+4)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_HORZ_SEGS(SDRATTR_3DOBJ_FIRST+3)
SdrObjKind
Definition: svdobjkind.hxx:25
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35