1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2006 Refractions Research Inc.
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.
13 **********************************************************************/
15 #ifndef GEOS_NODING_OCTANT_H
16 #define GEOS_NODING_OCTANT_H
18 #include <geos/export.h>
20 #include <geos/inline.h>
21 #include <geos/util.h>
23 // Forward declarations
31 namespace noding
{ // geos.noding
34 * Methods for computing and working with octants of the Cartesian plane.
36 * Octants are numbered as follows:
44 * If line segments lie along a coordinate axis, the octant is the lower of the two
47 * Last port: noding/Octant.java rev. 1.2 (JTS-1.7)
49 class GEOS_DLL Octant
{
51 Octant() {} // Can't instanciate it
55 * Returns the octant of a directed line segment (specified
56 * as x and y displacements, which cannot both be 0).
58 static int octant(double dx
, double dy
);
61 * Returns the octant of a directed line segment from p0 to p1.
63 static int octant(const geom::Coordinate
& p0
, const geom::Coordinate
& p1
);
65 static int octant(const geom::Coordinate
* p0
, const geom::Coordinate
* p1
)
67 ::geos::ignore_unused_variable_warning(p0
);
68 return octant(*p0
, *p1
);
73 } // namespace geos.noding
77 //# include "geos/noding/Octant.inl"
82 /**********************************************************************
84 * Revision 1.2 2006/03/24 09:52:41 strk
85 * USE_INLINE => GEOS_INLINE
87 * Revision 1.1 2006/03/09 16:46:49 strk
88 * geos::geom namespace definition, first pass at headers split
90 **********************************************************************/