xref: /aoo4110/main/svx/inc/svx/lathe3d.hxx (revision b1cdbd2c)
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_LATHE3D_HXX
25 #define _E3D_LATHE3D_HXX
26 
27 #include <svx/obj3d.hxx>
28 #include "svx/svxdllapi.h"
29 
30 /*************************************************************************
31 |*
32 |* 3D-Rotationsobjekt aus uebergebenem 2D-Polygon erzeugen
33 |*
34 |* Das aPolyPoly3D wird in nHSegments-Schritten um die Achse rotiert.
35 |* nVSegments gibt die Anzahl der Linien von aPolyPoly3D an und stellt damit
36 |* quasi eine vertikale Segmentierung dar.
37 |*
38 \************************************************************************/
39 
40 class SVX_DLLPUBLIC E3dLatheObj : public E3dCompoundObject
41 {
42 private:
43 	// Partcodes fuer Wireframe-Generierung: Standard oder Deckelflaeche
44 	enum { LATHE_PART_STD = 1, LATHE_PART_COVER = 2 };
45 	basegfx::B2DPolyPolygon	maPolyPoly2D;
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 	E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon rPoly2D);
55 	E3dLatheObj();
56 
57 	// HorizontalSegments:
GetHorizontalSegments() const58 	sal_uInt32 GetHorizontalSegments() const
59 		{ return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
60 
61 	// VerticalSegments:
GetVerticalSegments() const62 	sal_uInt32 GetVerticalSegments() const
63 		{ return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
64 
65 	// PercentDiagonal: 0..100, before 0.0..0.5
GetPercentDiagonal() const66 	sal_uInt16 GetPercentDiagonal() const
67 		{ return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
68 
69 	// BackScale: 0..100, before 0.0..1.0
GetBackScale() const70 	sal_uInt16 GetBackScale() const
71 		{ return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
72 
73 	// EndAngle: 0..10000
GetEndAngle() const74 	sal_uInt32 GetEndAngle() const
75 		{ return ((const Svx3DEndAngleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue(); }
76 
77 	// #107245# GetSmoothNormals() for bLatheSmoothed
GetSmoothNormals() const78 	sal_Bool GetSmoothNormals() const
79 		{ return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); }
80 
81 	// #107245# GetSmoothLids() for bLatheSmoothFrontBack
GetSmoothLids() const82 	sal_Bool GetSmoothLids() const
83 		{ return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); }
84 
85 	// #107245# GetCharacterMode() for bLatheCharacterMode
GetCharacterMode() const86 	sal_Bool GetCharacterMode() const
87 		{ return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); }
88 
89 	// #107245# GetCloseFront() for bLatheCloseFront
GetCloseFront() const90 	sal_Bool GetCloseFront() const
91 		{ return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); }
92 
93 	// #107245# GetCloseBack() for bLatheCloseBack
GetCloseBack() const94 	sal_Bool GetCloseBack() const
95 		{ return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); }
96 
97 	virtual sal_uInt16 GetObjIdentifier() const;
98 	void    ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs);
99 
100 	virtual void operator=(const SdrObject&);
101 
102 	virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
103 
104 	// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
105 	virtual void TakeObjNameSingul(String& rName) const;
106 	virtual void TakeObjNamePlural(String& rName) const;
107 
108 	// Lokale Parameter setzen/lesen mit Geometrieneuerzeugung
109 	void SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew);
GetPolyPoly2D()110 	const basegfx::B2DPolyPolygon& GetPolyPoly2D() { return maPolyPoly2D; }
111 
112 	// Aufbrechen
113 	virtual sal_Bool IsBreakObjPossible();
114 	virtual SdrAttrObj* GetBreakObj();
115 };
116 
117 #endif			// _E3D_LATHE3D_HXX
118 
119