/src/geos/src/noding/ValidatingNoder.cpp
Line | Count | Source |
1 | | /********************************************************************** |
2 | | * |
3 | | * GEOS - Geometry Engine Open Source |
4 | | * http://geos.osgeo.org |
5 | | * |
6 | | * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca> |
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 | | #include <geos/noding/FastNodingValidator.h> |
16 | | #include <geos/noding/ValidatingNoder.h> |
17 | | #include <geos/noding/SegmentString.h> |
18 | | |
19 | | |
20 | | #include <memory> // for unique_ptr |
21 | | #include <iostream> |
22 | | |
23 | | namespace geos { |
24 | | namespace noding { // geos.noding |
25 | | |
26 | 28.2k | ValidatingNoder::~ValidatingNoder() = default; |
27 | | |
28 | | void |
29 | | ValidatingNoder::computeNodes(const std::vector<SegmentString*>& segStrings) |
30 | 28.2k | { |
31 | 28.2k | noder.computeNodes(segStrings); |
32 | 28.2k | nodedSS = noder.getNodedSubstrings(); |
33 | 28.2k | validate(); |
34 | 28.2k | } |
35 | | |
36 | | void |
37 | | ValidatingNoder::validate() const |
38 | 24.0k | { |
39 | 24.0k | FastNodingValidator nv(nodedSS); |
40 | 24.0k | try { |
41 | 24.0k | nv.checkValid(); |
42 | 24.0k | } |
43 | 24.0k | catch (const std::exception &) { |
44 | 4.51k | throw; |
45 | 4.51k | } |
46 | 24.0k | } |
47 | | |
48 | | std::vector<std::unique_ptr<SegmentString>> |
49 | | ValidatingNoder::getNodedSubstrings() |
50 | 19.4k | { |
51 | 19.4k | return std::move(nodedSS); |
52 | 19.4k | } |
53 | | |
54 | | |
55 | | |
56 | | } // namespace geos.noding |
57 | | } // namespace geos |