LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/include/svx - extrud3d.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 18 18 100.0 %
Date: 2013-07-09 Functions: 11 12 91.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef _E3D_EXTRUD3D_HXX
      21             : #define _E3D_EXTRUD3D_HXX
      22             : 
      23             : #include <svx/obj3d.hxx>
      24             : #include "svx/svxdllapi.h"
      25             : 
      26             : /*************************************************************************
      27             : |*
      28             : |* 3D extrusion object created from the provided 2D polygon
      29             : |*
      30             : \************************************************************************/
      31             : 
      32        1684 : class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject
      33             : {
      34             : private:
      35             :     // to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid()
      36             :     friend class sdr::properties::E3dExtrudeProperties;
      37             : 
      38             :     // geometry, which determines the object
      39             :     basegfx::B2DPolyPolygon         maExtrudePolygon;
      40             : 
      41             : protected:
      42             :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
      43             :     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
      44             :     void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
      45             : 
      46             : public:
      47             :     TYPEINFO();
      48             : 
      49             :     E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth);
      50             :     E3dExtrudeObj();
      51             : 
      52             :     // PercentDiagonal: 0..100, before 0.0..0.5
      53        1858 :     sal_uInt16 GetPercentDiagonal() const
      54        1858 :         { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
      55             : 
      56             :     // BackScale: 0..100, before 0.0..1.0
      57        1858 :     sal_uInt16 GetPercentBackScale() const
      58        1858 :         { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
      59             : 
      60             :     // BackScale: 0..100, before 0.0..1.0
      61        1858 :     sal_uInt32 GetExtrudeDepth() const
      62        1858 :         { return ((const Svx3DDepthItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); }
      63             : 
      64             :     // #107245# GetSmoothNormals() for bExtrudeSmoothed
      65        1858 :     sal_Bool GetSmoothNormals() const
      66        1858 :         { return ((const Svx3DSmoothNormalsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS)).GetValue(); }
      67             : 
      68             :     // #107245# GetSmoothLids() for bExtrudeSmoothFrontBack
      69        1858 :     sal_Bool GetSmoothLids() const
      70        1858 :         { return ((const Svx3DSmoothLidsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS)).GetValue(); }
      71             : 
      72             :     // #107245# GetCharacterMode() for bExtrudeCharacterMode
      73        1858 :     sal_Bool GetCharacterMode() const
      74        1858 :         { return ((const Svx3DCharacterModeItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE)).GetValue(); }
      75             : 
      76             :     // #107245# GetCloseFront() for bExtrudeCloseFront
      77        1858 :     sal_Bool GetCloseFront() const
      78        1858 :         { return ((const Svx3DCloseFrontItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT)).GetValue(); }
      79             : 
      80             :     // #107245# GetCloseBack() for bExtrudeCloseBack
      81        1858 :     sal_Bool GetCloseBack() const
      82        1858 :         { return ((const Svx3DCloseBackItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK)).GetValue(); }
      83             : 
      84             :     virtual sal_uInt16 GetObjIdentifier() const;
      85             : 
      86             :     virtual E3dExtrudeObj* Clone() const;
      87             : 
      88             :     // TakeObjName...() is for the display in the UI (for example "3 frames selected")
      89             :     virtual void TakeObjNameSingul(String& rName) const;
      90             :     virtual void TakeObjNamePlural(String& rName) const;
      91             : 
      92             :     // set/get local parameters with geometry regeneration
      93             :     void SetExtrudePolygon(const basegfx::B2DPolyPolygon &rNew);
      94        1858 :     const basegfx::B2DPolyPolygon &GetExtrudePolygon() { return maExtrudePolygon; }
      95             : 
      96             :     virtual bool IsBreakObjPossible();
      97             :     virtual SdrAttrObj* GetBreakObj();
      98             : };
      99             : 
     100             : #endif          // _E3D_EXTRUD3D_HXX
     101             : 
     102             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10