PointZM.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/PointZM.h
22 
23  \brief A point with a z-coordinate value and an associated measurement.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_POINTZM_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_POINTZM_H
28 
29 // TerraLib
30 #include "Point.h"
31 
32 namespace te
33 {
34  namespace gm
35  {
36 
37  /*!
38  \class PointZM
39 
40  \brief A point with a z-coordinate value and an associated measurement.
41 
42  \ingroup geometry
43 
44  \sa Geometry,
45  AbstractPoint, Point, PointM, PointZ, PointKd,
46  Curve, LineString, LinearRing,
47  Surface, Polygon, Triangle, PolyhedralSurface, TIN,
48  GeometryCollection, MultiSurface, MultiCurve,
49  MultiPoint, MultiLineString, MultiPolygon
50  */
51  class TEGEOMEXPORT PointZM : 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 z The Point z-coordinate value.
68  \param m The Point m-coordinate value.
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 point will take the ownership of the given mbr.
73  */
74  PointZM(const double& x, const double& y, const double & z, const double& m, int srid = 0, Envelope* mbr = 0);
75 
76  /*!
77  \brief It initializes the point with the specified spatial reference system id and envelope.
78 
79  \param srid The Spatial Reference System ID associated to the Geometry.
80  \param mbr The minimum bounding rectangle of this geometry (i.e., its envelope). It may be a NULL value.
81 
82  \note The point will take the ownership of the given mbr.
83  */
84  PointZM(int srid = 0, Envelope* mbr = 0);
85 
86  /*!
87  \brief Copy constructor.
88 
89  \param rhs The other geometry.
90  */
91  PointZM(const PointZM& rhs);
92 
93  /*! \brief Destructor. */
94  ~PointZM() { }
95 
96  /*!
97  \brief Assignment operator.
98 
99  \param rhs The other geometry.
100 
101  \return A reference for this.
102  */
103  PointZM& operator=(const PointZM& rhs);
104 
105  //@}
106 
107  /** @name Re-Implementation from AbstractData
108  * Methods re-Implementated from AbstractData.
109  */
110  //@{
111 
112  /*!
113  \brief It clones the point.
114 
115  \return A copy of the given point.
116 
117  \note The caller of this method will take the ownership of the returned point.
118 
119  \note The cloned point will not have the
120  MBR computed. This will save time when you
121  are just cloning a geometry and don't intend
122  to waste time computing the bounding box.
123  If you have another suggestion, please, let me know.
124  */
125  te::dt::AbstractData* clone() const;
126 
127  //@}
128 
129  /** @name Re-Implementation from Geometry
130  * Methods re-Implementated from Geometry.
131  */
132  //@{
133 
134  /*!
135  \brief It returns a derived geometry collection value according to the range of coordinate values inclusively.
136 
137  \param mStart The initial coordinate value.
138  \param mEnd The final coordinate value.
139 
140  \return A GeometryCollection value.
141 
142  \note The caller of this method will take the ownership of geometry.
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& getZ() const { return m_z; }
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 setZ(const double& z) { m_z = z; }
168 
169  /*!
170  \brief It returns the Point z-coordinate value.
171 
172  \return The z-coordinate value for this Point.
173  */
174  const double& getM() const { return m_m; }
175 
176  /*!
177  \brief It sets the Point z-coordinate value.
178 
179  \param z The z-coordinate value for this Point.
180  */
181  void setM(const double& m) { m_m = m; }
182 
183  private:
184 
185  double m_z; //!< The Point z-coordinate value.
186  double m_m; //!< The Point m-coordinate value.
187  };
188 
189  } // end namespace gm
190 } // end namespace te
191 
192 #endif // __TERRALIB_GEOMETRY_INTERNAL_POINTZM_H
193 
Base exception class for plugin module.
Definition: Exception.h:42
A point with x and y coordinate values.
void setZ(const double &z)
It sets the Point z-coordinate value.
Definition: PointZM.h:167
A point with a z-coordinate value and an associated measurement.
Definition: PointZM.h:51
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
~PointZM()
Destructor.
Definition: PointZM.h:94
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.
const double & getZ() const
It returns the Point z-coordinate value.
Definition: PointZM.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
const double & getM() const
It returns the Point z-coordinate value.
Definition: PointZM.h:174
double m_z
The Point z-coordinate value.
Definition: PointZM.h:185
double m_m
The Point m-coordinate value.
Definition: PointZM.h:186
void setM(const double &m)
It sets the Point z-coordinate value.
Definition: PointZM.h:181