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