LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/drawinglayer/primitive2d - polypolygonprimitive2d.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 20 25 80.0 %
Date: 2012-08-25 Functions: 26 32 81.2 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 17 38 44.7 %

           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 INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
      30                 :            : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
      31                 :            : 
      32                 :            : #include <drawinglayer/drawinglayerdllapi.h>
      33                 :            : 
      34                 :            : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
      35                 :            : #include <drawinglayer/attribute/fillbitmapattribute.hxx>
      36                 :            : #include <basegfx/polygon/b2dpolypolygon.hxx>
      37                 :            : #include <drawinglayer/attribute/lineattribute.hxx>
      38                 :            : #include <drawinglayer/attribute/strokeattribute.hxx>
      39                 :            : #include <drawinglayer/attribute/linestartendattribute.hxx>
      40                 :            : #include <drawinglayer/attribute/fillgradientattribute.hxx>
      41                 :            : #include <drawinglayer/attribute/fillhatchattribute.hxx>
      42                 :            : #include <basegfx/color/bcolor.hxx>
      43                 :            : 
      44                 :            : //////////////////////////////////////////////////////////////////////////////
      45                 :            : // PolyPolygonHairlinePrimitive2D class
      46                 :            : 
      47                 :            : namespace drawinglayer
      48                 :            : {
      49                 :            :     namespace primitive2d
      50                 :            :     {
      51                 :            :         /** PolyPolygonHairlinePrimitive2D class
      52                 :            : 
      53                 :            :             This primitive defines a multi-PolygonHairlinePrimitive2D and is
      54                 :            :             just for convenience. The definition is not different from the single
      55                 :            :             defined PolygonHairlinePrimitive2Ds.
      56                 :            :          */
      57 [ +  - ][ -  + ]:      77818 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonHairlinePrimitive2D : public BufferedDecompositionPrimitive2D
      58                 :            :         {
      59                 :            :         private:
      60                 :            :             /// the hairline geometry
      61                 :            :             basegfx::B2DPolyPolygon                 maPolyPolygon;
      62                 :            : 
      63                 :            :             /// the hairline color
      64                 :            :             basegfx::BColor                         maBColor;
      65                 :            : 
      66                 :            :         protected:
      67                 :            :             /// local decomposition.
      68                 :            :             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
      69                 :            : 
      70                 :            :         public:
      71                 :            :             /// constructor
      72                 :            :             PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor);
      73                 :            : 
      74                 :            :             /// data read access
      75                 :     198219 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
      76                 :      40949 :             const basegfx::BColor& getBColor() const { return maBColor; }
      77                 :            : 
      78                 :            :             /// compare operator
      79                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
      80                 :            : 
      81                 :            :             /// get range
      82                 :            :             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
      83                 :            : 
      84                 :            :             /// provide unique ID
      85                 :            :             DeclPrimitrive2DIDBlock()
      86                 :            :         };
      87                 :            :     } // end of namespace primitive2d
      88                 :            : } // end of namespace drawinglayer
      89                 :            : 
      90                 :            : //////////////////////////////////////////////////////////////////////////////
      91                 :            : // PolyPolygonMarkerPrimitive2D class
      92                 :            : 
      93                 :            : namespace drawinglayer
      94                 :            : {
      95                 :            :     namespace primitive2d
      96                 :            :     {
      97                 :            :         /** PolyPolygonMarkerPrimitive2D class
      98                 :            : 
      99                 :            :             This primitive defines a multi-PolygonMarkerPrimitive2D and is
     100                 :            :             just for convenience. The definition is not different from the single
     101                 :            :             defined PolygonMarkerPrimitive2Ds.
     102                 :            :          */
     103 [ #  # ][ #  # ]:          0 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
     104                 :            :         {
     105                 :            :         private:
     106                 :            :             /// the marker hairline geometry
     107                 :            :             basegfx::B2DPolyPolygon                 maPolyPolygon;
     108                 :            : 
     109                 :            :             /// the two colors
     110                 :            :             basegfx::BColor                         maRGBColorA;
     111                 :            :             basegfx::BColor                         maRGBColorB;
     112                 :            : 
     113                 :            :             /// the dash distance in 'pixels'
     114                 :            :             double                                  mfDiscreteDashLength;
     115                 :            : 
     116                 :            :         protected:
     117                 :            :             /// local decomposition.
     118                 :            :             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
     119                 :            : 
     120                 :            :         public:
     121                 :            :             /// constructor
     122                 :            :             PolyPolygonMarkerPrimitive2D(
     123                 :            :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
     124                 :            :                 const basegfx::BColor& rRGBColorA,
     125                 :            :                 const basegfx::BColor& rRGBColorB,
     126                 :            :                 double fDiscreteDashLength);
     127                 :            : 
     128                 :            :             // data read access
     129                 :          0 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
     130                 :          0 :             const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
     131                 :          0 :             const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
     132                 :          0 :             double getDiscreteDashLength() const { return mfDiscreteDashLength; }
     133                 :            : 
     134                 :            :             /// compare operator
     135                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
     136                 :            : 
     137                 :            :             /// get range
     138                 :            :             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
     139                 :            : 
     140                 :            :             /// provide unique ID
     141                 :            :             DeclPrimitrive2DIDBlock()
     142                 :            :         };
     143                 :            :     } // end of namespace primitive2d
     144                 :            : } // end of namespace drawinglayer
     145                 :            : 
     146                 :            : //////////////////////////////////////////////////////////////////////////////
     147                 :            : // PolyPolygonStrokePrimitive2D class
     148                 :            : 
     149                 :            : namespace drawinglayer
     150                 :            : {
     151                 :            :     namespace primitive2d
     152                 :            :     {
     153                 :            :         /** PolyPolygonStrokePrimitive2D class
     154                 :            : 
     155                 :            :             This primitive defines a multi-PolygonStrokePrimitive2D and is
     156                 :            :             just for convenience. The definition is not different from the single
     157                 :            :             defined PolygonStrokePrimitive2Ds.
     158                 :            :          */
     159 [ +  - ][ +  - ]:         36 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
         [ +  - ][ -  + ]
     160                 :            :         {
     161                 :            :         private:
     162                 :            :             /// the line geometry
     163                 :            :             basegfx::B2DPolyPolygon                 maPolyPolygon;
     164                 :            : 
     165                 :            :             /// the line attributes like width, join and color
     166                 :            :             attribute::LineAttribute                maLineAttribute;
     167                 :            : 
     168                 :            :             /// the line stroking (if used)
     169                 :            :             attribute::StrokeAttribute              maStrokeAttribute;
     170                 :            : 
     171                 :            :         protected:
     172                 :            :             /// local decomposition.
     173                 :            :             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
     174                 :            : 
     175                 :            :         public:
     176                 :            :             /// constructor
     177                 :            :             PolyPolygonStrokePrimitive2D(
     178                 :            :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
     179                 :            :                 const attribute::LineAttribute& rLineAttribute,
     180                 :            :                 const attribute::StrokeAttribute& rStrokeAttribute);
     181                 :            : 
     182                 :            :             /// data read access
     183                 :         18 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
     184                 :         18 :             const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
     185                 :         18 :             const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
     186                 :            : 
     187                 :            :             /// compare operator
     188                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
     189                 :            : 
     190                 :            :             /// get range
     191                 :            :             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
     192                 :            : 
     193                 :            :             /// provide unique ID
     194                 :            :             DeclPrimitrive2DIDBlock()
     195                 :            :         };
     196                 :            :     } // end of namespace primitive2d
     197                 :            : } // end of namespace drawinglayer
     198                 :            : 
     199                 :            : //////////////////////////////////////////////////////////////////////////////
     200                 :            : // PolyPolygonColorPrimitive2D class
     201                 :            : 
     202                 :            : namespace drawinglayer
     203                 :            : {
     204                 :            :     namespace primitive2d
     205                 :            :     {
     206                 :            :         /** PolyPolygonColorPrimitive2D class
     207                 :            : 
     208                 :            :             This primitive defines a PolyPolygon filled with a single color.
     209                 :            :             This is one of the non-decomposable primitives, so a renderer
     210                 :            :             should proccess it.
     211                 :            :          */
     212 [ +  - ][ -  + ]:     436674 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonColorPrimitive2D : public BasePrimitive2D
     213                 :            :         {
     214                 :            :         private:
     215                 :            :             /// the PolyPolygon geometry
     216                 :            :             basegfx::B2DPolyPolygon                 maPolyPolygon;
     217                 :            : 
     218                 :            :             /// the polygon fill color
     219                 :            :             basegfx::BColor                         maBColor;
     220                 :            : 
     221                 :            :         public:
     222                 :            :             /// constructor
     223                 :            :             PolyPolygonColorPrimitive2D(
     224                 :            :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
     225                 :            :                 const basegfx::BColor& rBColor);
     226                 :            : 
     227                 :            :             /// data read access
     228                 :     519164 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
     229                 :     266324 :             const basegfx::BColor& getBColor() const { return maBColor; }
     230                 :            : 
     231                 :            :             /// compare operator
     232                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
     233                 :            : 
     234                 :            :             /// get range
     235                 :            :             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
     236                 :            : 
     237                 :            :             /// provide unique ID
     238                 :            :             DeclPrimitrive2DIDBlock()
     239                 :            :         };
     240                 :            :     } // end of namespace primitive2d
     241                 :            : } // end of namespace drawinglayer
     242                 :            : 
     243                 :            : //////////////////////////////////////////////////////////////////////////////
     244                 :            : // PolyPolygonGradientPrimitive2D class
     245                 :            : 
     246                 :            : namespace drawinglayer
     247                 :            : {
     248                 :            :     namespace primitive2d
     249                 :            :     {
     250                 :            :         /** PolyPolygonColorPrimitive2D class
     251                 :            : 
     252                 :            :             This primitive defines a PolyPolygon filled with a gradient. The
     253                 :            :             decomosition will create a MaskPrimitive2D containing a
     254                 :            :             FillGradientPrimitive2D.
     255                 :            :          */
     256 [ +  - ][ +  - ]:        418 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonGradientPrimitive2D : public BufferedDecompositionPrimitive2D
                 [ -  + ]
     257                 :            :         {
     258                 :            :         private:
     259                 :            :             /// the PolyPolygon geometry
     260                 :            :             basegfx::B2DPolyPolygon                     maPolyPolygon;
     261                 :            : 
     262                 :            :             /// the gradient definition
     263                 :            :             attribute::FillGradientAttribute            maFillGradient;
     264                 :            : 
     265                 :            :         protected:
     266                 :            :             /// local decomposition.
     267                 :            :             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
     268                 :            : 
     269                 :            :         public:
     270                 :            :             /// constructor
     271                 :            :             PolyPolygonGradientPrimitive2D(
     272                 :            :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
     273                 :            :                 const attribute::FillGradientAttribute& rFillGradient);
     274                 :            : 
     275                 :            :             /// data read access
     276                 :        653 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
     277                 :        653 :             const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
     278                 :            : 
     279                 :            :             /// compare operator
     280                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
     281                 :            : 
     282                 :            :             /// provide unique ID
     283                 :            :             DeclPrimitrive2DIDBlock()
     284                 :            :         };
     285                 :            :     } // end of namespace primitive2d
     286                 :            : } // end of namespace drawinglayer
     287                 :            : 
     288                 :            : //////////////////////////////////////////////////////////////////////////////
     289                 :            : // PolyPolygonHatchPrimitive2D class
     290                 :            : 
     291                 :            : namespace drawinglayer
     292                 :            : {
     293                 :            :     namespace primitive2d
     294                 :            :     {
     295                 :            :         /** PolyPolygonHatchPrimitive2D class
     296                 :            : 
     297                 :            :             This primitive defines a PolyPolygon filled with a hatch. The
     298                 :            :             decomosition will create a MaskPrimitive2D containing a
     299                 :            :             FillHatchPrimitive2D.
     300                 :            :          */
     301 [ +  - ][ +  - ]:       2532 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonHatchPrimitive2D : public BufferedDecompositionPrimitive2D
                 [ -  + ]
     302                 :            :         {
     303                 :            :         private:
     304                 :            :             /// the PolyPolygon geometry
     305                 :            :             basegfx::B2DPolyPolygon                     maPolyPolygon;
     306                 :            : 
     307                 :            :             /// the hatch background color (if used)
     308                 :            :             basegfx::BColor                             maBackgroundColor;
     309                 :            : 
     310                 :            :             /// the hatch definition
     311                 :            :             attribute::FillHatchAttribute               maFillHatch;
     312                 :            : 
     313                 :            :         protected:
     314                 :            :             /// local decomposition.
     315                 :            :             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
     316                 :            : 
     317                 :            :         public:
     318                 :            :             /// constructor
     319                 :            :             PolyPolygonHatchPrimitive2D(
     320                 :            :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
     321                 :            :                 const basegfx::BColor& rBackgroundColor,
     322                 :            :                 const attribute::FillHatchAttribute& rFillHatch);
     323                 :            : 
     324                 :            :             /// data read access
     325                 :       2532 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
     326                 :       1266 :             const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
     327                 :       2532 :             const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
     328                 :            : 
     329                 :            :             /// compare operator
     330                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
     331                 :            : 
     332                 :            :             /// provide unique ID
     333                 :            :             DeclPrimitrive2DIDBlock()
     334                 :            :         };
     335                 :            :     } // end of namespace primitive2d
     336                 :            : } // end of namespace drawinglayer
     337                 :            : 
     338                 :            : //////////////////////////////////////////////////////////////////////////////
     339                 :            : // PolyPolygonBitmapPrimitive2D class
     340                 :            : 
     341                 :            : namespace drawinglayer
     342                 :            : {
     343                 :            :     namespace primitive2d
     344                 :            :     {
     345                 :            :         /** PolyPolygonBitmapPrimitive2D class
     346                 :            : 
     347                 :            :             This primitive defines a PolyPolygon filled with bitmap data
     348                 :            :             (including transparence). The decomosition will create a MaskPrimitive2D
     349                 :            :             containing a FillBitmapPrimitive2D.
     350                 :            :          */
     351 [ +  - ][ +  - ]:        524 :         class DRAWINGLAYER_DLLPUBLIC PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
                 [ -  + ]
     352                 :            :         {
     353                 :            :         private:
     354                 :            :             /// the PolyPolygon geometry
     355                 :            :             basegfx::B2DPolyPolygon                     maPolyPolygon;
     356                 :            : 
     357                 :            :             /// the bitmap fill definition (may include tiling)
     358                 :            :             attribute::FillBitmapAttribute              maFillBitmap;
     359                 :            : 
     360                 :            :         protected:
     361                 :            :             /// local decomposition.
     362                 :            :             virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
     363                 :            : 
     364                 :            :         public:
     365                 :            :             /// constructor
     366                 :            :             PolyPolygonBitmapPrimitive2D(
     367                 :            :                 const basegfx::B2DPolyPolygon& rPolyPolygon,
     368                 :            :                 const attribute::FillBitmapAttribute& rFillBitmap);
     369                 :            : 
     370                 :            :             /// data read access
     371                 :        837 :             const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
     372                 :        837 :             const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
     373                 :            : 
     374                 :            :             /// compare operator
     375                 :            :             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
     376                 :            : 
     377                 :            :             /// provide unique ID
     378                 :            :             DeclPrimitrive2DIDBlock()
     379                 :            :         };
     380                 :            :     } // end of namespace primitive2d
     381                 :            : } // end of namespace drawinglayer
     382                 :            : 
     383                 :            : //////////////////////////////////////////////////////////////////////////////
     384                 :            : 
     385                 :            : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
     386                 :            : 
     387                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10