GEOS: SegmentNode.h Source File

GEOS 3.3.8

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

SegmentNode.h
1 /**********************************************************************
2 * $Id: SegmentNode.h 2778 2009-12-03 19:44:00Z mloskot $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: noding/SegmentNode.java rev. 1.6 (JTS-1.9)
17 *
18 **********************************************************************/
19
20 #ifndef GEOS_NODING_SEGMENTNODE_H
21 #define GEOS_NODING_SEGMENTNODE_H
22
23 #include <geos/export.h>
24
25 #include <vector>
26 #include <iostream>
27
28 #include <geos/inline.h>
29
30 #include <geos/geom/Coordinate.h>
31
32 // Forward declarations
33 namespace geos {
34 namespace noding {
35 class NodedSegmentString;
36 }
37 }
38
39 namespace geos {
40 namespace noding { // geos.noding
41
43 //
46 class GEOS_DLL SegmentNode {
47 private:
48 const NodedSegmentString& segString;
49
50 int segmentOctant;
51
52 bool isInteriorVar;
53
54 // Declare type as noncopyable
55 SegmentNode(const SegmentNode& other);
56 SegmentNode& operator=(const SegmentNode& rhs);
57
58 public:
59 friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
60
62 geom::Coordinate coord;
63
65 unsigned int segmentIndex;
66
68 //
79 SegmentNode(const NodedSegmentString& ss,
80 const geom::Coordinate& nCoord,
81 unsigned int nSegmentIndex, int nSegmentOctant);
82
83 ~SegmentNode() {}
84
90 bool isInterior() const { return isInteriorVar; }
91
92 bool isEndPoint(unsigned int maxSegmentIndex) const;
93
101 int compareTo(const SegmentNode& other);
102
103 //string print() const;
104 };
105
106 std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
107
108 struct GEOS_DLL SegmentNodeLT {
109 bool operator()(SegmentNode *s1, SegmentNode *s2) const {
110 return s1->compareTo(*s2)<0;
111 }
112 };
113
114
115 } // namespace geos.noding
116 } // namespace geos
117
118 //#ifdef GEOS_INLINE
119 //# include "geos/noding/SegmentNode.inl"
120 //#endif
121
122 #endif // GEOS_NODING_SEGMENTNODE_H
123
124 /**********************************************************************
125 * $Log$
126 * Revision 1.2 2006/03/24 09:52:41 strk
127 * USE_INLINE => GEOS_INLINE
128 *
129 * Revision 1.1 2006/03/09 16:46:49 strk
130 * geos::geom namespace definition, first pass at headers split
131 *
132 **********************************************************************/
133