LCOV - code coverage report
Current view: top level - libreoffice/svx/source/engine3d - cube3d.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 54 0.0 %
Date: 2012-12-27 Functions: 0 17 0.0 %
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             : 
      21             : #include "svx/svdstr.hrc"
      22             : #include "svx/svdglob.hxx"
      23             : #include <svx/cube3d.hxx>
      24             : #include "svx/globl3d.hxx"
      25             : #include <basegfx/point/b3dpoint.hxx>
      26             : #include <basegfx/polygon/b3dpolygon.hxx>
      27             : #include <svx/sdr/contact/viewcontactofe3dcube.hxx>
      28             : 
      29             : //////////////////////////////////////////////////////////////////////////////
      30             : // DrawContact section
      31             : 
      32           0 : sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact()
      33             : {
      34           0 :     return new sdr::contact::ViewContactOfE3dCube(*this);
      35             : }
      36             : 
      37           0 : TYPEINIT1(E3dCubeObj, E3dCompoundObject);
      38             : 
      39           0 : E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize)
      40           0 : :   E3dCompoundObject(rDefault)
      41             : {
      42             :     // Set Defaults
      43           0 :     SetDefaultAttributes(rDefault);
      44             : 
      45           0 :     aCubePos = aPos; // position centre or left, bottom, back (dependant on bPosIsCenter)
      46           0 :     aCubeSize = r3DSize;
      47           0 : }
      48             : 
      49           0 : E3dCubeObj::E3dCubeObj()
      50           0 : :   E3dCompoundObject()
      51             : {
      52             :     // Set Defaults
      53           0 :     E3dDefaultAttributes aDefault;
      54           0 :     SetDefaultAttributes(aDefault);
      55           0 : }
      56             : 
      57           0 : void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
      58             : {
      59           0 :     aCubePos = rDefault.GetDefaultCubePos();
      60           0 :     aCubeSize = rDefault.GetDefaultCubeSize();
      61           0 :     nSideFlags = rDefault.GetDefaultCubeSideFlags();
      62           0 :     bPosIsCenter = rDefault.GetDefaultCubePosIsCenter();
      63           0 : }
      64             : 
      65           0 : sal_uInt16 E3dCubeObj::GetObjIdentifier() const
      66             : {
      67           0 :     return E3D_CUBEOBJ_ID;
      68             : }
      69             : 
      70             : // Convert the object into a group object consisting of 6 polygons
      71             : 
      72           0 : SdrObject *E3dCubeObj::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const
      73             : {
      74           0 :     return NULL;
      75             : }
      76             : 
      77           0 : E3dCubeObj* E3dCubeObj::Clone() const
      78             : {
      79           0 :     return CloneHelper< E3dCubeObj >();
      80             : }
      81             : 
      82             : // Set local parameters with geometry re-creating
      83             : 
      84           0 : void E3dCubeObj::SetCubePos(const basegfx::B3DPoint& rNew)
      85             : {
      86           0 :     if(aCubePos != rNew)
      87             :     {
      88           0 :         aCubePos = rNew;
      89           0 :         ActionChanged();
      90             :     }
      91           0 : }
      92             : 
      93           0 : void E3dCubeObj::SetCubeSize(const basegfx::B3DVector& rNew)
      94             : {
      95           0 :     if(aCubeSize != rNew)
      96             :     {
      97           0 :         aCubeSize = rNew;
      98           0 :         ActionChanged();
      99             :     }
     100           0 : }
     101             : 
     102           0 : void E3dCubeObj::SetPosIsCenter(sal_Bool bNew)
     103             : {
     104           0 :     if(bPosIsCenter != bNew)
     105             :     {
     106           0 :         bPosIsCenter = bNew;
     107           0 :         ActionChanged();
     108             :     }
     109           0 : }
     110             : 
     111             : // Get the name of the object (singular)
     112             : 
     113           0 : void E3dCubeObj::TakeObjNameSingul(XubString& rName) const
     114             : {
     115           0 :     rName=ImpGetResStr(STR_ObjNameSingulCube3d);
     116             : 
     117           0 :     String aName( GetName() );
     118           0 :     if(aName.Len())
     119             :     {
     120           0 :         rName += sal_Unicode(' ');
     121           0 :         rName += sal_Unicode('\'');
     122           0 :         rName += aName;
     123           0 :         rName += sal_Unicode('\'');
     124           0 :     }
     125           0 : }
     126             : 
     127             : // Get the name of the object (plural)
     128             : 
     129           0 : void E3dCubeObj::TakeObjNamePlural(XubString& rName) const
     130             : {
     131           0 :     rName=ImpGetResStr(STR_ObjNamePluralCube3d);
     132           0 : }
     133             : 
     134             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10