Completed
Push — master ( fb47da...fedb3d )
by WEBEWEB
01:20
created

Word::setX1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2020 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\ThirdParty\OcrLad\Model;
13
14
use WBW\Library\Core\Geometry\Point;
15
use WBW\Library\Core\Model\Attribute\StringContentTrait;
16
use WBW\Library\Core\Model\Attribute\StringTypeTrait;
17
18
/**
19
 * Word.
20
 *
21
 * @author webeweb <https://github.com/webeweb>
22
 * @package WBW\Library\Core\ThirdParty\OcrLad\Model
23
 */
24
class Word {
25
26
    use StringContentTrait;
27
    use StringTypeTrait;
28
29
    /**
30
     * OCR confidence.
31
     *
32
     * @var float
33
     */
34
    private $ocrConfidence;
35
36
    /**
37
     * Point 1.
38
     *
39
     * @var Point
40
     */
41
    private $point1;
42
43
    /**
44
     * Point 2.
45
     *
46
     * @var Point
47
     */
48
    private $point2;
49
50
    /**
51
     * Constructor.
52
     */
53
    public function __construct() {
54
        $this->setPoint1(new Point());
55
        $this->setPoint2(new Point());
56
    }
57
58
    /**
59
     * Get the OCR confidence.
60
     *
61
     * @return float Returns the OCR confidence.
62
     */
63
    public function getOcrConfidence() {
64
        return $this->ocrConfidence;
65
    }
66
67
    /**
68
     * Get the point 1.
69
     *
70
     * @return Point Returns the point 1
71
     */
72
    public function getPoint1() {
73
        return $this->point1;
74
    }
75
76
    /**
77
     * Get the point 2.
78
     *
79
     * @return Point Returns the point 2.
80
     */
81
    public function getPoint2() {
82
        return $this->point2;
83
    }
84
85
    /**
86
     * Get the X1.
87
     *
88
     * @return float Returns the X1.
89
     */
90
    public function getX1() {
91
        return $this->getPoint1()->getX();
92
    }
93
94
    /**
95
     * Get the X2.
96
     *
97
     * @return float Returns the X2.
98
     */
99
    public function getX2() {
100
        return $this->getPoint2()->getX();
101
    }
102
103
    /**
104
     * Get the Y1.
105
     *
106
     * @return float Returns the Y1.
107
     */
108
    public function getY1() {
109
        return $this->getPoint1()->getY();
110
    }
111
112
    /**
113
     * Get the Y2.
114
     *
115
     * @return float Returns the Y2.
116
     */
117
    public function getY2() {
118
        return $this->getPoint2()->getY();
119
    }
120
121
    /**
122
     * Set the OCR confidence.
123
     *
124
     * @param float $ocrConfidence The OCR confidence.
125
     * @return Word Returns this word.
126
     */
127
    public function setOcrConfidence($ocrConfidence) {
128
        $this->ocrConfidence = $ocrConfidence;
129
        return $this;
130
    }
131
132
    /**
133
     * Set the point 1.
134
     *
135
     * @param Point $point1 The point 1.
136
     * @return Word Returns this word.
137
     */
138
    protected function setPoint1(Point $point1) {
139
        $this->point1 = $point1;
140
        return $this;
141
    }
142
143
    /**
144
     * Set the point 2.
145
     *
146
     * @param Point $point2 The point 2.
147
     * @return Word Returns this word.
148
     */
149
    protected function setPoint2(Point $point2) {
150
        $this->point2 = $point2;
151
        return $this;
152
    }
153
154
    /**
155
     * Set the X1.
156
     *
157
     * @param float $x1 The X1.
158
     * @return Word Returns this word.
159
     */
160
    public function setX1($x1) {
161
        $this->getPoint1()->setX($x1);
162
        return $this;
163
    }
164
165
    /**
166
     * Set the X2.
167
     *
168
     * @param float $x2 The X2.
169
     * @return Word Returns this word.
170
     */
171
    public function setX2($x2) {
172
        $this->getPoint2()->setX($x2);
173
        return $this;
174
    }
175
176
    /**
177
     * Set the Y1.
178
     *
179
     * @param float $y1 The Y1.
180
     * @return Word Returns this word.
181
     */
182
    public function setY1($y1) {
183
        $this->getPoint1()->setY($y1);
184
        return $this;
185
    }
186
187
    /**
188
     * Set the Y2.
189
     *
190
     * @param float $y2 The Y2.
191
     * @return Word Returns this word.
192
     */
193
    public function setY2($y2) {
194
        $this->getPoint2()->setY($y2);
195
        return $this;
196
    }
197
}