LCOV - code coverage report
Current view: top level - svx/source/sdr/overlay - overlaytools.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 20 185 10.8 %
Date: 2012-08-25 Functions: 3 20 15.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 20 499 4.0 %

           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                 :            : 
      30                 :            : #include <svx/sdr/overlay/overlaytools.hxx>
      31                 :            : #include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
      32                 :            : #include <basegfx/matrix/b2dhommatrix.hxx>
      33                 :            : #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
      34                 :            : #include <basegfx/polygon/b2dpolygon.hxx>
      35                 :            : #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
      36                 :            : #include <basegfx/polygon/b2dpolygontools.hxx>
      37                 :            : #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
      38                 :            : #include <drawinglayer/geometry/viewinformation2d.hxx>
      39                 :            : #include <basegfx/matrix/b2dhommatrixtools.hxx>
      40                 :            : 
      41                 :            : //////////////////////////////////////////////////////////////////////////////
      42                 :            : 
      43                 :            : namespace drawinglayer
      44                 :            : {
      45                 :            :     namespace primitive2d
      46                 :            :     {
      47                 :       6008 :         OverlayBitmapExPrimitive::OverlayBitmapExPrimitive(
      48                 :            :             const BitmapEx& rBitmapEx,
      49                 :            :             const basegfx::B2DPoint& rBasePosition,
      50                 :            :             sal_uInt16 nCenterX,
      51                 :            :             sal_uInt16 nCenterY)
      52                 :            :         :   DiscreteMetricDependentPrimitive2D(),
      53                 :            :             maBitmapEx(rBitmapEx),
      54                 :            :             maBasePosition(rBasePosition),
      55                 :            :             mnCenterX(nCenterX),
      56         [ +  - ]:       6008 :             mnCenterY(nCenterY)
      57                 :       6008 :         {}
      58                 :            : 
      59                 :       6008 :         Primitive2DSequence OverlayBitmapExPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
      60                 :            :         {
      61         [ +  - ]:       6008 :             Primitive2DSequence aRetval;
      62                 :       6008 :             const Size aBitmapSize(getBitmapEx().GetSizePixel());
      63                 :            : 
      64 [ +  - ][ +  - ]:       6008 :             if(aBitmapSize.Width() && aBitmapSize.Height() && basegfx::fTools::more(getDiscreteUnit(), 0.0))
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
      65                 :            :             {
      66                 :            :                 // calculate back from internal bitmap's extreme coordinates (the edges)
      67                 :            :                 // to logical coordinates. Only use a unified scaling value (getDiscreteUnit(),
      68                 :            :                 // the prepared one which expresses how many logic units form a discrete unit)
      69                 :            :                 // for this step. This primitive is to be displayed always unscaled (in it's pixel size)
      70                 :            :                 // and unrotated, more like a marker
      71                 :       6008 :                 const double fLeft(((0.0 - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX());
      72                 :       6008 :                 const double fTop(((0.0 - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY());
      73                 :       6008 :                 const double fRight(((aBitmapSize.getWidth() - getCenterX()) * getDiscreteUnit()) + getBasePosition().getX());
      74                 :       6008 :                 const double fBottom(((aBitmapSize.getHeight() - getCenterY()) * getDiscreteUnit()) + getBasePosition().getY());
      75                 :            : 
      76                 :            :                 // create a BitmapPrimitive2D using those positions
      77         [ +  - ]:       6008 :                 basegfx::B2DHomMatrix aTransform;
      78                 :            : 
      79         [ +  - ]:       6008 :                 aTransform.set(0, 0, fRight - fLeft);
      80         [ +  - ]:       6008 :                 aTransform.set(1, 1, fBottom - fTop);
      81         [ +  - ]:       6008 :                 aTransform.set(0, 2, fLeft);
      82         [ +  - ]:       6008 :                 aTransform.set(1, 2, fTop);
      83                 :            : 
      84 [ +  - ][ +  - ]:       6008 :                 const Primitive2DReference aPrimitive(new BitmapPrimitive2D(getBitmapEx(), aTransform));
                 [ +  - ]
      85 [ +  - ][ +  - ]:       6008 :                 aRetval = Primitive2DSequence(&aPrimitive, 1);
         [ +  - ][ +  - ]
      86                 :            :             }
      87                 :            : 
      88                 :       6008 :             return aRetval;
      89                 :            :         }
      90                 :            : 
      91                 :          0 :         bool OverlayBitmapExPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
      92                 :            :         {
      93         [ #  # ]:          0 :             if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
      94                 :            :             {
      95                 :          0 :                 const OverlayBitmapExPrimitive& rCompare = static_cast< const OverlayBitmapExPrimitive& >(rPrimitive);
      96                 :            : 
      97                 :          0 :                 return (getBitmapEx() == rCompare.getBitmapEx()
      98                 :          0 :                     && getBasePosition() == rCompare.getBasePosition()
      99                 :          0 :                     && getCenterX() == rCompare.getCenterX()
     100 [ #  # ][ #  #  :          0 :                     && getCenterY() == rCompare.getCenterY());
             #  #  #  # ]
     101                 :            :             }
     102                 :            : 
     103                 :          0 :             return false;
     104                 :            :         }
     105                 :            : 
     106                 :       9754 :         ImplPrimitrive2DIDBlock(OverlayBitmapExPrimitive, PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE)
     107                 :            : 
     108                 :            :     } // end of namespace primitive2d
     109                 :            : } // end of namespace drawinglayer
     110                 :            : 
     111                 :            : //////////////////////////////////////////////////////////////////////////////
     112                 :            : 
     113                 :            : namespace drawinglayer
     114                 :            : {
     115                 :            :     namespace primitive2d
     116                 :            :     {
     117                 :          0 :         OverlayCrosshairPrimitive::OverlayCrosshairPrimitive(
     118                 :            :             const basegfx::B2DPoint& rBasePosition,
     119                 :            :             const basegfx::BColor& rRGBColorA,
     120                 :            :             const basegfx::BColor& rRGBColorB,
     121                 :            :             double fDiscreteDashLength)
     122                 :            :         :   ViewportDependentPrimitive2D(),
     123                 :            :             maBasePosition(rBasePosition),
     124                 :            :             maRGBColorA(rRGBColorA),
     125                 :            :             maRGBColorB(rRGBColorB),
     126                 :          0 :             mfDiscreteDashLength(fDiscreteDashLength)
     127                 :          0 :         {}
     128                 :            : 
     129                 :          0 :         Primitive2DSequence OverlayCrosshairPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
     130                 :            :         {
     131                 :            :             // use the prepared Viewport information accessible using getViewport()
     132                 :          0 :             Primitive2DSequence aRetval;
     133                 :            : 
     134 [ #  # ][ #  # ]:          0 :             if(!getViewport().isEmpty())
     135                 :            :             {
     136         [ #  # ]:          0 :                 aRetval.realloc(2);
     137         [ #  # ]:          0 :                 basegfx::B2DPolygon aPolygon;
     138                 :            : 
     139 [ #  # ][ #  # ]:          0 :                 aPolygon.append(basegfx::B2DPoint(getViewport().getMinX(), getBasePosition().getY()));
     140 [ #  # ][ #  # ]:          0 :                 aPolygon.append(basegfx::B2DPoint(getViewport().getMaxX(), getBasePosition().getY()));
     141                 :            : 
     142         [ #  # ]:          0 :                 aRetval[0] = Primitive2DReference(
     143                 :            :                     new PolygonMarkerPrimitive2D(
     144                 :            :                         aPolygon,
     145                 :            :                         getRGBColorA(),
     146                 :            :                         getRGBColorB(),
     147 [ #  # ][ #  # ]:          0 :                         getDiscreteDashLength()));
         [ #  # ][ #  # ]
     148                 :            : 
     149         [ #  # ]:          0 :                 aPolygon.clear();
     150 [ #  # ][ #  # ]:          0 :                 aPolygon.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMinY()));
     151 [ #  # ][ #  # ]:          0 :                 aPolygon.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMaxY()));
     152                 :            : 
     153         [ #  # ]:          0 :                 aRetval[1] = Primitive2DReference(
     154                 :            :                     new PolygonMarkerPrimitive2D(
     155                 :            :                         aPolygon,
     156                 :            :                         getRGBColorA(),
     157                 :            :                         getRGBColorB(),
     158 [ #  # ][ #  # ]:          0 :                         getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     159                 :            :             }
     160                 :            : 
     161                 :          0 :             return aRetval;
     162                 :            :         }
     163                 :            : 
     164                 :          0 :         bool OverlayCrosshairPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
     165                 :            :         {
     166         [ #  # ]:          0 :             if(ViewportDependentPrimitive2D::operator==(rPrimitive))
     167                 :            :             {
     168                 :          0 :                 const OverlayCrosshairPrimitive& rCompare = static_cast< const OverlayCrosshairPrimitive& >(rPrimitive);
     169                 :            : 
     170                 :          0 :                 return (getBasePosition() == rCompare.getBasePosition()
     171                 :          0 :                     && getRGBColorA() == rCompare.getRGBColorA()
     172                 :          0 :                     && getRGBColorB() == rCompare.getRGBColorB()
     173 [ #  # ][ #  #  :          0 :                     && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
             #  #  #  # ]
     174                 :            :             }
     175                 :            : 
     176                 :          0 :             return false;
     177                 :            :         }
     178                 :            : 
     179                 :          0 :         ImplPrimitrive2DIDBlock(OverlayCrosshairPrimitive, PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE)
     180                 :            : 
     181                 :            :     } // end of namespace primitive2d
     182                 :            : } // end of namespace drawinglayer
     183                 :            : 
     184                 :            : //////////////////////////////////////////////////////////////////////////////
     185                 :            : 
     186                 :            : namespace drawinglayer
     187                 :            : {
     188                 :            :     namespace primitive2d
     189                 :            :     {
     190                 :          0 :         OverlayHatchRectanglePrimitive::OverlayHatchRectanglePrimitive(
     191                 :            :             const basegfx::B2DRange& rObjectRange,
     192                 :            :             double fDiscreteHatchDistance,
     193                 :            :             double fHatchRotation,
     194                 :            :             const basegfx::BColor& rHatchColor,
     195                 :            :             double fDiscreteGrow,
     196                 :            :             double fDiscreteShrink,
     197                 :            :             double fRotation)
     198                 :            :         :   DiscreteMetricDependentPrimitive2D(),
     199                 :            :             maObjectRange(rObjectRange),
     200                 :            :             mfDiscreteHatchDistance(fDiscreteHatchDistance),
     201                 :            :             mfHatchRotation(fHatchRotation),
     202                 :            :             maHatchColor(rHatchColor),
     203                 :            :             mfDiscreteGrow(fDiscreteGrow),
     204                 :            :             mfDiscreteShrink(fDiscreteShrink),
     205                 :          0 :             mfRotation(fRotation)
     206                 :          0 :         {}
     207                 :            : 
     208                 :          0 :         Primitive2DSequence OverlayHatchRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
     209                 :            :         {
     210                 :          0 :             Primitive2DSequence aRetval;
     211                 :            : 
     212         [ #  # ]:          0 :             if(basegfx::fTools::more(getDiscreteUnit(), 0.0))
     213                 :            :             {
     214                 :          0 :                 basegfx::B2DRange aInnerRange(getObjectRange());
     215                 :          0 :                 basegfx::B2DRange aOuterRange(getObjectRange());
     216         [ #  # ]:          0 :                 basegfx::B2DPolyPolygon aHatchPolyPolygon;
     217                 :            : 
     218         [ #  # ]:          0 :                 aOuterRange.grow(getDiscreteUnit() * getDiscreteGrow());
     219         [ #  # ]:          0 :                 aInnerRange.grow(getDiscreteUnit() * -getDiscreteShrink());
     220                 :            : 
     221 [ #  # ][ #  # ]:          0 :                 aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aOuterRange));
                 [ #  # ]
     222                 :            : 
     223 [ #  # ][ #  # ]:          0 :                 if(!aInnerRange.isEmpty())
     224                 :            :                 {
     225 [ #  # ][ #  # ]:          0 :                     aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aInnerRange));
                 [ #  # ]
     226                 :            :                 }
     227                 :            : 
     228         [ #  # ]:          0 :                 if(!basegfx::fTools::equalZero(getRotation()))
     229                 :            :                 {
     230                 :            :                     const basegfx::B2DHomMatrix aTransform(basegfx::tools::createRotateAroundPoint(
     231 [ #  # ][ #  # ]:          0 :                         getObjectRange().getMinX(), getObjectRange().getMinY(), getRotation()));
                 [ #  # ]
     232                 :            : 
     233 [ #  # ][ #  # ]:          0 :                     aHatchPolyPolygon.transform(aTransform);
     234                 :            :                 }
     235                 :            : 
     236                 :          0 :                 const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
     237                 :            :                 const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
     238                 :            :                     drawinglayer::attribute::HATCHSTYLE_SINGLE,
     239                 :          0 :                     getDiscreteHatchDistance() * getDiscreteUnit(),
     240                 :          0 :                     getHatchRotation() - getRotation(),
     241                 :          0 :                     getHatchColor(),
     242         [ #  # ]:          0 :                     false);
     243                 :            :                 const Primitive2DReference aPrimitive(
     244                 :            :                     new PolyPolygonHatchPrimitive2D(
     245                 :            :                         aHatchPolyPolygon,
     246                 :            :                         aEmptyColor,
     247 [ #  # ][ #  # ]:          0 :                         aFillHatchAttribute));
                 [ #  # ]
     248                 :            : 
     249 [ #  # ][ #  # ]:          0 :                 aRetval = Primitive2DSequence(&aPrimitive, 1);
         [ #  # ][ #  # ]
                 [ #  # ]
     250                 :            :             }
     251                 :            : 
     252                 :          0 :             return aRetval;
     253                 :            :         }
     254                 :            : 
     255                 :          0 :         bool OverlayHatchRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
     256                 :            :         {
     257         [ #  # ]:          0 :             if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
     258                 :            :             {
     259                 :          0 :                 const OverlayHatchRectanglePrimitive& rCompare = static_cast< const OverlayHatchRectanglePrimitive& >(rPrimitive);
     260                 :            : 
     261                 :          0 :                 return (getObjectRange() == rCompare.getObjectRange()
     262                 :          0 :                     && getDiscreteHatchDistance() == rCompare.getDiscreteHatchDistance()
     263                 :          0 :                     && getHatchRotation() == rCompare.getHatchRotation()
     264                 :          0 :                     && getHatchColor() == rCompare.getHatchColor()
     265                 :          0 :                     && getDiscreteGrow() == rCompare.getDiscreteGrow()
     266                 :          0 :                     && getDiscreteShrink() == rCompare.getDiscreteShrink()
     267 [ #  # ][ #  #  :          0 :                     && getRotation() == rCompare.getRotation());
          #  #  #  #  #  
             #  #  #  #  
                      # ]
     268                 :            :             }
     269                 :            : 
     270                 :          0 :             return false;
     271                 :            :         }
     272                 :            : 
     273                 :          0 :         ImplPrimitrive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE)
     274                 :            : 
     275                 :            :     } // end of namespace primitive2d
     276                 :            : } // end of namespace drawinglayer
     277                 :            : 
     278                 :            : //////////////////////////////////////////////////////////////////////////////
     279                 :            : 
     280                 :            : namespace drawinglayer
     281                 :            : {
     282                 :            :     namespace primitive2d
     283                 :            :     {
     284                 :          0 :         OverlayHelplineStripedPrimitive::OverlayHelplineStripedPrimitive(
     285                 :            :             const basegfx::B2DPoint& rBasePosition,
     286                 :            :             HelplineStyle eStyle,
     287                 :            :             const basegfx::BColor& rRGBColorA,
     288                 :            :             const basegfx::BColor& rRGBColorB,
     289                 :            :             double fDiscreteDashLength)
     290                 :            :         :   ViewportDependentPrimitive2D(),
     291                 :            :             maBasePosition(rBasePosition),
     292                 :            :             meStyle(eStyle),
     293                 :            :             maRGBColorA(rRGBColorA),
     294                 :            :             maRGBColorB(rRGBColorB),
     295                 :          0 :             mfDiscreteDashLength(fDiscreteDashLength)
     296                 :          0 :         {}
     297                 :            : 
     298                 :          0 :         Primitive2DSequence OverlayHelplineStripedPrimitive::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
     299                 :            :         {
     300                 :            :             // use the prepared Viewport information accessible using getViewport()
     301                 :          0 :             Primitive2DSequence aRetval;
     302                 :            : 
     303 [ #  # ][ #  # ]:          0 :             if(!getViewport().isEmpty())
     304                 :            :             {
     305      [ #  #  # ]:          0 :                 switch(getStyle())
     306                 :            :                 {
     307                 :            :                     case HELPLINESTYLE_VERTICAL :
     308                 :            :                     {
     309         [ #  # ]:          0 :                         aRetval.realloc(1);
     310         [ #  # ]:          0 :                         basegfx::B2DPolygon aLine;
     311                 :            : 
     312 [ #  # ][ #  # ]:          0 :                         aLine.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMinY()));
     313 [ #  # ][ #  # ]:          0 :                         aLine.append(basegfx::B2DPoint(getBasePosition().getX(), getViewport().getMaxY()));
     314                 :            : 
     315         [ #  # ]:          0 :                         aRetval[0] = Primitive2DReference(
     316                 :            :                             new PolygonMarkerPrimitive2D(
     317                 :            :                                 aLine,
     318                 :            :                                 getRGBColorA(),
     319                 :            :                                 getRGBColorB(),
     320 [ #  # ][ #  # ]:          0 :                                 getDiscreteDashLength()));
         [ #  # ][ #  # ]
     321         [ #  # ]:          0 :                         break;
     322                 :            :                     }
     323                 :            : 
     324                 :            :                     case HELPLINESTYLE_HORIZONTAL :
     325                 :            :                     {
     326         [ #  # ]:          0 :                         aRetval.realloc(1);
     327         [ #  # ]:          0 :                         basegfx::B2DPolygon aLine;
     328                 :            : 
     329 [ #  # ][ #  # ]:          0 :                         aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getBasePosition().getY()));
     330 [ #  # ][ #  # ]:          0 :                         aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getBasePosition().getY()));
     331                 :            : 
     332         [ #  # ]:          0 :                         aRetval[0] = Primitive2DReference(
     333                 :            :                             new PolygonMarkerPrimitive2D(
     334                 :            :                                 aLine,
     335                 :            :                                 getRGBColorA(),
     336                 :            :                                 getRGBColorB(),
     337 [ #  # ][ #  # ]:          0 :                                 getDiscreteDashLength()));
         [ #  # ][ #  # ]
     338         [ #  # ]:          0 :                         break;
     339                 :            :                     }
     340                 :            : 
     341                 :            :                     default: // case HELPLINESTYLE_POINT :
     342                 :            :                     {
     343 [ #  # ][ #  # ]:          0 :                         const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength());
                 [ #  # ]
     344         [ #  # ]:          0 :                         aRetval.realloc(2);
     345 [ #  # ][ #  # ]:          0 :                         basegfx::B2DPolygon aLineA, aLineB;
     346                 :            : 
     347         [ #  # ]:          0 :                         aLineA.append(basegfx::B2DPoint(getBasePosition().getX(), getBasePosition().getY() - fDiscreteUnit));
     348         [ #  # ]:          0 :                         aLineA.append(basegfx::B2DPoint(getBasePosition().getX(), getBasePosition().getY() + fDiscreteUnit));
     349                 :            : 
     350         [ #  # ]:          0 :                         aRetval[0] = Primitive2DReference(
     351                 :            :                             new PolygonMarkerPrimitive2D(
     352                 :            :                                 aLineA,
     353                 :            :                                 getRGBColorA(),
     354                 :            :                                 getRGBColorB(),
     355 [ #  # ][ #  # ]:          0 :                                 getDiscreteDashLength()));
         [ #  # ][ #  # ]
     356                 :            : 
     357         [ #  # ]:          0 :                         aLineB.append(basegfx::B2DPoint(getBasePosition().getX() - fDiscreteUnit, getBasePosition().getY()));
     358         [ #  # ]:          0 :                         aLineB.append(basegfx::B2DPoint(getBasePosition().getX() + fDiscreteUnit, getBasePosition().getY()));
     359                 :            : 
     360         [ #  # ]:          0 :                         aRetval[1] = Primitive2DReference(
     361                 :            :                             new PolygonMarkerPrimitive2D(
     362                 :            :                                 aLineB,
     363                 :            :                                 getRGBColorA(),
     364                 :            :                                 getRGBColorB(),
     365 [ #  # ][ #  # ]:          0 :                                 getDiscreteDashLength()));
         [ #  # ][ #  # ]
     366                 :            : 
     367 [ #  # ][ #  # ]:          0 :                         break;
     368                 :            :                     }
     369                 :            :                 }
     370                 :            :             }
     371                 :            : 
     372                 :          0 :             return aRetval;
     373                 :            :         }
     374                 :            : 
     375                 :          0 :         bool OverlayHelplineStripedPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
     376                 :            :         {
     377         [ #  # ]:          0 :             if(ViewportDependentPrimitive2D::operator==(rPrimitive))
     378                 :            :             {
     379                 :          0 :                 const OverlayHelplineStripedPrimitive& rCompare = static_cast< const OverlayHelplineStripedPrimitive& >(rPrimitive);
     380                 :            : 
     381                 :          0 :                 return (getBasePosition() == rCompare.getBasePosition()
     382                 :          0 :                     && getStyle() == rCompare.getStyle()
     383                 :          0 :                     && getRGBColorA() == rCompare.getRGBColorA()
     384                 :          0 :                     && getRGBColorB() == rCompare.getRGBColorB()
     385 [ #  # ][ #  #  :          0 :                     && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
          #  #  #  #  #  
                      # ]
     386                 :            :             }
     387                 :            : 
     388                 :          0 :             return false;
     389                 :            :         }
     390                 :            : 
     391                 :          0 :         ImplPrimitrive2DIDBlock(OverlayHelplineStripedPrimitive, PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE)
     392                 :            : 
     393                 :            :     } // end of namespace primitive2d
     394                 :            : } // end of namespace drawinglayer
     395                 :            : 
     396                 :            : //////////////////////////////////////////////////////////////////////////////
     397                 :            : 
     398                 :            : namespace drawinglayer
     399                 :            : {
     400                 :            :     namespace primitive2d
     401                 :            :     {
     402                 :          0 :         OverlayRollingRectanglePrimitive::OverlayRollingRectanglePrimitive(
     403                 :            :             const basegfx::B2DRange& aRollingRectangle,
     404                 :            :             const basegfx::BColor& rRGBColorA,
     405                 :            :             const basegfx::BColor& rRGBColorB,
     406                 :            :             double fDiscreteDashLength)
     407                 :            :         :   ViewportDependentPrimitive2D(),
     408                 :            :             maRollingRectangle(aRollingRectangle),
     409                 :            :             maRGBColorA(rRGBColorA),
     410                 :            :             maRGBColorB(rRGBColorB),
     411                 :          0 :             mfDiscreteDashLength(fDiscreteDashLength)
     412                 :          0 :         {}
     413                 :            : 
     414                 :          0 :         Primitive2DSequence OverlayRollingRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
     415                 :            :         {
     416                 :            :             // use the prepared Viewport information accessible using getViewport()
     417                 :          0 :             Primitive2DSequence aRetval;
     418                 :            : 
     419 [ #  # ][ #  # ]:          0 :             if(!getViewport().isEmpty())
     420                 :            :             {
     421         [ #  # ]:          0 :                 basegfx::B2DPolygon aLine;
     422         [ #  # ]:          0 :                 aRetval.realloc(8);
     423                 :            : 
     424                 :            :                 // Left lines
     425 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getRollingRectangle().getMinY()));
                 [ #  # ]
     426 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMinY()));
                 [ #  # ]
     427 [ #  # ][ #  # ]:          0 :                 aRetval[0] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     428                 :            : 
     429         [ #  # ]:          0 :                 aLine.clear();
     430 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getViewport().getMinX(), getRollingRectangle().getMaxY()));
                 [ #  # ]
     431 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMaxY()));
                 [ #  # ]
     432 [ #  # ][ #  # ]:          0 :                 aRetval[1] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     433                 :            : 
     434                 :            :                 // Right lines
     435         [ #  # ]:          0 :                 aLine.clear();
     436 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMinY()));
                 [ #  # ]
     437 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getRollingRectangle().getMinY()));
                 [ #  # ]
     438 [ #  # ][ #  # ]:          0 :                 aRetval[2] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     439                 :            : 
     440         [ #  # ]:          0 :                 aLine.clear();
     441 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMaxY()));
                 [ #  # ]
     442 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getViewport().getMaxX(), getRollingRectangle().getMaxY()));
                 [ #  # ]
     443 [ #  # ][ #  # ]:          0 :                 aRetval[3] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     444                 :            : 
     445                 :            :                 // Top lines
     446         [ #  # ]:          0 :                 aLine.clear();
     447 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getViewport().getMinY()));
                 [ #  # ]
     448 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMinY()));
                 [ #  # ]
     449 [ #  # ][ #  # ]:          0 :                 aRetval[4] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     450                 :            : 
     451         [ #  # ]:          0 :                 aLine.clear();
     452 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getViewport().getMinY()));
                 [ #  # ]
     453 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMinY()));
                 [ #  # ]
     454 [ #  # ][ #  # ]:          0 :                 aRetval[5] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     455                 :            : 
     456                 :            :                 // Bottom lines
     457         [ #  # ]:          0 :                 aLine.clear();
     458 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getRollingRectangle().getMaxY()));
                 [ #  # ]
     459 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMinX(), getViewport().getMaxY()));
                 [ #  # ]
     460 [ #  # ][ #  # ]:          0 :                 aRetval[6] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
                 [ #  # ]
     461                 :            : 
     462         [ #  # ]:          0 :                 aLine.clear();
     463 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getRollingRectangle().getMaxY()));
                 [ #  # ]
     464 [ #  # ][ #  # ]:          0 :                 aLine.append(basegfx::B2DPoint(getRollingRectangle().getMaxX(), getViewport().getMaxY()));
                 [ #  # ]
     465 [ #  # ][ #  # ]:          0 :                 aRetval[7] = Primitive2DReference(new PolygonMarkerPrimitive2D(aLine, getRGBColorA(), getRGBColorB(), getDiscreteDashLength()));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     466                 :            :             }
     467                 :            : 
     468                 :          0 :             return aRetval;
     469                 :            :         }
     470                 :            : 
     471                 :          0 :         bool OverlayRollingRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
     472                 :            :         {
     473         [ #  # ]:          0 :             if(ViewportDependentPrimitive2D::operator==(rPrimitive))
     474                 :            :             {
     475                 :          0 :                 const OverlayRollingRectanglePrimitive& rCompare = static_cast< const OverlayRollingRectanglePrimitive& >(rPrimitive);
     476                 :            : 
     477                 :          0 :                 return (getRollingRectangle() == rCompare.getRollingRectangle()
     478                 :          0 :                     && getRGBColorA() == rCompare.getRGBColorA()
     479                 :          0 :                     && getRGBColorB() == rCompare.getRGBColorB()
     480 [ #  # ][ #  #  :          0 :                     && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
             #  #  #  # ]
     481                 :            :             }
     482                 :            : 
     483                 :          0 :             return false;
     484                 :            :         }
     485                 :            : 
     486                 :          0 :         ImplPrimitrive2DIDBlock(OverlayRollingRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE)
     487                 :            : 
     488                 :            :     } // end of namespace primitive2d
     489                 :            : } // end of namespace drawinglayer
     490                 :            : 
     491                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10