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_EXTRUD3D_HXX 25 #define _E3D_EXTRUD3D_HXX 26 27 #include <svx/obj3d.hxx> 28 #include "svx/svxdllapi.h" 29 30 /************************************************************************* 31 |* 32 |* 3D-Extrusionsobjekt aus uebergebenem 2D-Polygon erzeugen 33 |* 34 \************************************************************************/ 35 36 class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject 37 { 38 private: 39 // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid() 40 friend class sdr::properties::E3dExtrudeProperties; 41 42 // Geometrie, die dieses Objekt bestimmt 43 basegfx::B2DPolyPolygon maExtrudePolygon; 44 45 protected: 46 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 47 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 48 void SetDefaultAttributes(E3dDefaultAttributes& rDefault); 49 50 public: 51 TYPEINFO(); 52 53 E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth); 54 E3dExtrudeObj(); 55 56 // PercentDiagonal: 0..100, before 0.0..0.5 GetPercentDiagonal() const57 sal_uInt16 GetPercentDiagonal() const 58 { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); } 59 60 // BackScale: 0..100, before 0.0..1.0 GetPercentBackScale() const61 sal_uInt16 GetPercentBackScale() const 62 { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); } 63 64 // BackScale: 0..100, before 0.0..1.0 GetExtrudeDepth() const65 sal_uInt32 GetExtrudeDepth() const 66 { return ((const Svx3DDepthItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); } 67 68 // #107245# GetSmoothNormals() for bExtrudeSmoothed GetSmoothNormals() const69 sal_Bool GetSmoothNormals() const 70 { return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); } 71 72 // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack GetSmoothLids() const73 sal_Bool GetSmoothLids() const 74 { return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); } 75 76 // #107245# GetCharacterMode() for bExtrudeCharacterMode GetCharacterMode() const77 sal_Bool GetCharacterMode() const 78 { return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); } 79 80 // #107245# GetCloseFront() for bExtrudeCloseFront GetCloseFront() const81 sal_Bool GetCloseFront() const 82 { return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); } 83 84 // #107245# GetCloseBack() for bExtrudeCloseBack GetCloseBack() const85 sal_Bool GetCloseBack() const 86 { return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); } 87 88 virtual sal_uInt16 GetObjIdentifier() const; 89 90 virtual void operator=(const SdrObject&); 91 92 // TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert". 93 virtual void TakeObjNameSingul(String& rName) const; 94 virtual void TakeObjNamePlural(String& rName) const; 95 96 // Lokale Parameter setzen/lesen mit Geometrieneuerzeugung 97 void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew); GetExtrudePolygon()98 const basegfx::B2DPolyPolygon &GetExtrudePolygon() { return maExtrudePolygon; } 99 100 // Aufbrechen 101 virtual sal_Bool IsBreakObjPossible(); 102 virtual SdrAttrObj* GetBreakObj(); 103 }; 104 105 #endif // _E3D_EXTRUD3D_HXX 106 107