All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PointKd.cpp
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/PointKd.cpp
22 
23  \brief A k-dimensional point.
24 */
25 
26 // TerraLib
27 #include "PointKd.h"
28 
29 te::gm::PointKd::PointKd(unsigned int k, int srid, Envelope* mbr)
30  : AbstractPoint(PointKdType, srid, mbr),
31  m_coords(k)
32 {
33 }
34 
36  : AbstractPoint(rhs),
37  m_coords(rhs.m_coords)
38 {
39 }
40 
42 {
43  if(this != &rhs)
44  {
46 
47  m_coords = rhs.m_coords;
48  }
49 
50  return *this;
51 }
52 
54 {
55  return new PointKd(*this);
56 }
57 
58 const double& te::gm::PointKd::getX() const
59 {
60  return m_coords[0];
61 }
62 
63 void te::gm::PointKd::setX(const double& x)
64 {
65  m_coords[0] = x;
66 }
67 
68 const double& te::gm::PointKd::getY() const
69 {
70  return m_coords[1];
71 }
72 
73 void te::gm::PointKd::setY(const double& y)
74 {
75  m_coords[1] = y;
76 }
77 
78 const double& te::gm::PointKd::getZ() const
79 {
80  return m_coords[2];
81 }
82 
83 void te::gm::PointKd::setZ(const double& z)
84 {
85  m_coords[2] = z;
86 }
87 
88 const double& te::gm::PointKd::getM() const
89 {
90  return sm_notNumber;
91 }
92 
93 void te::gm::PointKd::setM(const double& /*m*/)
94 {
95 }
96 
PointKd & operator=(const PointKd &rhs)
Assignment operator.
Definition: PointKd.cpp:41
const double & getX() const
It returns the point x-coordinate value.
Definition: PointKd.cpp:58
void setZ(const double &z)
It sets the point z-coordinate value.
Definition: PointKd.cpp:83
std::vector< double > m_coords
The array of coordinates.
Definition: PointKd.h:199
A k-dimensional point.
Definition: PointKd.h:53
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
virtual AbstractPoint & operator=(const AbstractPoint &rhs)
Assignment operator.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
const double & getM() const
It returns TE_DOUBLE_NOT_A_NUMBER.
Definition: PointKd.cpp:88
void setX(const double &x)
It sets the point x-coordinate value.
Definition: PointKd.cpp:63
void setM(const double &m)
It doesn't perform any operation in a Kd point.
Definition: PointKd.cpp:93
TE_DEFINE_VISITABLE PointKd(unsigned int k, int srid=0, Envelope *mbr=0)
it constructs a new point with k-dimension.
Definition: PointKd.cpp:29
void setY(const double &y)
It sets the point y-coordinate value.
Definition: PointKd.cpp:73
const double & getY() const
It returns the point y-coordinate value.
Definition: PointKd.cpp:68
te::dt::AbstractData * clone() const
It clones the point.
Definition: PointKd.cpp:53
A base abstract class for 0-dimensional geometric objects that represents a single location in coordi...
Definition: AbstractPoint.h:50
const double & getZ() const
It returns the point z-coordinate value, if it has one or TE_DOUBLE_NOT_A_NUMBER otherwise.
Definition: PointKd.cpp:78
A k-dimensional point.