MultiPoint.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/MultiPoint.h
22 
23  \brief MultiPoint is a GeometryCollection whose elements are restricted to points.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_MULTIPOINT_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_MULTIPOINT_H
28 
29 // TerraLib
30 #include "GeometryCollection.h"
31 
32 #include "Exception.h"
33 #include <exception>
34 
35 namespace te
36 {
37  namespace gm
38  {
39  /*!
40  \class MultiPoint
41 
42  \brief MultiPoint is a GeometryCollection whose elements are restricted to points.
43 
44  \ingroup geometry
45 
46  \sa Geometry,
47  AbstractPoint, Point, PointM, PointZ, PointZM, PointKd,
48  Curve, LineString, LinearRing,
49  Surface, Polygon, Triangle, PolyhedralSurface, TIN,
50  GeometryCollection, MultiSurface, MultiCurve,
51  MultiLineString, MultiPolygon
52  */
54  {
55  public:
56 
58 
59  /** @name Initializer methods on geometric objects
60  * Methods for initializing a geometric object.
61  */
62  //@{
63 
64  /*!
65  \brief It initializes the Geometry with the specified spatial reference system id and envelope.
66 
67  \param nGeom The number of geometries in the collection.
68  \param t The internal type of the Geometry.
69  \param srid The Spatial Reference System ID associated to the Geometry.
70  \param mbr The minimum bounding rectangle of this geometry (i.e., its envelope). It may be a NULL value.
71 
72  \note The Geometry will take the ownership of the given mbr.
73  */
74  MultiPoint(std::size_t nGeom, GeomType t, int srid = 0, Envelope* mbr = 0);
75 
76  /*!
77  \brief Copy constructor.
78 
79  \param rhs The other geometry.
80  */
81  MultiPoint(const MultiPoint& rhs);
82 
83  /*! \brief Destructor. */
85 
86  /*!
87  \brief Assignment operator.
88 
89  \param rhs The other geometry.
90 
91  \return A reference for this.
92  */
94 
95  //@}
96 
97  /** @name Re-Implementation from AbstractData
98  * Methods re-Implementated from AbstractData.
99  */
100  //@{
101 
102  /*!
103  \brief It clones the multi point.
104 
105  \return A copy of the given multi point.
106 
107  \note The caller of this method will take the ownership of the returned multi point.
108 
109  \note The cloned multi point will not have the
110  MBR computed. This will save time when you
111  are just cloning a geometry and don't intend
112  to waste time computing the bounding box.
113  If you have another suggestion, please, let me know.
114  */
116 
117  //@}
118 
119  /** @name Re-Implmentation of methods from Geometry class
120  * Re-Implmentation of basic methods from Geometry class.
121  */
122  //@{
123 
124  /*!
125  \brief MultiPoint is 0-dimensional.
126 
127  \return 0-dimensional.
128  */
129  Dimensionality getDimension() const throw();
130 
131  /*!
132  \brief The name of the instantiable subtype of geometry: MultiPoint.
133 
134  \return The name of the instantiable subtype of geometry: MultiPoint.
135  */
136  const std::string& getGeometryType() const throw();
137 
138  /*!
139  \brief It returns a derived geometry collection value according to the range of coordinate values inclusively.
140 
141  \param mStart The initial coordinate value.
142  \param mEnd The final coordinate value.
143 
144  \return A GeometryCollection value.
145 
146  \note The caller of this method will take the ownership of geometry.
147 
148  \note This method only applies to Point and Line geometries, including homogeneous collections of points or lines.
149  For polygons this will return a NULL value.
150  */
151  Geometry* locateBetween(const double& mStart, const double& mEnd) const throw(Exception);
152 
153  //@}
154 
155  private:
156 
157  static const std::string sm_typeName; //!< Geometry type name for MultiPoint.
158  };
159 
160  } // end namespace gm
161 } // end namespace te
162 
163 #endif // __TERRALIB_GEOMETRY_INTERNAL_MULTIPOINT_H
164 
te::gm::MultiPoint::MultiPoint
MultiPoint(std::size_t nGeom, GeomType t, int srid=0, Envelope *mbr=0)
It initializes the Geometry with the specified spatial reference system id and envelope.
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::gm::MultiPoint
MultiPoint is a GeometryCollection whose elements are restricted to points.
Definition: MultiPoint.h:54
te
TerraLib.
Definition: AddressGeocodingOp.h:52
TEGEOMEXPORT
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
te::gm::GeometryCollection
It is a collection of other geometric objects.
Definition: GeometryCollection.h:58
te::gm::MultiPoint::~MultiPoint
~MultiPoint()
Destructor.
Definition: MultiPoint.h:84
te::gm::MultiPoint::getDimension
Dimensionality getDimension() const
MultiPoint is 0-dimensional.
Exception.h
An exception class for the XML module.
te::Exception
Base exception class for plugin module.
Definition: Exception.h:42
te::gm::MultiPoint::MultiPoint
MultiPoint(const MultiPoint &rhs)
Copy constructor.
te::gm::Dimensionality
Dimensionality
From Wikipedia: "in mathematics, the dimension of an object is an intrinsic property,...
Definition: Enums.h:148
TE_DEFINE_VISITABLE
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
te::gm::MultiPoint::operator=
MultiPoint & operator=(const MultiPoint &rhs)
Assignment operator.
te::gm::MultiPoint::clone
te::dt::AbstractData * clone() const
It clones the multi point.
te::dt::AbstractData
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:56
GeometryCollection.h
It is a collection of other geometric objects.
te::gm::Geometry
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
te::gm::GeomType
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:42