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