00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_NODING_FASTNODINGVALIDATOR_H
00021 #define GEOS_NODING_FASTNODINGVALIDATOR_H
00022
00023 #include <geos/noding/SingleInteriorIntersectionFinder.h>
00024 #include <geos/algorithm/LineIntersector.h>
00025
00026 #include <cassert>
00027 #include <string>
00028
00029
00030 namespace geos {
00031 namespace noding {
00032 class SegmentString;
00033 }
00034 }
00035
00036 namespace geos {
00037 namespace noding {
00038
00053 class FastNodingValidator
00054 {
00055
00056 public:
00057
00058 FastNodingValidator(std::vector<noding::SegmentString*>& newSegStrings)
00059 :
00060 li(),
00061 segStrings(newSegStrings),
00062 segInt(),
00063 isValidVar(true)
00064 {
00065 }
00066
00073 bool isValid()
00074 {
00075 execute();
00076 return isValidVar;
00077 }
00078
00085 std::string getErrorMessage() const;
00086
00093 void checkValid();
00094
00095 private:
00096
00097 geos::algorithm::LineIntersector li;
00098
00099 std::vector<noding::SegmentString*>& segStrings;
00100
00101 std::auto_ptr<SingleInteriorIntersectionFinder> segInt;
00102
00103 bool isValidVar;
00104
00105 void execute()
00106 {
00107 if (segInt.get() != NULL) return;
00108 checkInteriorIntersections();
00109 }
00110
00111 void checkInteriorIntersections();
00112
00113
00114 };
00115
00116 }
00117 }
00118
00119 #endif // GEOS_NODING_FASTNODINGVALIDATOR_H
00120
00121
00122
00123