QGIS API Documentation  2.15.0-Master (5f66276)
Point3D.h
Go to the documentation of this file.
1 /***************************************************************************
2  Point3D.h - description
3  -------------------
4  copyright : (C) 2004 by Marco Hugentobler
5  email : [email protected]
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef POINT3D_H
18 #define POINT3D_H
19 
20 #include <cmath>
21 
23 class ANALYSIS_EXPORT Point3D
24 {
25  protected:
27  double mX;
29  double mY;
31  double mZ;
32  public:
33  Point3D();
35  Point3D( double x, double y, double z );
36  Point3D( const Point3D& p );
37  ~Point3D();
38  Point3D& operator=( const Point3D& p );
39  bool operator==( const Point3D& p ) const;
40  bool operator!=( const Point3D& p ) const;
42  double dist3D( Point3D* p ) const;
44  double getX() const;
46  double getY() const;
48  double getZ() const;
50  void setX( double x );
52  void setY( double y );
54  void setZ( double z );
55 };
56 
58  : mX( 0 )
59  , mY( 0 )
60  , mZ( 0 )
61 {
62 
63 }
64 
65 inline Point3D::Point3D( double x, double y, double z )
66  : mX( x )
67  , mY( y )
68  , mZ( z )
69 {
70 
71 }
72 
73 inline Point3D::Point3D( const Point3D& p ): mX( p.mX ), mY( p.mY ), mZ( p.mZ )
74 {
75 
76 }
77 
79 {
80 
81 }
82 
83 inline double Point3D::getX() const
84 {
85  return mX;
86 }
87 
88 inline double Point3D::getY() const
89 {
90  return mY;
91 }
92 
93 inline double Point3D::getZ() const
94 {
95  return mZ;
96 }
97 
98 inline void Point3D::setX( double x )
99 {
100  mX = x;
101 }
102 
103 inline void Point3D::setY( double y )
104 {
105  mY = y;
106 }
107 
108 inline void Point3D::setZ( double z )
109 {
110  mZ = z;
111 }
112 
113 #endif
double mZ
Z-coordinate.
Definition: Point3D.h:31
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
~Point3D()
Definition: Point3D.h:78
double mY
Y-coordinate.
Definition: Point3D.h:29
double getY() const
Returns the y-coordinate of the point.
Definition: Point3D.h:88
double getZ() const
Returns the z-coordinate of the point.
Definition: Point3D.h:93
void setZ(double z)
Sets the z-coordinate of the point.
Definition: Point3D.h:108
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:23
double mX
X-coordinate.
Definition: Point3D.h:27
double getX() const
Returns the x-coordinate of the point.
Definition: Point3D.h:83
void setX(double x)
Sets the x-coordinate of the point.
Definition: Point3D.h:98
Point3D()
Definition: Point3D.h:57
void setY(double y)
Sets the y-coordinate of the point.
Definition: Point3D.h:103