All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PointZ.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/PointZ.h
22 
23  \brief A point with z-coordinate value.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_POINTZ_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_POINTZ_H
28 
29 // TerraLib
30 #include "Point.h"
31 
32 namespace te
33 {
34  namespace gm
35  {
36 
37  /*!
38  \class PointZ
39 
40  \brief A point with z-coordinate value.
41 
42  \ingroup geometry
43 
44  \sa Geometry,
45  AbstractPoint, Point, PointM, PointZM, PointKd,
46  Curve, LineString, LinearRing,
47  Surface, Polygon, Triangle, PolyhedralSurface, TIN,
48  GeometryCollection, MultiSurface, MultiCurve,
49  MultiPoint, MultiLineString, MultiPolygon
50  */
51  class TEGEOMEXPORT PointZ : 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 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  PointZ(const double& x, const double& y, const double & z, int srid = 0, Envelope* mbr = 0);
74 
75  /*!
76  \brief It initializes the Geometry 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). It may be a NULL value.
80 
81  \note The point will take the ownership of the given mbr.
82  */
83  PointZ(int srid = 0, Envelope* mbr = 0);
84 
85  /*!
86  \brief Copy constructor.
87 
88  \param rhs The other geometry.
89  */
90  PointZ(const PointZ& rhs);
91 
92  /*! \brief Destructor. */
93  ~PointZ() { }
94 
95  /*!
96  \brief Assignment operator.
97 
98  \param rhs The other geometry.
99 
100  \return A reference for this.
101  */
102  PointZ& operator=(const PointZ& 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 AbstractPoint
129  * Methods re-implemeneted from AbstractPoint.
130  */
131  //@{
132 
133  /*!
134  \brief It returns the Point z-coordinate value.
135 
136  \return The z-coordinate value for this Point.
137  */
138  const double& getZ() const { return m_z; }
139 
140  /*!
141  \brief It sets the Point z-coordinate value.
142 
143  \param z The z-coordinate value for this Point.
144  */
145  void setZ(const double& z) { m_z = z; }
146 
147  //@}
148 
149  private:
150 
151  double m_z; //!< The Point z-coordinate value.
152  };
153 
154  } // end namespace gm
155 } // end namespace te
156 
157 #endif // __TERRALIB_GEOMETRY_INTERNAL_POINTZ_H
158 
159 
double m_z
The Point z-coordinate value.
Definition: PointZ.h:151
A point with x and y coordinate values.
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:79
A point with z-coordinate value.
Definition: PointZ.h:51
A point with x and y coordinate values.
Definition: Point.h:50
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
~PointZ()
Destructor.
Definition: PointZ.h:93
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
const double & getZ() const
It returns the Point z-coordinate value.
Definition: PointZ.h:138
void setZ(const double &z)
It sets the Point z-coordinate value.
Definition: PointZ.h:145