xref: /trunk/main/svx/inc/svx/sphere3d.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _E3D_SPHERE3D_HXX
25 #define _E3D_SPHERE3D_HXX
26 
27 #include <svx/obj3d.hxx>
28 #include "svx/svxdllapi.h"
29 
30 /*************************************************************************
31 |*
32 |* Kugelobjekt mit Durchmesser r3DSize; Anzahl der Flaechen wird durch
33 |* die horizontale und vertikale Segmentanzahl vorgegeben
34 |*
35 \************************************************************************/
36 
37 class SVX_DLLPUBLIC E3dSphereObj : public E3dCompoundObject
38 {
39 private:
40 	basegfx::B3DPoint				aCenter;
41 	basegfx::B3DVector				aSize;
42 
43 protected:
44 	virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
45 	virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
46 	void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
47 
48 public:
49 	TYPEINFO();
50 	E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize);
51 	E3dSphereObj();
52 
53 	// FG: Dieser Konstruktor wird nur von MakeObject aus der 3d-Objectfactory beim
54 	//     Laden von Dokumenten mit Kugeln aufgerufen. Dieser Konstruktor ruft kein
55 	//     CreateSphere auf, er erzeugt also keine Kugel.
56 	E3dSphereObj(int dummy);
57 
58 	// HorizontalSegments:
GetHorizontalSegments() const59 	sal_uInt32 GetHorizontalSegments() const
60 		{ return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
61 
62 	// VerticalSegments:
GetVerticalSegments() const63 	sal_uInt32 GetVerticalSegments() const
64 		{ return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
65 
66 	virtual sal_uInt16 GetObjIdentifier() const;
67 	virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
68 
69 	virtual void operator=(const SdrObject&);
70 
71 	void ReSegment(sal_uInt32 nHorzSegments, sal_uInt32 nVertSegments);
Center() const72 	const basegfx::B3DPoint& Center() const { return aCenter; }
Size() const73 	const basegfx::B3DVector& Size() const { return aSize; }
74 
75 	// Lokale Parameter setzen mit Geometrieneuerzeugung
76 	void SetCenter(const basegfx::B3DPoint& rNew);
77 	void SetSize(const basegfx::B3DVector& rNew);
78 
79 	// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
80 	virtual void TakeObjNameSingul(String& rName) const;
81 	virtual void TakeObjNamePlural(String& rName) const;
82 };
83 
84 #endif			// _E3D_SPHERE3D_HXX
85