GEOS  3.10.0
TopologyValidationError.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2005-2006 Refractions Research Inc.
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: operation/valid/TopologyValidationError.java rev. 1.16 (JTS-1.10)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_OP_TOPOLOGYVALIDATIONERROR_H
21 #define GEOS_OP_TOPOLOGYVALIDATIONERROR_H
22 
23 #include <geos/export.h>
24 #include <string>
25 
26 #include <geos/geom/Coordinate.h> // for composition
27 
28 // Forward declarations
29 // none required
30 
31 namespace geos {
32 namespace operation { // geos::operation
33 namespace valid { // geos::operation::valid
34 
40 class GEOS_DLL TopologyValidationError {
41 public:
42 
43  enum errorEnum {
44  eError,
45  eRepeatedPoint,
46  eHoleOutsideShell,
47  eNestedHoles,
48  eDisconnectedInterior,
49  eSelfIntersection,
50  eRingSelfIntersection,
51  eNestedShells,
52  eDuplicatedRings,
53  eTooFewPoints,
54  eInvalidCoordinate,
55  eRingNotClosed,
56  oNoInvalidIntersection = -1
57  };
58 
59  TopologyValidationError(int newErrorType, const geom::Coordinate& newPt);
60  TopologyValidationError(int newErrorType);
61  const geom::Coordinate& getCoordinate() const;
62  std::string getMessage() const;
63  int getErrorType() const;
64  std::string toString() const;
65 
66 private:
67  // Used const char* to reduce dynamic allocations
68  static const char* errMsg[];
69  int errorType;
70  const geom::Coordinate pt;
71 };
72 
73 
74 } // namespace geos.operation.valid
75 } // namespace geos.operation
76 } // namespace geos
77 
78 #endif // GEOS_OP_TOPOLOGYVALIDATIONERROR_H
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Contains information about the nature and location of a geom::Geometry validation error.
Definition: TopologyValidationError.h:40
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26