-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Curve.php
90 lines (81 loc) · 2.35 KB
/
Curve.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
declare(strict_types=1);
namespace Brick\Geo;
use Brick\Geo\Engine\GeometryEngine;
use Brick\Geo\Exception\EmptyGeometryException;
use Brick\Geo\Exception\GeometryEngineException;
/**
* A Curve is a 1-dimensional geometric object usually stored as a sequence of Points.
*
* The subtype of Curve specifies the form of the interpolation between Points.
*/
abstract class Curve extends Geometry
{
/**
* @noproxy
*
* A Curve is a 1-dimensional geometric object.
*/
public function dimension() : int
{
return 1;
}
/**
* Returns the length of this Curve in its associated spatial reference.
*
* @deprecated Please use `$geometryEngine->length()`.
*
* @noproxy
*
* @throws GeometryEngineException If the operation is not supported by the geometry engine.
*/
public function length(GeometryEngine $geometryEngine) : float
{
return $geometryEngine->length($this);
}
/**
* Returns the start Point of this Curve.
*
* @throws EmptyGeometryException If the curve is empty.
*/
abstract public function startPoint() : Point;
/**
* Returns the end Point of this Curve.
*
* @throws EmptyGeometryException If the curve is empty.
*/
abstract public function endPoint() : Point;
/**
* Returns whether this Curve is closed.
*
* The curve is closed if `startPoint()` == `endPoint()`.
*
* @deprecated Please use `$geometryEngine->isClosed()`.
*
* @noproxy
*
* @throws GeometryEngineException If the operation is not supported by the geometry engine.
*/
public function isClosed(GeometryEngine $geometryEngine) : bool
{
return $geometryEngine->isClosed($this);
}
/**
* Returns whether this Curve is a ring.
*
* The curve is a ring if it is both closed and simple.
*
* The curve is closed if its start point is equal to its end point.
* The curve is simple if it does not pass through the same point more than once.
*
* @deprecated Please use `$geometryEngine->isRing()`.
*
* @noproxy
*
* @throws GeometryEngineException If the operation is not supported by the geometry engine.
*/
public function isRing(GeometryEngine $geometryEngine) : bool
{
return $geometryEngine->isRing($this);
}
}