QGIS API Documentation  2.12.0-Lyon
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 );
40  bool operator!=( const Point3D& p );
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
57 inline Point3D::Point3D() : mX( 0 ), mY( 0 ), mZ( 0 )
58 {
59
60 }
61
62 inline Point3D::Point3D( double x, double y, double z ) : mX( x ), mY( y ), mZ( z )
63 {
64
65 }
66
67 inline Point3D::Point3D( const Point3D& p ): mX( p.mX ), mY( p.mY ), mZ( p.mZ )
68 {
69
70 }
71
73 {
74
75 }
76
77 inline double Point3D::getX() const
78 {
79  return mX;
80 }
81
82 inline double Point3D::getY() const
83 {
84  return mY;
85 }
86
87 inline double Point3D::getZ() const
88 {
89  return mZ;
90 }
91
92 inline void Point3D::setX( double x )
93 {
94  mX = x;
95 }
96
97 inline void Point3D::setY( double y )
98 {
99  mY = y;
100 }
101
102 inline void Point3D::setZ( double z )
103 {
104  mZ = z;
105 }
106
107 #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:72
double mY
Y-coordinate.
Definition: Point3D.h:29
double getY() const
Returns the y-coordinate of the point.
Definition: Point3D.h:82
double getZ() const
Returns the z-coordinate of the point.
Definition: Point3D.h:87
void setZ(double z)
Sets the z-coordinate of the point.
Definition: Point3D.h:102
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:77
void setX(double x)
Sets the x-coordinate of the point.
Definition: Point3D.h:92
Point3D()
Definition: Point3D.h:57
void setY(double y)
Sets the y-coordinate of the point.
Definition: Point3D.h:97