LCOV - code coverage report
Current view: top level - include/drawinglayer/primitive2d - transformprimitive2d.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 2 2 100.0 %
Date: 2015-06-13 12:38:46 Functions: 3 3 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_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
      21             : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
      22             : 
      23             : #include <drawinglayer/drawinglayerdllapi.h>
      24             : 
      25             : #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
      26             : #include <basegfx/matrix/b2dhommatrix.hxx>
      27             : 
      28             : 
      29             : 
      30             : namespace drawinglayer
      31             : {
      32             :     namespace primitive2d
      33             :     {
      34             :         /** TransformPrimitive2D class
      35             : 
      36             :             This is one of the basic grouping primitives and it provides
      37             :             embedding a sequence of primitives (a geometry) into a
      38             :             transformation. All renderers have to handle this, usually by
      39             :             building a current transformation stack (linear combination)
      40             :             and applying this to all to-be-rendered geometry. If not handling
      41             :             this, the output will be mostly wrong since this primitive is
      42             :             widely used.
      43             : 
      44             :             It does transform by embedding an existing geometry into a
      45             :             transformation as Child-content. This allows re-usage of the
      46             :             refcounted Uno-Api primitives and their existung, buffered
      47             :             decompositions.
      48             : 
      49             :             It could e.g. be used to show a single object geometry in 1000
      50             :             different, transformed states without the need to create those
      51             :             thousand primitive contents.
      52             :          */
      53       16400 :         class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D : public GroupPrimitive2D
      54             :         {
      55             :         private:
      56             :             // the transformation to apply to the child geometry
      57             :             basegfx::B2DHomMatrix                   maTransformation;
      58             : 
      59             :         public:
      60             :             /// constructor
      61             :             TransformPrimitive2D(
      62             :                 const basegfx::B2DHomMatrix& rTransformation,
      63             :                 const Primitive2DSequence& rChildren);
      64             : 
      65             :             /// data read access
      66       45599 :             const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
      67             : 
      68             :             /// compare operator
      69             :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;
      70             : 
      71             :             /// get range
      72             :             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
      73             : 
      74             :             /// provide unique ID
      75             :             DeclPrimitive2DIDBlock()
      76             :         };
      77             :     } // end of namespace primitive2d
      78             : } // end of namespace drawinglayer
      79             : 
      80             : 
      81             : 
      82             : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX
      83             : 
      84             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11