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

Generated by: LCOV version 1.10