Quadrant.h

00001 /**********************************************************************
00002  * $Id: Quadrant.h 1820 2006-09-06 16:54:23Z mloskot $
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 
00018 #ifndef GEOS_GEOMGRAPH_QUADRANT_H
00019 #define GEOS_GEOMGRAPH_QUADRANT_H
00020 
00021 #include <string>
00022 
00023 #include <geos/inline.h>
00024 
00025 // Forward declarations
00026 namespace geos {
00027         namespace geom {
00028                 class Coordinate;
00029         }
00030 }
00031 
00032 namespace geos {
00033 namespace geomgraph { // geos.geomgraph
00034 
00044 class Quadrant {
00045 public:
00050         static int quadrant(double dx, double dy);
00051 
00055         static int quadrant(const geom::Coordinate& p0, const geom::Coordinate& p1);
00056 
00060         static bool isOpposite(int quad1, int quad2);
00061 
00062         /* 
00063          * Returns the right-hand quadrant of the halfplane defined by
00064          * the two quadrants,
00065          * or -1 if the quadrants are opposite, or the quadrant if they
00066          * are identical.
00067          */
00068         static int commonHalfPlane(int quad1, int quad2);
00069 
00074         static bool isInHalfPlane(int quad, int halfPlane);
00075 
00079         static bool isNorthern(int quad);
00080 };
00081 
00082 
00083 } // namespace geos.geomgraph
00084 } // namespace geos
00085 
00086 //#ifdef GEOS_INLINE
00087 //# include "geos/geomgraph/Quadrant.inl"
00088 //#endif
00089 
00090 #endif // ifndef GEOS_GEOMGRAPH_QUADRANT_H
00091 
00092 /**********************************************************************
00093  * $Log$
00094  * Revision 1.2  2006/03/24 09:52:41  strk
00095  * USE_INLINE => GEOS_INLINE
00096  *
00097  * Revision 1.1  2006/03/09 16:46:49  strk
00098  * geos::geom namespace definition, first pass at headers split
00099  *
00100  **********************************************************************/
00101 

Generated on Fri Mar 27 04:52:58 2009 for GEOS by  doxygen 1.5.4