GEOS 3.6.2
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
30namespace geos {
31 namespace noding {
32 class SegmentString;
33 }
34}
35
36namespace geos {
37namespace noding { // geos.noding
38
53class FastNodingValidator
54{
55
56public:
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
95private:
96
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
115 FastNodingValidator& operator=(const FastNodingValidator& rhs);
116};
117
118} // namespace geos.noding
119} // namespace geos
120
121#endif // GEOS_NODING_FASTNODINGVALIDATOR_H
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:49
Validates that a collection of SegmentStrings is correctly noded.
Definition FastNodingValidator.h:54
std::string getErrorMessage() const
bool isValid()
Definition FastNodingValidator.h:73
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition PreparedLineString.h:27
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25