GEOS 3.4.2

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

- File List

FastNodingValidator.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/FastNodingValidator.java rev. ??? (JTS-1.8)
16 *
17 **********************************************************************/
18
19 #ifndef GEOS_NODING_FASTNODINGVALIDATOR_H
20 #define GEOS_NODING_FASTNODINGVALIDATOR_H
21
22 #include <geos/noding/SingleInteriorIntersectionFinder.h> // for composition
23 #include <geos/algorithm/LineIntersector.h> // for composition
24
25 #include <memory>
26 #include <string>
27 #include <cassert>
28
29 // Forward declarations
30 namespace geos {
31 namespace noding {
32 class SegmentString;
33 }
34 }
35
36 namespace geos {
37 namespace noding { // geos.noding
38
53 class FastNodingValidator
54 {
55
56 public:
57
58 FastNodingValidator(std::vector<noding::SegmentString*>& newSegStrings)
59 :
60 li(), // robust...
61 segStrings(newSegStrings),
62 segInt(),
63 isValidVar(true)
64 {
65 }
66
73 bool isValid()
74 {
75 execute();
76 return isValidVar;
77 }
78
85 std::string getErrorMessage() const;
86
93 void checkValid();
94
95 private:
96
97 geos::algorithm::LineIntersector li;
98
99 std::vector<noding::SegmentString*>& segStrings;
100
101 std::auto_ptr<SingleInteriorIntersectionFinder> segInt;
102
103 bool isValidVar;
104
105 void execute()
106 {
107 if (segInt.get() != NULL) return;
108 checkInteriorIntersections();
109 }
110
111 void checkInteriorIntersections();
112
113 // Declare type as noncopyable
114 FastNodingValidator(const FastNodingValidator& other);
115 FastNodingValidator& operator=(const FastNodingValidator& rhs);
116 };
117
118 } // namespace geos.noding
119 } // namespace geos
120
121 #endif // GEOS_NODING_FASTNODINGVALIDATOR_H