GEOS 3.11.1
Orientation.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2018 Paul Ramsey <pramsey@cleverlephant.ca>
7 *
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.
12 *
13 **********************************************************************
14 *
15 * Last port: algorithm/Orientation.java @ 2017-09-04
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22#include <geos/geom/Coordinate.h>
23#include <geos/geom/CoordinateSequence.h>
24
25namespace geos {
26namespace algorithm { // geos::algorithm
27
42class GEOS_DLL Orientation {
43public:
44
45 /* A value that indicates an orientation or turn */
46 enum {
47 CLOCKWISE = -1,
48 COLLINEAR = 0,
49 COUNTERCLOCKWISE = 1,
50 RIGHT = -1,
51 LEFT = 1,
52 STRAIGHT = 0
53 };
54
67 static int index(const geom::Coordinate& p1, const geom::Coordinate& p2,
68 const geom::Coordinate& q);
69
89 static bool isCCW(const geom::CoordinateSequence* ring);
90
115 static bool isCCWArea(const geom::CoordinateSequence* ring);
116
117};
118
119
120} // namespace geos::algorithm
121} // namespace geos
122
Functions to compute the orientation of basic geometric structures including point triplets (triangle...
Definition: Orientation.h:42
static bool isCCWArea(const geom::CoordinateSequence *ring)
static bool isCCW(const geom::CoordinateSequence *ring)
static int index(const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q)
Returns the orientation index of the direction of the point q relative to a directed infinite line sp...
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Basic namespace for all GEOS functionalities.
Definition: geos.h:39