GEOS 3.9.1
SegmentNode.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
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: noding/SegmentNode.java 4667170ea (JTS-1.17)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_NODING_SEGMENTNODE_H
20#define GEOS_NODING_SEGMENTNODE_H
21
22#include <geos/export.h>
23
24#include <vector>
25#include <iostream>
26
27#include <geos/inline.h>
28
29#include <geos/geom/Coordinate.h>
30
31// Forward declarations
32namespace geos {
33namespace noding {
34class NodedSegmentString;
35}
36}
37
38namespace geos {
39namespace noding { // geos.noding
40
47class GEOS_DLL SegmentNode {
48private:
49 const NodedSegmentString& segString;
50
51 int segmentOctant;
52
53 bool isInteriorVar;
54
55 // Declare type as noncopyable
56 SegmentNode(const SegmentNode& other) = delete;
57 SegmentNode& operator=(const SegmentNode& rhs) = delete;
58
59public:
60 friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
61
64
67
81 const geom::Coordinate& nCoord,
82 size_t nSegmentIndex, int nSegmentOctant);
83
84 ~SegmentNode() {}
85
91 bool
92 isInterior() const
93 {
94 return isInteriorVar;
95 }
96
97 bool isEndPoint(unsigned int maxSegmentIndex) const;
98
106 int compareTo(const SegmentNode& other);
107
108 //string print() const;
109};
110
111std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
112
113struct GEOS_DLL SegmentNodeLT {
114 bool
115 operator()(SegmentNode* s1, SegmentNode* s2) const
116 {
117 return s1->compareTo(*s2) < 0;
118 }
119};
120
121
122} // namespace geos.noding
123} // namespace geos
124
125#endif // GEOS_NODING_SEGMENTNODE_H
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Represents a list of contiguous line segments, and supports noding the segments.
Definition NodedSegmentString.h:57
Represents an intersection point between two NodedSegmentString.
Definition SegmentNode.h:47
size_t segmentIndex
the index of the containing line segment in the parent edge
Definition SegmentNode.h:66
geom::Coordinate coord
the point of intersection (own copy)
Definition SegmentNode.h:63
SegmentNode(const NodedSegmentString &ss, const geom::Coordinate &nCoord, size_t nSegmentIndex, int nSegmentOctant)
bool isInterior() const
Return true if this Node is internal (not on the boundary) of the corresponding segment....
Definition SegmentNode.h:92
int compareTo(const SegmentNode &other)
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26