Orientation.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2018 Paul Ramsey <pramsey@cleverlephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: algorithm/Orientation.java @ 2017-09-04
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h>
#include <geos/geom/CoordinateSequence.h>
namespace geos {
namespace algorithm { // geos::algorithm
class GEOS_DLL Orientation {
public:
/* A value that indicates an orientation or turn */
enum {
CLOCKWISE = -1,
COLLINEAR = 0,
COUNTERCLOCKWISE = 1,
RIGHT = -1,
LEFT = 1,
STRAIGHT = 0
};
static int index(const geom::CoordinateXY& p1, const geom::CoordinateXY& p2,
const geom::CoordinateXY& q);
static bool isCCW(const geom::CoordinateSequence* ring);
static bool isCCWArea(const geom::CoordinateSequence* ring);
};
} // namespace geos::algorithm
} // namespace geos
geos::algorithm::Orientation
Functions to compute the orientation of basic geometric structures including point triplets (triangle...
Definition Orientation.h:42
geos::algorithm::Orientation::index
static int index(const geom::CoordinateXY &p1, const geom::CoordinateXY &p2, const geom::CoordinateXY &q)
Returns the orientation index of the direction of the point q relative to a directed infinite line sp...
geos::algorithm::Orientation::isCCWArea
static bool isCCWArea(const geom::CoordinateSequence *ring)
geos::algorithm::Orientation::isCCW
static bool isCCW(const geom::CoordinateSequence *ring)
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38