overlaypolypolygon.cxx (f6e50924) overlaypolypolygon.cxx (1cd65da9)
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

--- 23 unchanged lines hidden (view full) ---

32#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
33
34//////////////////////////////////////////////////////////////////////////////
35
36namespace sdr
37{
38 namespace overlay
39 {
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

--- 23 unchanged lines hidden (view full) ---

32#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
33
34//////////////////////////////////////////////////////////////////////////////
35
36namespace sdr
37{
38 namespace overlay
39 {
40 drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence()
40 drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStripedAndFilled::createOverlayObjectPrimitive2DSequence()
41 {
42 drawinglayer::primitive2d::Primitive2DSequence aRetval;
43
44 if(getOverlayManager())
45 {
46 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
47 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
48 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
41 {
42 drawinglayer::primitive2d::Primitive2DSequence aRetval;
43
44 if(getOverlayManager())
45 {
46 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
47 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
48 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
49
50 const drawinglayer::primitive2d::Primitive2DReference aReference(
49 const drawinglayer::primitive2d::Primitive2DReference aStriped(
51 new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
50 new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
52 getPolyPolygon(),
51 getLinePolyPolygon(),
53 aRGBColorA,
54 aRGBColorB,
55 fStripeLengthPixel));
56
52 aRGBColorA,
53 aRGBColorB,
54 fStripeLengthPixel));
55
57 aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
56 aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aStriped, 1);
57
58 const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
59 const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
60 const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
61
62 const drawinglayer::primitive2d::Primitive2DReference aFilled(
63 new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
64 getLinePolyPolygon(),
65 aHilightColor,
66 fTransparence,
67 3.0,
68 false));
69
70 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aFilled);
58 }
59
60 return aRetval;
61 }
62
71 }
72
73 return aRetval;
74 }
75
63 void OverlayPolyPolygonStriped::stripeDefinitionHasChanged()
76 void OverlayPolyPolygonStripedAndFilled::stripeDefinitionHasChanged()
64 {
65 // react on OverlayManager's stripe definition change
66 objectChange();
67 }
68
77 {
78 // react on OverlayManager's stripe definition change
79 objectChange();
80 }
81
69 OverlayPolyPolygonStriped::OverlayPolyPolygonStriped(
70 const basegfx::B2DPolyPolygon& rPolyPolygon)
82 OverlayPolyPolygonStripedAndFilled::OverlayPolyPolygonStripedAndFilled(
83 const basegfx::B2DPolyPolygon& rLinePolyPolygon)
71 : OverlayObject(Color(COL_BLACK)),
84 : OverlayObject(Color(COL_BLACK)),
72 maPolyPolygon(rPolyPolygon)
85 maLinePolyPolygon(rLinePolyPolygon)
73 {
74 }
75
86 {
87 }
88
76 OverlayPolyPolygonStriped::~OverlayPolyPolygonStriped()
89 OverlayPolyPolygonStripedAndFilled::~OverlayPolyPolygonStripedAndFilled()
77 {
78 }
79
90 {
91 }
92
80 void OverlayPolyPolygonStriped::setPolyPolygon(const basegfx::B2DPolyPolygon& rNew)
93 void OverlayPolyPolygonStripedAndFilled::setLinePolyPolygon(const basegfx::B2DPolyPolygon& rNew)
81 {
94 {
82 if(rNew != maPolyPolygon)
95 if(rNew != maLinePolyPolygon)
83 {
84 // remember new value
96 {
97 // remember new value
85 maPolyPolygon = rNew;
98 maLinePolyPolygon = rNew;
86
87 // register change (after change)
88 objectChange();
89 }
90 }
91 } // end of namespace overlay
92} // end of namespace sdr
93
94//////////////////////////////////////////////////////////////////////////////
95// eof
99
100 // register change (after change)
101 objectChange();
102 }
103 }
104 } // end of namespace overlay
105} // end of namespace sdr
106
107//////////////////////////////////////////////////////////////////////////////
108// eof