QGIS API Documentation  2.99.0-Master (b8fd1fd)
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 #include "qgis_analysis.h"
22 
25 class ANALYSIS_EXPORT Point3D
26 {
27  protected:
29  double mX;
31  double mY;
33  double mZ;
34  public:
35  Point3D();
37  Point3D( double x, double y, double z );
38  Point3D( 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 
78 inline double Point3D::getX() const
79 {
80  return mX;
81 }
82 
83 inline double Point3D::getY() const
84 {
85  return mY;
86 }
87 
88 inline double Point3D::getZ() const
89 {
90  return mZ;
91 }
92 
93 inline void Point3D::setX( double x )
94 {
95  mX = x;
96 }
97 
98 inline void Point3D::setY( double y )
99 {
100  mY = y;
101 }
102 
103 inline void Point3D::setZ( double z )
104 {
105  mZ = z;
106 }
107 
108 #endif
double mZ
Z-coordinate.
Definition: Point3D.h:33
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
double mY
Y-coordinate.
Definition: Point3D.h:31
double getZ() const
Returns the z-coordinate of the point.
Definition: Point3D.h:88
double getY() const
Returns the y-coordinate of the point.
Definition: Point3D.h:83
void setZ(double z)
Sets the z-coordinate of the point.
Definition: Point3D.h:103
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:25
double mX
X-coordinate.
Definition: Point3D.h:29
double getX() const
Returns the x-coordinate of the point.
Definition: Point3D.h:78
void setX(double x)
Sets the x-coordinate of the point.
Definition: Point3D.h:93
Point3D()
Definition: Point3D.h:57
void setY(double y)
Sets the y-coordinate of the point.
Definition: Point3D.h:98