GEOS  3.8.1
MultiLineString.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  * Copyright (C) 2005 2006 Refractions Research Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geom/MultiLineString.java r320 (JTS-1.12)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_GEOS_MULTILINESTRING_H
22 #define GEOS_GEOS_MULTILINESTRING_H
23 
24 #include <geos/export.h>
25 #include <geos/geom/GeometryCollection.h> // for inheritance
26 #include <geos/geom/Dimension.h>
27 #include <geos/geom/LineString.h>
28 
29 #include <string>
30 #include <vector>
31 
32 #include <geos/inline.h>
33 
34 // Forward declarations
35 namespace geos {
36 namespace geom { // geos::geom
37 class Coordinate;
38 class CoordinateArraySequence;
39 }
40 }
41 
42 namespace geos {
43 namespace geom { // geos::geom
44 
45 #ifdef _MSC_VER
46 #pragma warning(push)
47 #pragma warning(disable:4250) // T1 inherits T2 via dominance
48 #endif
49 
51 class GEOS_DLL MultiLineString: public GeometryCollection {
52 
53 public:
54 
55  friend class GeometryFactory;
56 
57  ~MultiLineString() override = default;
58 
61 
63  return d == Dimension::L;
64  }
65 
71  int getBoundaryDimension() const override;
72 
74  std::unique_ptr<Geometry> getBoundary() const override;
75 
76  std::string getGeometryType() const override;
77 
79 
80  bool isClosed() const;
81 
82  bool equalsExact(const Geometry* other, double tolerance = 0) const override;
83 
84  std::unique_ptr<Geometry> clone() const override;
85 
95  std::unique_ptr<Geometry> reverse() const override;
96 
97 protected:
98 
116  MultiLineString(std::vector<Geometry*>* newLines,
117  const GeometryFactory* newFactory);
118 
119  MultiLineString(std::vector<std::unique_ptr<LineString>> && newLines,
120  const GeometryFactory& newFactory);
121 
122  MultiLineString(std::vector<std::unique_ptr<Geometry>> && newLines,
123  const GeometryFactory& newFactory);
124 
125  MultiLineString(const MultiLineString& mp);
126 
127  int
128  getSortIndex() const override
129  {
130  return SORTINDEX_MULTILINESTRING;
131  };
132 
133 };
134 
135 #ifdef _MSC_VER
136 #pragma warning(pop)
137 #endif
138 
139 } // namespace geos::geom
140 } // namespace geos
141 
142 #ifdef GEOS_INLINE
143 # include "geos/geom/MultiLineString.inl"
144 #endif
145 
146 #endif // ndef GEOS_GEOS_MULTILINESTRING_H
DimensionType
Definition: Dimension.h:31
@ L
Dimension value of a curve (1).
Definition: Dimension.h:45
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:55
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Models a collection of LineStrings.
Definition: MultiLineString.h:51
std::unique_ptr< Geometry > reverse() const override
std::unique_ptr< Geometry > getBoundary() const override
Returns a (possibly empty) MultiPoint.
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition: MultiLineString.h:62
Dimension::DimensionType getDimension() const override
Returns line dimension (1)
std::unique_ptr< Geometry > clone() const override
bool equalsExact(const Geometry *other, double tolerance=0) const override
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
std::string getGeometryType() const override
Return a string representation of this Geometry type.
int getBoundaryDimension() const override
Returns Dimension::False if all LineStrings in the collection are closed, 0 otherwise.
MultiLineString(std::vector< Geometry * > *newLines, const GeometryFactory *newFactory)
Constructs a MultiLineString.
GeometryTypeId
Geometry types.
Definition: Geometry.h:75
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25