xref: /aoo41x/main/svx/inc/svx/extrud3d.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _E3D_EXTRUD3D_HXX
25cdf0e10cSrcweir #define _E3D_EXTRUD3D_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/obj3d.hxx>
28cdf0e10cSrcweir #include "svx/svxdllapi.h"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /*************************************************************************
31cdf0e10cSrcweir |*
32cdf0e10cSrcweir |* 3D-Extrusionsobjekt aus uebergebenem 2D-Polygon erzeugen
33cdf0e10cSrcweir |*
34cdf0e10cSrcweir \************************************************************************/
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject
37cdf0e10cSrcweir {
38cdf0e10cSrcweir private:
39cdf0e10cSrcweir 	// to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid()
40cdf0e10cSrcweir 	friend class sdr::properties::E3dExtrudeProperties;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 	// Geometrie, die dieses Objekt bestimmt
43cdf0e10cSrcweir 	basegfx::B2DPolyPolygon			maExtrudePolygon;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir protected:
46cdf0e10cSrcweir 	virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
47cdf0e10cSrcweir 	virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
48cdf0e10cSrcweir 	void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
49cdf0e10cSrcweir 
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir 	TYPEINFO();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth);
54cdf0e10cSrcweir 	E3dExtrudeObj();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	// PercentDiagonal: 0..100, before 0.0..0.5
GetPercentDiagonal() const57cdf0e10cSrcweir 	sal_uInt16 GetPercentDiagonal() const
58cdf0e10cSrcweir 		{ return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	// BackScale: 0..100, before 0.0..1.0
GetPercentBackScale() const61cdf0e10cSrcweir 	sal_uInt16 GetPercentBackScale() const
62cdf0e10cSrcweir 		{ return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	// BackScale: 0..100, before 0.0..1.0
GetExtrudeDepth() const65cdf0e10cSrcweir 	sal_uInt32 GetExtrudeDepth() const
66cdf0e10cSrcweir 		{ return ((const Svx3DDepthItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	// #107245# GetSmoothNormals() for bExtrudeSmoothed
GetSmoothNormals() const69cdf0e10cSrcweir 	sal_Bool GetSmoothNormals() const
70cdf0e10cSrcweir 		{ return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	// #107245# GetSmoothLids() for bExtrudeSmoothFrontBack
GetSmoothLids() const73cdf0e10cSrcweir 	sal_Bool GetSmoothLids() const
74cdf0e10cSrcweir 		{ return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	// #107245# GetCharacterMode() for bExtrudeCharacterMode
GetCharacterMode() const77cdf0e10cSrcweir 	sal_Bool GetCharacterMode() const
78cdf0e10cSrcweir 		{ return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); }
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	// #107245# GetCloseFront() for bExtrudeCloseFront
GetCloseFront() const81cdf0e10cSrcweir 	sal_Bool GetCloseFront() const
82cdf0e10cSrcweir 		{ return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); }
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	// #107245# GetCloseBack() for bExtrudeCloseBack
GetCloseBack() const85cdf0e10cSrcweir 	sal_Bool GetCloseBack() const
86cdf0e10cSrcweir 		{ return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	virtual sal_uInt16 GetObjIdentifier() const;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	virtual void operator=(const SdrObject&);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
93cdf0e10cSrcweir 	virtual void TakeObjNameSingul(String& rName) const;
94cdf0e10cSrcweir 	virtual void TakeObjNamePlural(String& rName) const;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	// Lokale Parameter setzen/lesen mit Geometrieneuerzeugung
97cdf0e10cSrcweir 	void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew);
GetExtrudePolygon()98cdf0e10cSrcweir 	const basegfx::B2DPolyPolygon &GetExtrudePolygon() { return maExtrudePolygon; }
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	// Aufbrechen
101cdf0e10cSrcweir 	virtual sal_Bool IsBreakObjPossible();
102cdf0e10cSrcweir 	virtual SdrAttrObj* GetBreakObj();
103cdf0e10cSrcweir };
104cdf0e10cSrcweir 
105cdf0e10cSrcweir #endif			// _E3D_EXTRUD3D_HXX
106cdf0e10cSrcweir 
107