QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
24 class ANALYSIS_EXPORT Point3D
25 {
26  protected:
28  double mX;
30  double mY;
32  double mZ;
33  public:
34  Point3D();
36  Point3D( double x, double y, double z );
37  Point3D( const Point3D& p );
38  ~Point3D();
39  Point3D& operator=( const Point3D& p );
40  bool operator==( const Point3D& p ) const;
41  bool operator!=( const Point3D& p ) const;
43  double dist3D( Point3D* p ) const;
45  double getX() const;
47  double getY() const;
49  double getZ() const;
51  void setX( double x );
53  void setY( double y );
55  void setZ( double z );
56 };
57 
59  : mX( 0 )
60  , mY( 0 )
61  , mZ( 0 )
62 {
63 
64 }
65 
66 inline Point3D::Point3D( double x, double y, double z )
67  : mX( x )
68  , mY( y )
69  , mZ( z )
70 {
71 
72 }
73 
74 inline Point3D::Point3D( const Point3D& p ): mX( p.mX ), mY( p.mY ), mZ( p.mZ )
75 {
76 
77 }
78 
80 {
81 
82 }
83 
84 inline double Point3D::getX() const
85 {
86  return mX;
87 }
88 
89 inline double Point3D::getY() const
90 {
91  return mY;
92 }
93 
94 inline double Point3D::getZ() const
95 {
96  return mZ;
97 }
98 
99 inline void Point3D::setX( double x )
100 {
101  mX = x;
102 }
103 
104 inline void Point3D::setY( double y )
105 {
106  mY = y;
107 }
108 
109 inline void Point3D::setZ( double z )
110 {
111  mZ = z;
112 }
113 
114 #endif
double mZ
Z-coordinate.
Definition: Point3D.h:32
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
~Point3D()
Definition: Point3D.h:79
double mY
Y-coordinate.
Definition: Point3D.h:30
double getZ() const
Returns the z-coordinate of the point.
Definition: Point3D.h:94
double getY() const
Returns the y-coordinate of the point.
Definition: Point3D.h:89
void setZ(double z)
Sets the z-coordinate of the point.
Definition: Point3D.h:109
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:24
double mX
X-coordinate.
Definition: Point3D.h:28
double getX() const
Returns the x-coordinate of the point.
Definition: Point3D.h:84
void setX(double x)
Sets the x-coordinate of the point.
Definition: Point3D.h:99
Point3D()
Definition: Point3D.h:58
void setY(double y)
Sets the y-coordinate of the point.
Definition: Point3D.h:104