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