Line data Source code
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 _E3D_SPHERE3D_HXX
21 : #define _E3D_SPHERE3D_HXX
22 :
23 : #include <svx/obj3d.hxx>
24 : #include "svx/svxdllapi.h"
25 :
26 : /*************************************************************************
27 : |*
28 : |* Kugelobjekt mit Durchmesser r3DSize; Anzahl der Flaechen wird durch
29 : |* die horizontale und vertikale Segmentanzahl vorgegeben
30 : |*
31 : \************************************************************************/
32 :
33 0 : class SVX_DLLPUBLIC E3dSphereObj : public E3dCompoundObject
34 : {
35 : private:
36 : basegfx::B3DPoint aCenter;
37 : basegfx::B3DVector aSize;
38 :
39 : protected:
40 : virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
41 : virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
42 : void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
43 :
44 : public:
45 : TYPEINFO();
46 : E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize);
47 :
48 : // FG: This constructor is only called from MakeObject from the 3d-Objectfactory
49 : // when a document with a sphere is loaded. This constructor does not call
50 : // CreateSphere, or create any spheres.
51 : E3dSphereObj(int dummy);
52 :
53 : // horizontal segments:
54 0 : sal_uInt32 GetHorizontalSegments() const
55 0 : { return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
56 :
57 : // VerticalSegments:
58 0 : sal_uInt32 GetVerticalSegments() const
59 0 : { return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
60 :
61 : virtual sal_uInt16 GetObjIdentifier() const;
62 : virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
63 :
64 : virtual E3dSphereObj* Clone() const;
65 :
66 0 : const basegfx::B3DPoint& Center() const { return aCenter; }
67 0 : const basegfx::B3DVector& Size() const { return aSize; }
68 :
69 : // set local parameters when the geometry is recreated
70 : void SetCenter(const basegfx::B3DPoint& rNew);
71 : void SetSize(const basegfx::B3DVector& rNew);
72 :
73 : // TakeObjName...() is for displaying in the UI, eg "3 selected frames."
74 : virtual void TakeObjNameSingul(String& rName) const;
75 : virtual void TakeObjNamePlural(String& rName) const;
76 : };
77 :
78 : #endif // _E3D_SPHERE3D_HXX
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|