1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 * Copyright (C) 2005 2006 Refractions Research Inc.
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.
15 **********************************************************************
17 * Last port: geom/MultiLineString.java r320 (JTS-1.12)
19 **********************************************************************/
21 #ifndef GEOS_GEOS_MULTILINESTRING_H
22 #define GEOS_GEOS_MULTILINESTRING_H
24 #include <geos/export.h>
25 #include <geos/geom/GeometryCollection.h> // for inheritance
26 #include <geos/geom/Lineal.h> // for inheritance
27 #include <geos/geom/Dimension.h>
32 #include <geos/inline.h>
34 // Forward declarations
36 namespace geom
{ // geos::geom
38 class CoordinateArraySequence
;
43 namespace geom
{ // geos::geom
47 #pragma warning(disable:4250) // T1 inherits T2 via dominance
50 /// Models a collection of (@link LineString}s.
51 class GEOS_DLL MultiLineString
: public GeometryCollection
, public Lineal
{
55 friend class GeometryFactory
;
57 virtual ~MultiLineString();
59 /// Returns line dimension (1)
60 Dimension::DimensionType
getDimension() const;
64 * Returns Dimension::False if all LineStrings in the collection
65 * are closed, 0 otherwise.
67 int getBoundaryDimension() const;
69 /// Returns a (possibly empty) MultiPoint
70 Geometry
* getBoundary() const;
72 std::string
getGeometryType() const;
74 virtual GeometryTypeId
getGeometryTypeId() const;
76 bool isClosed() const;
78 bool equalsExact(const Geometry
*other
, double tolerance
=0) const;
80 Geometry
*clone() const;
83 * Creates a MultiLineString in the reverse
84 * order to this object.
85 * Both the order of the component LineStrings
86 * and the order of their coordinate sequences
89 * @return a MultiLineString in the reverse order
91 MultiLineString
* reverse() const;
96 * \brief Constructs a <code>MultiLineString</code>.
99 * The <code>LineStrings</code>s for this
100 * <code>MultiLineString</code>, or <code>null</code>
101 * or an empty array to create the empty geometry.
102 * Elements may be empty <code>LineString</code>s,
103 * but not <code>null</code>s.
105 * Constructed object will take ownership of
106 * the vector and its elements.
109 * The GeometryFactory used to create this geometry.
110 * Caller must keep the factory alive for the life-time
111 * of the constructed MultiLineString.
114 MultiLineString(std::vector
<Geometry
*> *newLines
,
115 const GeometryFactory
*newFactory
);
117 MultiLineString(const MultiLineString
&mp
);
124 } // namespace geos::geom
128 # include "geos/geom/MultiLineString.inl"
131 #endif // ndef GEOS_GEOS_MULTILINESTRING_H
133 /**********************************************************************
135 * Revision 1.5 2006/05/04 15:49:39 strk
136 * updated all Geometry::getDimension() methods to return Dimension::DimensionType (closes bug#93)
138 * Revision 1.4 2006/04/28 10:55:39 strk
139 * Geometry constructors made protected, to ensure all constructions use GeometryFactory,
140 * which has been made friend of all Geometry derivates. getNumPoints() changed to return
143 * Revision 1.3 2006/03/24 09:52:41 strk
144 * USE_INLINE => GEOS_INLINE
146 * Revision 1.2 2006/03/23 12:12:01 strk
147 * Fixes to allow build with -DGEOS_INLINE
149 * Revision 1.1 2006/03/09 16:46:49 strk
150 * geos::geom namespace definition, first pass at headers split
152 **********************************************************************/