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 <memory>
00027 #include <string>
00028 #include <cassert>
00029
00030
00031 namespace geos {
00032 namespace noding {
00033 class SegmentString;
00034 }
00035 }
00036
00037 namespace geos {
00038 namespace noding {
00039
00054 class FastNodingValidator
00055 {
00056
00057 public:
00058
00059 FastNodingValidator(std::vector<noding::SegmentString*>& newSegStrings)
00060 :
00061 li(),
00062 segStrings(newSegStrings),
00063 segInt(),
00064 isValidVar(true)
00065 {
00066 }
00067
00074 bool isValid()
00075 {
00076 execute();
00077 return isValidVar;
00078 }
00079
00086 std::string getErrorMessage() const;
00087
00094 void checkValid();
00095
00096 private:
00097
00098 geos::algorithm::LineIntersector li;
00099
00100 std::vector<noding::SegmentString*>& segStrings;
00101
00102 std::auto_ptr<SingleInteriorIntersectionFinder> segInt;
00103
00104 bool isValidVar;
00105
00106 void execute()
00107 {
00108 if (segInt.get() != NULL) return;
00109 checkInteriorIntersections();
00110 }
00111
00112 void checkInteriorIntersections();
00113
00114
00115 FastNodingValidator(const FastNodingValidator& other);
00116 FastNodingValidator& operator=(const FastNodingValidator& rhs);
00117 };
00118
00119 }
00120 }
00121
00122 #endif // GEOS_NODING_FASTNODINGVALIDATOR_H
00123
00124
00125
00126