GEOS 3.6.2
Quadrant.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: geomgraph/Quadrant.java rev. 1.8 (JTS-1.10)
17 *
18 **********************************************************************/
19
20
21#ifndef GEOS_GEOMGRAPH_QUADRANT_H
22#define GEOS_GEOMGRAPH_QUADRANT_H
23
24#include <geos/export.h>
25#include <string>
26
27#include <geos/inline.h>
28
29// Forward declarations
30namespace geos {
31 namespace geom {
32 class Coordinate;
33 }
34}
35
36namespace geos {
37namespace geomgraph { // geos.geomgraph
38
48class GEOS_DLL Quadrant {
49
50public:
51
52 static const int NE = 0;
53 static const int NW = 1;
54 static const int SW = 2;
55 static const int SE = 3;
56
63 static int quadrant(double dx, double dy);
64
70 static int quadrant(const geom::Coordinate& p0,
71 const geom::Coordinate& p1);
72
76 static bool isOpposite(int quad1, int quad2);
77
78 /*
79 * Returns the right-hand quadrant of the halfplane defined by
80 * the two quadrants,
81 * or -1 if the quadrants are opposite, or the quadrant if they
82 * are identical.
83 */
84 static int commonHalfPlane(int quad1, int quad2);
85
90 static bool isInHalfPlane(int quad, int halfPlane);
91
95 static bool isNorthern(int quad);
96};
97
98
99} // namespace geos.geomgraph
100} // namespace geos
101
102#endif // ifndef GEOS_GEOMGRAPH_QUADRANT_H
103
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25