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