1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sphere3d.hxx,v $
10 * $Revision: 1.4.18.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _E3D_SPHERE3D_HXX
32 #define _E3D_SPHERE3D_HXX
34 #include <svx/obj3d.hxx>
35 #include "svx/svxdllapi.h"
37 /*************************************************************************
39 |* Kugelobjekt mit Durchmesser r3DSize; Anzahl der Flaechen wird durch
40 |* die horizontale und vertikale Segmentanzahl vorgegeben
42 \************************************************************************/
44 class SVX_DLLPUBLIC E3dSphereObj
: public E3dCompoundObject
47 // #110094# DrawContact section
48 virtual sdr::contact::ViewContact
* CreateObjectSpecificViewContact();
50 virtual sdr::properties::BaseProperties
* CreateObjectSpecificProperties();
52 basegfx::B3DPoint aCenter
;
53 basegfx::B3DVector aSize
;
56 void SetDefaultAttributes(E3dDefaultAttributes
& rDefault
);
60 E3dSphereObj(E3dDefaultAttributes
& rDefault
, const basegfx::B3DPoint
& rCenter
, const basegfx::B3DVector
& r3DSize
);
63 // FG: Dieser Konstruktor wird nur von MakeObject aus der 3d-Objectfactory beim
64 // Laden von Dokumenten mit Kugeln aufgerufen. Dieser Konstruktor ruft kein
65 // CreateSphere auf, er erzeugt also keine Kugel.
66 E3dSphereObj(int dummy
);
68 // HorizontalSegments:
69 sal_uInt32
GetHorizontalSegments() const
70 { return ((const Svx3DHorizontalSegmentsItem
&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS
)).GetValue(); }
73 sal_uInt32
GetVerticalSegments() const
74 { return ((const Svx3DVerticalSegmentsItem
&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS
)).GetValue(); }
76 virtual UINT16
GetObjIdentifier() const;
77 virtual SdrObject
* DoConvertToPolyObj(BOOL bBezier
) const;
79 virtual void operator=(const SdrObject
&);
81 void ReSegment(sal_uInt32 nHorzSegments
, sal_uInt32 nVertSegments
);
82 const basegfx::B3DPoint
& Center() const { return aCenter
; }
83 const basegfx::B3DVector
& Size() const { return aSize
; }
85 // Lokale Parameter setzen mit Geometrieneuerzeugung
86 void SetCenter(const basegfx::B3DPoint
& rNew
);
87 void SetSize(const basegfx::B3DVector
& rNew
);
89 // TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
90 virtual void TakeObjNameSingul(String
& rName
) const;
91 virtual void TakeObjNamePlural(String
& rName
) const;
94 #endif // _E3D_SPHERE3D_HXX