Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Initial Developer of the Original Code is
16 : * [ Novell Inc. ]
17 : * Portions created by the Initial Developer are Copyright (C) 2010 the
18 : * Initial Developer. All Rights Reserved.
19 : *
20 : * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com>
21 : *
22 : * Alternatively, the contents of this file may be used under the terms of
23 : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 : * instead of those above.
27 : */
28 :
29 : #include <drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx>
30 : #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
31 :
32 : namespace drawinglayer
33 : {
34 : namespace primitive2d
35 : {
36 0 : basegfx::B2DPolyPolygon ClippedBorderLinePrimitive2D::getClipPolygon(
37 : SAL_UNUSED_PARAMETER geometry::ViewInformation2D const&) const
38 : {
39 0 : basegfx::B2DPolyPolygon aPolyPolygon;
40 0 : aPolyPolygon.append( maIntersection );
41 0 : return aPolyPolygon;
42 : }
43 :
44 0 : ClippedBorderLinePrimitive2D::ClippedBorderLinePrimitive2D(
45 : const basegfx::B2DPoint& rStart,
46 : const basegfx::B2DPoint& rEnd,
47 : double fLeftWidth,
48 : double fDistance,
49 : double fRightWidth,
50 : const basegfx::B2DPolygon& rIntersection,
51 : const basegfx::BColor& rRGBColorRight,
52 : const basegfx::BColor& rRGBColorLeft,
53 : const basegfx::BColor& rRGBColorGap,
54 : bool bHasGapColor,
55 : const short nStyle)
56 : : BorderLinePrimitive2D( rStart, rEnd, fLeftWidth,fDistance, fRightWidth,
57 : 0.0, 0.0, 0.0, 0.0, rRGBColorRight, rRGBColorLeft,
58 : rRGBColorGap, bHasGapColor, nStyle),
59 0 : maIntersection( rIntersection )
60 : {
61 0 : }
62 :
63 0 : bool ClippedBorderLinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
64 : {
65 0 : if(BorderLinePrimitive2D::operator==(rPrimitive))
66 : {
67 0 : const ClippedBorderLinePrimitive2D& rCompare = (ClippedBorderLinePrimitive2D&)rPrimitive;
68 :
69 0 : return maIntersection == rCompare.maIntersection;
70 : }
71 :
72 0 : return false;
73 : }
74 :
75 : // provide unique ID
76 0 : ImplPrimitrive2DIDBlock(ClippedBorderLinePrimitive2D, PRIMITIVE2D_ID_CLIPPEDBORDERLINEPRIMITIVE2D)
77 :
78 :
79 : } // namespace primitive2d
80 : } // namespace drawinglayer
81 :
82 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|