MultiCurve.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/geometry/MultiCurve.h
22 
23  \brief MultiCurve is a class that represents a 1-dimensional GeometryCollection whose elements are curves.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_MULTICURVE_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_MULTICURVE_H
28 
29 // TerraLib
30 #include "GeometryCollection.h"
31 
32 namespace te
33 {
34  namespace gm
35  {
36  /*!
37  \class MultiCurve
38 
39  \brief MultiCurve is a class that represents a 1-dimensional GeometryCollection whose elements are curves.
40 
41  \ingroup geometry
42 
43  \sa Geometry,
44  AbstractPoint, Point, PointM, PointZ, PointZM, PointKd,
45  Curve, LineString, Line, LinearRing, CircularString, CompoundCurve,
46  Surface, Polygon, Triangle, CurvePolygon, PolyhedralSurface, TIN,
47  GeometryCollection, MultiSurface,
48  MultiPoint, MultiLineString, MultiPolygon
49  */
51  {
52  public:
53 
55 
56  /*!
57  \brief It initializes the multi curve with the specified spatial reference system id and envelope.
58 
59  \param nGeom The number of geometries in the collection.
60  \param t The internal type of the multi curve.
61  \param srid The Spatial Reference System ID associated to the Geometry.
62  \param mbr The minimum bounding rectangle of this geometry (i.e., its envelope).
63 
64  \note The multi curve will take the ownership of the given mbr.
65  */
66  MultiCurve(std::size_t nGeom, GeomType t, int srid = 0, Envelope* mbr = 0);
67 
68  /*!
69  \brief Copy constructor.
70 
71  \param rhs The other geometry.
72  */
73  MultiCurve(const MultiCurve& rhs);
74 
75  /*! \brief Virtual destructor. */
76  virtual ~MultiCurve() { }
77 
78  /*!
79  \brief Assignment operator.
80 
81  \param rhs The other geometry.
82 
83  \return A reference for this.
84  */
85  virtual MultiCurve& operator=(const MultiCurve& rhs);
86 
87  /** @name Re-Implementation from AbstractData
88  * Methods re-Implementated from AbstractData.
89  */
90  //@{
91 
92  /*!
93  \brief It clones the linestring.
94 
95  \return A copy of the given linestring.
96 
97  \note The caller of this method will take the ownership of the returned linestring.
98 
99  \note The cloned linestring will not have the
100  MBR computed. This will save time when you
101  are just cloning a geometry and don't intend
102  to waste time computing the bounding box.
103  If you have another suggestion, please, let me know.
104  */
105  virtual te::dt::AbstractData* clone() const;
106 
107  //@}
108 
109  /** @name MultiCurve Specific Methods
110  * Specific methods for a MultiCurve.
111  */
112  //@{
113 
114  /*!
115  \brief It returns true if this MultiCurve is closed [StartPoint ( ) = EndPoint ( ) for each Curve in this MultiCurve].
116 
117  \return true if this MultiCurve is closed [StartPoint ( ) = EndPoint ( ) for each Curve in this MultiCurve].
118  */
119  bool isClosed() const;
120 
121  /*!
122  \brief It returns the Length of this MultiCurve which is equal to the sum of the lengths of the element Curves.
123 
124  \return The Length of this MultiCurve which is equal to the sum of the lengths of the element Curves.
125  */
126  double getLength() const;
127 
128  //@}
129 
130  /** @name Re-Implmentation of methods from Geometry class
131  * Re-Implmentation of basic methods from Geometry class.
132  */
133  //@{
134 
135  /*!
136  \brief MultiCurves are 1-dimensional.
137 
138  \return 1-dimensional.
139  */
140  Dimensionality getDimension() const throw();
141 
142  //@}
143 
144  };
145 
146  } // end namespace gm
147 } // end namespace te
148 
149 #endif // __TERRALIB_GEOMETRY_INTERNAL_MULTICURVE_H
150 
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
virtual ~MultiCurve()
Virtual destructor.
Definition: MultiCurve.h:76
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
Dimensionality
From Wikipedia: "in mathematics, the dimension of an object is an intrinsic property, independent of the space in which the object may happen to be embedded".
Definition: Enums.h:147
URI C++ Library.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
MultiCurve is a class that represents a 1-dimensional GeometryCollection whose elements are curves...
Definition: MultiCurve.h:50
It is a collection of other geometric objects.
It is a collection of other geometric objects.