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: extrud3d.hxx,v $
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_EXTRUD3D_HXX
32 #define _E3D_EXTRUD3D_HXX
34 #ifndef _E3D_OBJ3D_HXX
35 #include <bf_svx/obj3d.hxx>
39 #include <bf_svx/poly3d.hxx>
43 /*************************************************************************
45 |* 3D-Extrusionsobjekt aus uebergebenem 2D-Polygon erzeugen
47 \************************************************************************/
49 class E3dExtrudeObj
: public E3dCompoundObject
52 // Geometrie, die dieses Objekt bestimmt
53 PolyPolygon3D aExtrudePolygon
;
57 PolyPolygon3D maLinePolyPolygon
;
59 // #107245# unsigned bExtrudeSmoothed : 1;
60 // #107245# unsigned bExtrudeSmoothFrontBack : 1;
61 // #107245# unsigned bExtrudeCharacterMode : 1;
62 // #107245# unsigned bExtrudeCloseFront : 1;
63 // #107245# unsigned bExtrudeCloseBack : 1;
66 void SetDefaultAttributes(E3dDefaultAttributes
& rDefault
);
67 PolyPolygon3D
GetFrontSide();
68 PolyPolygon3D
GetBackSide(const PolyPolygon3D
& rFrontSide
);
73 E3dExtrudeObj(E3dDefaultAttributes
& rDefault
, const PolyPolygon
& rPP
, double fDepth
);
74 // es wird keine Bezier-Konvertierung des XPolygon durchgefuehrt,
75 // sondern es werden nur die Punkte uebernommen!
76 E3dExtrudeObj(E3dDefaultAttributes
& rDefault
, const XPolyPolygon
& rXPP
, double fDepth
);
79 // PercentDiagonal: 0..100, before 0.0..0.5
80 sal_uInt16
GetPercentDiagonal() const
81 { return ((const Svx3DPercentDiagonalItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL
)).GetValue(); }
83 // BackScale: 0..100, before 0.0..1.0
84 sal_uInt16
GetPercentBackScale() const
85 { return ((const Svx3DBackscaleItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_BACKSCALE
)).GetValue(); }
87 // BackScale: 0..100, before 0.0..1.0
88 sal_uInt32
GetExtrudeDepth() const
89 { return ((const Svx3DDepthItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_DEPTH
)).GetValue(); }
91 // #107245# GetSmoothNormals() for bExtrudeSmoothed
92 sal_Bool
GetSmoothNormals() const
93 { return ((const Svx3DSmoothNormalsItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS
)).GetValue(); }
95 // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack
96 sal_Bool
GetSmoothLids() const
97 { return ((const Svx3DSmoothLidsItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS
)).GetValue(); }
99 // #107245# GetCharacterMode() for bExtrudeCharacterMode
100 sal_Bool
GetCharacterMode() const
101 { return ((const Svx3DCharacterModeItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE
)).GetValue(); }
103 // #107245# GetCloseFront() for bExtrudeCloseFront
104 sal_Bool
GetCloseFront() const
105 { return ((const Svx3DCloseFrontItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT
)).GetValue(); }
107 // #107245# GetCloseBack() for bExtrudeCloseBack
108 sal_Bool
GetCloseBack() const
109 { return ((const Svx3DCloseBackItem
&)GetUnmergedItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK
)).GetValue(); }
111 virtual UINT16
GetObjIdentifier() const;
113 virtual void CreateWireframe(Polygon3D
& rWirePoly
, const Matrix4D
* pTf
= NULL
,
114 E3dDragDetail eDetail
= E3DDETAIL_DEFAULT
);
116 virtual void WriteData(SvStream
& rOut
) const;
117 virtual void ReadData(const SdrObjIOHeader
& rHead
, SvStream
& rIn
);
119 // TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
121 // Geometrieerzeugung
122 virtual void CreateGeometry();
124 // Give out simple line geometry
126 // Lokale Parameter setzen/lesen mit Geometrieneuerzeugung
127 void SetExtrudePolygon(const PolyPolygon3D
&rNew
);
128 const PolyPolygon3D
&GetExtrudePolygon() { return aExtrudePolygon
; }
132 // void SetExtrudeSmoothed(BOOL bNew);
133 // BOOL GetExtrudeSmoothed() const { return bExtrudeSmoothed; }
134 // void SetExtrudeSmoothFrontBack(BOOL bNew);
135 // BOOL GetExtrudeSmoothFrontBack() const { return bExtrudeSmoothFrontBack; }
136 // void SetExtrudeCharacterMode(BOOL bNew);
137 // BOOL GetExtrudeCharacterMode() const { return bExtrudeCharacterMode; }
138 // void SetExtrudeCloseFront(BOOL bNew);
139 // BOOL GetExtrudeCloseFront() const { return bExtrudeCloseFront; }
140 // void SetExtrudeCloseBack(BOOL bNew);
141 // BOOL GetExtrudeCloseBack() const { return bExtrudeCloseBack; }
143 // private support routines for ItemSet access. NULL pointer means clear item.
144 virtual void PostItemChange(const sal_uInt16 nWhich
);
149 }//end of namespace binfilter
150 #endif // _E3D_EXTRUD3D_HXX