| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
/********************************************************************** |
|
2
|
|
|
|
|
|
|
* |
|
3
|
|
|
|
|
|
|
* GEOS - Geometry Engine Open Source |
|
4
|
|
|
|
|
|
|
* http://geos.osgeo.org |
|
5
|
|
|
|
|
|
|
* |
|
6
|
|
|
|
|
|
|
* Copyright (C) 2006 Refractions Research Inc. |
|
7
|
|
|
|
|
|
|
* |
|
8
|
|
|
|
|
|
|
* This is free software; you can redistribute and/or modify it under |
|
9
|
|
|
|
|
|
|
* the terms of the GNU Lesser General Public Licence as published |
|
10
|
|
|
|
|
|
|
* by the Free Software Foundation. |
|
11
|
|
|
|
|
|
|
* See the COPYING file for more information. |
|
12
|
|
|
|
|
|
|
* |
|
13
|
|
|
|
|
|
|
**********************************************************************/ |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#ifndef GEOS_NODING_OCTANT_H |
|
16
|
|
|
|
|
|
|
#define GEOS_NODING_OCTANT_H |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#include |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#include |
|
21
|
|
|
|
|
|
|
#include |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
// Forward declarations |
|
24
|
|
|
|
|
|
|
namespace geos { |
|
25
|
|
|
|
|
|
|
namespace geom { |
|
26
|
|
|
|
|
|
|
class Coordinate; |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
namespace geos { |
|
31
|
|
|
|
|
|
|
namespace noding { // geos.noding |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
/** \brief |
|
34
|
|
|
|
|
|
|
* Methods for computing and working with octants of the Cartesian plane. |
|
35
|
|
|
|
|
|
|
* |
|
36
|
|
|
|
|
|
|
* Octants are numbered as follows: |
|
37
|
|
|
|
|
|
|
* |
|
38
|
|
|
|
|
|
|
* 2|1 |
|
39
|
|
|
|
|
|
|
* 3 | 0 |
|
40
|
|
|
|
|
|
|
* ---+-- |
|
41
|
|
|
|
|
|
|
* 4 | 7 |
|
42
|
|
|
|
|
|
|
* 5|6 |
|
43
|
|
|
|
|
|
|
* |
|
44
|
|
|
|
|
|
|
* If line segments lie along a coordinate axis, the octant is the lower of the two |
|
45
|
|
|
|
|
|
|
* possible values. |
|
46
|
|
|
|
|
|
|
* |
|
47
|
|
|
|
|
|
|
* Last port: noding/Octant.java rev. 1.2 (JTS-1.7) |
|
48
|
|
|
|
|
|
|
*/ |
|
49
|
|
|
|
|
|
|
class GEOS_DLL Octant { |
|
50
|
|
|
|
|
|
|
private: |
|
51
|
|
|
|
|
|
|
Octant() {} // Can't instanciate it |
|
52
|
|
|
|
|
|
|
public: |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
/** |
|
55
|
|
|
|
|
|
|
* Returns the octant of a directed line segment (specified |
|
56
|
|
|
|
|
|
|
* as x and y displacements, which cannot both be 0). |
|
57
|
|
|
|
|
|
|
*/ |
|
58
|
|
|
|
|
|
|
static int octant(double dx, double dy); |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
/** |
|
61
|
|
|
|
|
|
|
* Returns the octant of a directed line segment from p0 to p1. |
|
62
|
|
|
|
|
|
|
*/ |
|
63
|
|
|
|
|
|
|
static int octant(const geom::Coordinate& p0, const geom::Coordinate& p1); |
|
64
|
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
|
static int octant(const geom::Coordinate* p0, const geom::Coordinate* p1) |
|
66
|
|
|
|
|
|
|
{ |
|
67
|
1
|
|
|
|
|
|
::geos::ignore_unused_variable_warning(p0); |
|
68
|
1
|
|
|
|
|
|
return octant(*p0, *p1); |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
}; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
} // namespace geos.noding |
|
74
|
|
|
|
|
|
|
} // namespace geos |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#endif |