00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_NODING_SEGMENTSTRING_H
00017 #define GEOS_NODING_SEGMENTSTRING_H
00018
00019 #include <geos/noding/SegmentNodeList.h>
00020 #include <geos/geom/CoordinateSequence.h>
00021
00022 #include <geos/inline.h>
00023
00024 #include <vector>
00025
00026
00027 namespace geos {
00028 namespace algorithm {
00029 class LineIntersector;
00030 }
00031 }
00032
00033 namespace geos {
00034 namespace noding {
00035
00055 class SegmentString {
00056 public:
00057 typedef std::vector<const SegmentString*> ConstVect;
00058 typedef std::vector<SegmentString *> NonConstVect;
00059
00060 friend std::ostream& operator<< (std::ostream& os,
00061 const SegmentString& ss);
00062
00063 private:
00064 SegmentNodeList nodeList;
00065 geom::CoordinateSequence *pts;
00066 mutable unsigned int npts;
00067 const void* context;
00068 bool isIsolatedVar;
00069
00070 public:
00071
00072 void testInvariant() const;
00073
00075
00081 SegmentString(geom::CoordinateSequence *newPts, const void* newContext);
00082
00083 ~SegmentString();
00084
00085
00086
00087 const void* getData() const;
00088
00089 const SegmentNodeList& getNodeList() const;
00090
00091 SegmentNodeList& getNodeList();
00092
00093 unsigned int size() const;
00094
00095 const geom::Coordinate& getCoordinate(unsigned int i) const;
00096
00100
00104 geom::CoordinateSequence* getCoordinates() const;
00105
00109
00113 void notifyCoordinatesChange() const;
00114
00115
00116
00117
00118 void setIsolated(bool isIsolated);
00119
00120 bool isIsolated() const;
00121
00122 bool isClosed() const;
00123
00132 int getSegmentOctant(unsigned int index) const;
00133
00139 void addIntersections(algorithm::LineIntersector *li,
00140 unsigned int segmentIndex, int geomIndex);
00141
00149 void addIntersection(algorithm::LineIntersector *li,
00150 unsigned int segmentIndex,
00151 int geomIndex, int intIndex);
00152
00160 void addIntersection(const geom::Coordinate& intPt,
00161 unsigned int segmentIndex);
00162
00163 static void getNodedSubstrings(
00164 const SegmentString::NonConstVect& segStrings,
00165 SegmentString::NonConstVect* resultEdgeList);
00166
00167 static SegmentString::NonConstVect* getNodedSubstrings(
00168 const SegmentString::NonConstVect& segStrings);
00169 };
00170
00171 inline void
00172 SegmentString::testInvariant() const
00173 {
00174 assert(pts);
00175 assert(pts->size() > 1);
00176 assert(pts->size() == npts);
00177 }
00178
00179 std::ostream& operator<< (std::ostream& os, const SegmentString& ss);
00180
00181 }
00182 }
00183
00184 #ifdef GEOS_INLINE
00185 # include "geos/noding/SegmentString.inl"
00186 #endif
00187
00188 #endif
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224