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/overlayhatchrect.hxx>
22 : #include <vcl/hatch.hxx>
23 : #include <vcl/outdev.hxx>
24 : #include <basegfx/matrix/b2dhommatrix.hxx>
25 : #include <basegfx/polygon/b2dpolygontools.hxx>
26 : #include <basegfx/polygon/b2dpolygon.hxx>
27 : #include <basegfx/numeric/ftools.hxx>
28 : #include <svx/sdr/overlay/overlaytools.hxx>
29 :
30 : //////////////////////////////////////////////////////////////////////////////
31 :
32 : namespace sdr
33 : {
34 : namespace overlay
35 : {
36 0 : drawinglayer::primitive2d::Primitive2DSequence OverlayHatchRect::createOverlayObjectPrimitive2DSequence()
37 : {
38 0 : const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
39 : const drawinglayer::primitive2d::Primitive2DReference aReference(
40 : new drawinglayer::primitive2d::OverlayHatchRectanglePrimitive(
41 : aHatchRange,
42 : 3.0,
43 : getHatchRotation(),
44 0 : getBaseColor().getBColor(),
45 : getDiscreteGrow(),
46 : getDiscreteShrink(),
47 0 : getRotation()));
48 :
49 0 : return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
50 : }
51 :
52 0 : OverlayHatchRect::OverlayHatchRect(
53 : const basegfx::B2DPoint& rBasePosition,
54 : const basegfx::B2DPoint& rSecondPosition,
55 : const Color& rHatchColor,
56 : double fDiscreteGrow,
57 : double fDiscreteShrink,
58 : double fHatchRotation,
59 : double fRotation)
60 : : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
61 : maSecondPosition(rSecondPosition),
62 : mfDiscreteGrow(fDiscreteGrow),
63 : mfDiscreteShrink(fDiscreteShrink),
64 : mfHatchRotation(fHatchRotation),
65 0 : mfRotation(fRotation)
66 : {
67 0 : }
68 : } // end of namespace overlay
69 : } // end of namespace sdr
70 :
71 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|