merge the formfield patch from ooo-build
[ooovba.git] / svx / source / sdr / overlay / overlaypolypolygon.cxx
blob6827cd64cf1b88b8f574d7b6e37e1aa48e8a7632
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: overlaypolypolygon.cxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <svx/sdr/overlay/overlaypolypolygon.hxx>
34 #include <vcl/salbtype.hxx>
35 #include <vcl/outdev.hxx>
36 #include <basegfx/matrix/b2dhommatrix.hxx>
37 #include <basegfx/polygon/b2dpolypolygontools.hxx>
38 #include <svx/sdr/overlay/overlaymanager.hxx>
39 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
41 //////////////////////////////////////////////////////////////////////////////
43 namespace sdr
45 namespace overlay
47 drawinglayer::primitive2d::Primitive2DSequence OverlayPolyPolygonStriped::createOverlayObjectPrimitive2DSequence()
49 drawinglayer::primitive2d::Primitive2DSequence aRetval;
51 if(getOverlayManager())
53 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
54 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
55 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
57 const drawinglayer::primitive2d::Primitive2DReference aReference(
58 new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
59 getPolyPolygon(),
60 aRGBColorA,
61 aRGBColorB,
62 fStripeLengthPixel));
64 aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
67 return aRetval;
70 void OverlayPolyPolygonStriped::stripeDefinitionHasChanged()
72 // react on OverlayManager's stripe definition change
73 objectChange();
76 OverlayPolyPolygonStriped::OverlayPolyPolygonStriped(
77 const basegfx::B2DPolyPolygon& rPolyPolygon)
78 : OverlayObject(Color(COL_BLACK)),
79 maPolyPolygon(rPolyPolygon)
83 OverlayPolyPolygonStriped::~OverlayPolyPolygonStriped()
87 void OverlayPolyPolygonStriped::setPolyPolygon(const basegfx::B2DPolyPolygon& rNew)
89 if(rNew != maPolyPolygon)
91 // remember new value
92 maPolyPolygon = rNew;
94 // register change (after change)
95 objectChange();
98 } // end of namespace overlay
99 } // end of namespace sdr
101 //////////////////////////////////////////////////////////////////////////////
102 // eof