LCOV - code coverage report
Current view: top level - svx/inc/svx - extrud3d.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 18 18 100.0 %
Date: 2012-08-25 Functions: 11 12 91.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _E3D_EXTRUD3D_HXX
      30                 :            : #define _E3D_EXTRUD3D_HXX
      31                 :            : 
      32                 :            : #include <svx/obj3d.hxx>
      33                 :            : #include "svx/svxdllapi.h"
      34                 :            : 
      35                 :            : /*************************************************************************
      36                 :            : |*
      37                 :            : |* 3D extrusion object created from the provided 2D polygon
      38                 :            : |*
      39                 :            : \************************************************************************/
      40                 :            : 
      41 [ +  - ][ -  + ]:       3002 : class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject
      42                 :            : {
      43                 :            : private:
      44                 :            :     // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid()
      45                 :            :     friend class sdr::properties::E3dExtrudeProperties;
      46                 :            : 
      47                 :            :     // geometry, which determines the object
      48                 :            :     basegfx::B2DPolyPolygon         maExtrudePolygon;
      49                 :            : 
      50                 :            : protected:
      51                 :            :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
      52                 :            :     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
      53                 :            :     void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
      54                 :            : 
      55                 :            : public:
      56                 :            :     TYPEINFO();
      57                 :            : 
      58                 :            :     E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth);
      59                 :            :     E3dExtrudeObj();
      60                 :            : 
      61                 :            :     // PercentDiagonal: 0..100, before 0.0..0.5
      62                 :       3257 :     sal_uInt16 GetPercentDiagonal() const
      63                 :       3257 :         { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
      64                 :            : 
      65                 :            :     // BackScale: 0..100, before 0.0..1.0
      66                 :       3257 :     sal_uInt16 GetPercentBackScale() const
      67                 :       3257 :         { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
      68                 :            : 
      69                 :            :     // BackScale: 0..100, before 0.0..1.0
      70                 :       3257 :     sal_uInt32 GetExtrudeDepth() const
      71                 :       3257 :         { return ((const Svx3DDepthItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); }
      72                 :            : 
      73                 :            :     // #107245# GetSmoothNormals() for bExtrudeSmoothed
      74                 :       3257 :     sal_Bool GetSmoothNormals() const
      75                 :       3257 :         { return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); }
      76                 :            : 
      77                 :            :     // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack
      78                 :       3257 :     sal_Bool GetSmoothLids() const
      79                 :       3257 :         { return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); }
      80                 :            : 
      81                 :            :     // #107245# GetCharacterMode() for bExtrudeCharacterMode
      82                 :       3257 :     sal_Bool GetCharacterMode() const
      83                 :       3257 :         { return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); }
      84                 :            : 
      85                 :            :     // #107245# GetCloseFront() for bExtrudeCloseFront
      86                 :       3257 :     sal_Bool GetCloseFront() const
      87                 :       3257 :         { return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); }
      88                 :            : 
      89                 :            :     // #107245# GetCloseBack() for bExtrudeCloseBack
      90                 :       3257 :     sal_Bool GetCloseBack() const
      91                 :       3257 :         { return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); }
      92                 :            : 
      93                 :            :     virtual sal_uInt16 GetObjIdentifier() const;
      94                 :            : 
      95                 :            :     virtual E3dExtrudeObj* Clone() const;
      96                 :            : 
      97                 :            :     // TakeObjName...() is for the display in the UI (for example "3 frames selected")
      98                 :            :     virtual void TakeObjNameSingul(String& rName) const;
      99                 :            :     virtual void TakeObjNamePlural(String& rName) const;
     100                 :            : 
     101                 :            :     // set/get local parameters with geometry regeneration
     102                 :            :     void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew);
     103                 :       3257 :     const basegfx::B2DPolyPolygon &GetExtrudePolygon() { return maExtrudePolygon; }
     104                 :            : 
     105                 :            :     virtual sal_Bool IsBreakObjPossible();
     106                 :            :     virtual SdrAttrObj* GetBreakObj();
     107                 :            : };
     108                 :            : 
     109                 :            : #endif          // _E3D_EXTRUD3D_HXX
     110                 :            : 
     111                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10