LCOV - code coverage report
Current view: top level - include/drawinglayer/primitive3d - sdrextrudeprimitive3d.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 10 10 100.0 %
Date: 2015-06-13 12:38:46 Functions: 10 10 100.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             : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
      21             : #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
      22             : 
      23             : #include <drawinglayer/drawinglayerdllapi.h>
      24             : 
      25             : #include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
      26             : #include <basegfx/polygon/b2dpolypolygon.hxx>
      27             : 
      28             : 
      29             : 
      30             : namespace drawinglayer
      31             : {
      32             :     namespace primitive3d
      33             :     {
      34             :         /** SdrExtrudePrimitive3D class
      35             : 
      36             :             This 3D primitive expands the SdrPrimitive3D to a 3D extrude definition.
      37             :             The given 2D tools::PolyPolygon geometry is imagined as lying on the XY-plane in 3D
      38             :             and gets extruded in Z-Direction by Depth.
      39             : 
      40             :             Various possibilities e.g. for creating diagonals (edge roudings in 3D)
      41             :             and similar are given.
      42             : 
      43             :             The decomposition will create all necessary 3D planes for visualisation.
      44             :          */
      45             :         class DRAWINGLAYER_DLLPUBLIC SdrExtrudePrimitive3D : public SdrPrimitive3D
      46             :         {
      47             :         private:
      48             :             /// geometry helper for slices
      49             :             basegfx::B2DPolyPolygon                     maCorrectedPolyPolygon;
      50             :             Slice3DVector                               maSlices;
      51             : 
      52             :             /// primitive geometry data
      53             :             basegfx::B2DPolyPolygon                     maPolyPolygon;
      54             :             double                                      mfDepth;
      55             :             double                                      mfDiagonal;
      56             :             double                                      mfBackScale;
      57             : 
      58             :             /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
      59             :             geometry::ViewInformation3D*                mpLastRLGViewInformation;
      60             : 
      61             :             /// bitfield
      62             :             bool                                        mbSmoothNormals : 1; // Plane self
      63             :             bool                                        mbSmoothHorizontalNormals : 1; // always
      64             :             bool                                        mbSmoothLids : 1; // Front/back
      65             :             bool                                        mbCharacterMode : 1;
      66             :             bool                                        mbCloseFront : 1;
      67             :             bool                                        mbCloseBack : 1;
      68             : 
      69             :             /// create slices
      70             :             void impCreateSlices();
      71             : 
      72             :             /// get (evtl. create) slices
      73             :             const Slice3DVector& getSlices() const;
      74             : 
      75             :         protected:
      76             :             /// local decomposition.
      77             :             virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const SAL_OVERRIDE;
      78             : 
      79             :         public:
      80             :             /// constructor
      81             :             SdrExtrudePrimitive3D(
      82             :                 const basegfx::B3DHomMatrix& rTransform,
      83             :                 const basegfx::B2DVector& rTextureSize,
      84             :                 const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
      85             :                 const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
      86             :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
      87             :                 double fDepth,
      88             :                 double fDiagonal,
      89             :                 double fBackScale,
      90             :                 bool bSmoothNormals,
      91             :                 bool bSmoothHorizontalNormals,
      92             :                 bool bSmoothLids,
      93             :                 bool bCharacterMode,
      94             :                 bool bCloseFront,
      95             :                 bool bCloseBack);
      96             :             virtual ~SdrExtrudePrimitive3D();
      97             : 
      98             :             /// data read access
      99       20911 :             const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
     100       10747 :             double getDepth() const { return mfDepth; }
     101       10963 :             double getDiagonal() const { return mfDiagonal; }
     102        5791 :             double getBackScale() const { return mfBackScale; }
     103        1723 :             bool getSmoothNormals() const { return mbSmoothNormals; }
     104        1723 :             bool getSmoothHorizontalNormals() const { return mbSmoothHorizontalNormals; }
     105        1723 :             bool getSmoothLids() const { return mbSmoothLids; }
     106        5791 :             bool getCharacterMode() const { return mbCharacterMode; }
     107       10747 :             bool getCloseFront() const { return mbCloseFront; }
     108        5791 :             bool getCloseBack() const { return mbCloseBack; }
     109             : 
     110             :             /// compare operator
     111             :             virtual bool operator==(const BasePrimitive3D& rPrimitive) const SAL_OVERRIDE;
     112             : 
     113             :             /// get range
     114             :             virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const SAL_OVERRIDE;
     115             : 
     116             :             /// Overridden to allow for reduced line mode to decide if to buffer decomposition or not
     117             :             virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const SAL_OVERRIDE;
     118             : 
     119             :             /// provide unique ID
     120             :             DeclPrimitive3DIDBlock()
     121             :         };
     122             :     } // end of namespace primitive3d
     123             : } // end of namespace drawinglayer
     124             : 
     125             : 
     126             : 
     127             : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDREXTRUDEPRIMITIVE3D_HXX
     128             : 
     129             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11