Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <svx/sdr/overlay/overlayline.hxx>
30 : : #include <tools/gen.hxx>
31 : : #include <vcl/outdev.hxx>
32 : : #include <basegfx/vector/b2dvector.hxx>
33 : : #include <basegfx/matrix/b2dhommatrix.hxx>
34 : : #include <basegfx/polygon/b2dpolygontools.hxx>
35 : : #include <svx/sdr/overlay/overlaymanager.hxx>
36 : : #include <basegfx/polygon/b2dpolygon.hxx>
37 : : #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
38 : :
39 : : //////////////////////////////////////////////////////////////////////////////
40 : :
41 : : namespace sdr
42 : : {
43 : : namespace overlay
44 : : {
45 : 0 : drawinglayer::primitive2d::Primitive2DSequence OverlayLineStriped::createOverlayObjectPrimitive2DSequence()
46 : : {
47 : 0 : drawinglayer::primitive2d::Primitive2DSequence aRetval;
48 : :
49 [ # # ]: 0 : if(getOverlayManager())
50 : : {
51 : 0 : const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
52 : 0 : const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
53 : 0 : const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
54 [ # # ]: 0 : basegfx::B2DPolygon aLine;
55 : :
56 [ # # ]: 0 : aLine.append(getBasePosition());
57 [ # # ]: 0 : aLine.append(getSecondPosition());
58 : :
59 : : const drawinglayer::primitive2d::Primitive2DReference aReference(
60 : : new drawinglayer::primitive2d::PolygonMarkerPrimitive2D(
61 : : aLine,
62 : : aRGBColorA,
63 : : aRGBColorB,
64 [ # # ][ # # ]: 0 : fStripeLengthPixel));
[ # # ]
65 : :
66 [ # # ][ # # ]: 0 : aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
[ # # ][ # # ]
67 : : }
68 : :
69 : 0 : return aRetval;
70 : : }
71 : :
72 : 0 : void OverlayLineStriped::stripeDefinitionHasChanged()
73 : : {
74 : : // react on OverlayManager's stripe definition change
75 : 0 : objectChange();
76 : 0 : }
77 : :
78 : 0 : OverlayLineStriped::OverlayLineStriped(
79 : : const basegfx::B2DPoint& rBasePos,
80 : : const basegfx::B2DPoint& rSecondPos)
81 : : : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)),
82 [ # # ]: 0 : maSecondPosition(rSecondPos)
83 : : {
84 : 0 : }
85 : :
86 : 0 : OverlayLineStriped::~OverlayLineStriped()
87 : : {
88 [ # # ]: 0 : }
89 : : } // end of namespace overlay
90 : : } // end of namespace sdr
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|