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 
30 
36 {
37 private:
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 
45 private:
46  // protected destructor - due to final, make private
47  virtual ~E3dSphereObj() override;
48 
49 public:
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 
61  // horizontal segments:
62  sal_uInt32 GetHorizontalSegments() const
63  { return GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS).GetValue(); }
64 
65  // VerticalSegments:
66  sal_uInt32 GetVerticalSegments() const
67  { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue(); }
68 
69  virtual sal_uInt16 GetObjIdentifier() const override;
70  virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
71 
72  virtual E3dSphereObj* CloneSdrObject(SdrModel& rTargetModel) const override;
73 
74  // implemented mainly for the purposes of Clone()
75  E3dSphereObj& operator=(const E3dSphereObj& rObj);
76 
77  const basegfx::B3DPoint& Center() const { return aCenter; }
78  const basegfx::B3DVector& Size() const { return aSize; }
79 
80  // set local parameters when the geometry is recreated
81  void SetCenter(const basegfx::B3DPoint& rNew);
82  void SetSize(const basegfx::B3DVector& rNew);
83 
84  // TakeObjName...() is for displaying in the UI, eg "3 selected frames."
85  virtual OUString TakeObjNameSingul() const override;
86  virtual OUString TakeObjNamePlural() const override;
87 };
88 
89 #endif // INCLUDED_SVX_SPHERE3D_HXX
90 
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString TakeObjNameSingul() const override
Definition: obj3d.cxx:395
virtual sal_uInt16 GetObjIdentifier() const override
Definition: obj3d.cxx:578
#define SDRATTR_3DOBJ_VERT_SEGS
Definition: svddef.hxx:327
virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const
Definition: svdobj.cxx:2552
const basegfx::B3DPoint & Center() const
Definition: sphere3d.hxx:77
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1906
SphereObject with diameter r3DSize.
Definition: sphere3d.hxx:35
basegfx::B3DPoint aCenter
Definition: sphere3d.hxx:38
#define SDRATTR_3DOBJ_HORZ_SEGS
Definition: svddef.hxx:326
E3dCompoundObject & operator=(const E3dCompoundObject &rObj)
Definition: obj3d.cxx:631
sal_uInt32 GetVerticalSegments() const
Definition: sphere3d.hxx:66
const basegfx::B3DVector & Size() const
Definition: sphere3d.hxx:78
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact()
Definition: svdobj.cxx:266
basegfx::B3DVector aSize
Definition: sphere3d.hxx:39
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: obj3d.cxx:487
sal_uInt32 GetHorizontalSegments() const
Definition: sphere3d.hxx:62
virtual E3dCompoundObject * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: obj3d.cxx:626
virtual OUString TakeObjNamePlural() const override
Definition: obj3d.cxx:411