GEOS  3.3.3
Quadrant.h
1 /**********************************************************************
2  * $Id: Quadrant.h 2557 2009-06-08 09:30:55Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geomgraph/Quadrant.java rev. 1.8 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 
22 #ifndef GEOS_GEOMGRAPH_QUADRANT_H
23 #define GEOS_GEOMGRAPH_QUADRANT_H
24 
25 #include <geos/export.h>
26 #include <string>
27 
28 #include <geos/inline.h>
29 
30 // Forward declarations
31 namespace geos {
32  namespace geom {
33  class Coordinate;
34  }
35 }
36 
37 namespace geos {
38 namespace geomgraph { // geos.geomgraph
39 
49 class GEOS_DLL Quadrant {
50 
51 public:
52 
53  static const int NE = 0;
54  static const int NW = 1;
55  static const int SW = 2;
56  static const int SE = 3;
57 
64  static int quadrant(double dx, double dy);
65 
71  static int quadrant(const geom::Coordinate& p0,
72  const geom::Coordinate& p1);
73 
77  static bool isOpposite(int quad1, int quad2);
78 
79  /*
80  * Returns the right-hand quadrant of the halfplane defined by
81  * the two quadrants,
82  * or -1 if the quadrants are opposite, or the quadrant if they
83  * are identical.
84  */
85  static int commonHalfPlane(int quad1, int quad2);
86 
91  static bool isInHalfPlane(int quad, int halfPlane);
92 
96  static bool isNorthern(int quad);
97 };
98 
99 
100 } // namespace geos.geomgraph
101 } // namespace geos
102 
103 //#ifdef GEOS_INLINE
104 //# include "geos/geomgraph/Quadrant.inl"
105 //#endif
106 
107 #endif // ifndef GEOS_GEOMGRAPH_QUADRANT_H
108 
109 /**********************************************************************
110  * $Log$
111  * Revision 1.2 2006/03/24 09:52:41 strk
112  * USE_INLINE => GEOS_INLINE
113  *
114  * Revision 1.1 2006/03/09 16:46:49 strk
115  * geos::geom namespace definition, first pass at headers split
116  *
117  **********************************************************************/
118