00001 /********************************************************************** 00002 * $Id: Quadrant.h 2557 2009-06-08 09:30:55Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: geomgraph/Quadrant.java rev. 1.8 (JTS-1.10) 00018 * 00019 **********************************************************************/ 00020 00021 00022 #ifndef GEOS_GEOMGRAPH_QUADRANT_H 00023 #define GEOS_GEOMGRAPH_QUADRANT_H 00024 00025 #include <geos/export.h> 00026 #include <string> 00027 00028 #include <geos/inline.h> 00029 00030 // Forward declarations 00031 namespace geos { 00032 namespace geom { 00033 class Coordinate; 00034 } 00035 } 00036 00037 namespace geos { 00038 namespace geomgraph { // geos.geomgraph 00039 00049 class GEOS_DLL Quadrant { 00050 00051 public: 00052 00053 static const int NE = 0; 00054 static const int NW = 1; 00055 static const int SW = 2; 00056 static const int SE = 3; 00057 00064 static int quadrant(double dx, double dy); 00065 00071 static int quadrant(const geom::Coordinate& p0, 00072 const geom::Coordinate& p1); 00073 00077 static bool isOpposite(int quad1, int quad2); 00078 00079 /* 00080 * Returns the right-hand quadrant of the halfplane defined by 00081 * the two quadrants, 00082 * or -1 if the quadrants are opposite, or the quadrant if they 00083 * are identical. 00084 */ 00085 static int commonHalfPlane(int quad1, int quad2); 00086 00091 static bool isInHalfPlane(int quad, int halfPlane); 00092 00096 static bool isNorthern(int quad); 00097 }; 00098 00099 00100 } // namespace geos.geomgraph 00101 } // namespace geos 00102 00103 //#ifdef GEOS_INLINE 00104 //# include "geos/geomgraph/Quadrant.inl" 00105 //#endif 00106 00107 #endif // ifndef GEOS_GEOMGRAPH_QUADRANT_H 00108 00109 /********************************************************************** 00110 * $Log$ 00111 * Revision 1.2 2006/03/24 09:52:41 strk 00112 * USE_INLINE => GEOS_INLINE 00113 * 00114 * Revision 1.1 2006/03/09 16:46:49 strk 00115 * geos::geom namespace definition, first pass at headers split 00116 * 00117 **********************************************************************/ 00118