Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out...
[geos.git] / include / geos / geom / MultiLineString.h
bloba4725d70838c42dc8704228da4a7498c44166adc
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>
29 #include <string>
30 #include <vector>
32 #include <geos/inline.h>
34 // Forward declarations
35 namespace geos {
36 namespace geom { // geos::geom
37 class Coordinate;
38 class CoordinateArraySequence;
42 namespace geos {
43 namespace geom { // geos::geom
45 #ifdef _MSC_VER
46 #pragma warning(push)
47 #pragma warning(disable:4250) // T1 inherits T2 via dominance
48 #endif
50 /// Models a collection of (@link LineString}s.
51 class GEOS_DLL MultiLineString: public GeometryCollection, public Lineal {
53 public:
55 friend class GeometryFactory;
57 virtual ~MultiLineString();
59 /// Returns line dimension (1)
60 Dimension::DimensionType getDimension() const;
62 /**
63 * \brief
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;
82 /**
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
87 * are reversed.
89 * @return a MultiLineString in the reverse order
91 MultiLineString* reverse() const;
93 protected:
95 /**
96 * \brief Constructs a <code>MultiLineString</code>.
98 * @param newLines
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.
108 * @param newFactory
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);
120 #ifdef _MSC_VER
121 #pragma warning(pop)
122 #endif
124 } // namespace geos::geom
125 } // namespace geos
127 #ifdef GEOS_INLINE
128 # include "geos/geom/MultiLineString.inl"
129 #endif
131 #endif // ndef GEOS_GEOS_MULTILINESTRING_H
133 /**********************************************************************
134 * $Log$
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
141 * size_t.
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 **********************************************************************/