QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
analysis
interpolation
Vector3D.h
Go to the documentation of this file.
1
/***************************************************************************
2
Vector3D.h - description
3
-------------------
4
copyright : (C) 2004 by Marco Hugentobler
5
email : mhugent@geo.unizh.ch
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 VECTOR3D_H
18
#define VECTOR3D_H
19
20
#include <cmath>
21
22
#include "qgis_analysis.h"
23
24
#define SIP_NO_FILE
25
35
36
class
ANALYSIS_EXPORT
Vector3D
37
{
38
protected
:
40
double
mX
= 0;
42
double
mY
= 0;
44
double
mZ
= 0;
45
46
public
:
48
Vector3D
(
double
x,
double
y,
double
z );
49
50
Vector3D
() =
default
;
51
52
// TODO c++20 - replace with = default
53
bool
operator==
(
const
Vector3D
&v )
const
;
54
bool
operator!=
(
const
Vector3D
&v )
const
;
56
double
getX
()
const
;
58
double
getY
()
const
;
60
double
getZ
()
const
;
62
double
getLength
()
const
;
64
void
setX
(
double
x );
66
void
setY
(
double
y );
68
void
setZ
(
double
z );
70
void
standardise
();
71
72
private
:
73
#ifdef SIP_RUN
74
Vector3D
(
const
Vector3D
&v );
75
#endif
76
};
77
78
#ifndef SIP_RUN
79
80
//------------------------------------------constructors------------------------------------
81
82
inline
Vector3D::Vector3D
(
double
x,
double
y,
double
z )
83
:
mX
( x )
84
,
mY
( y )
85
,
mZ
( z )
86
{}
87
88
//-------------------------------------------setter and getters-------------------------------
89
90
inline
double
Vector3D::getX
()
const
91
{
92
return
mX
;
93
}
94
95
inline
double
Vector3D::getY
()
const
96
{
97
return
mY
;
98
}
99
100
inline
double
Vector3D::getZ
()
const
101
{
102
return
mZ
;
103
}
104
105
inline
void
Vector3D::setX
(
double
x )
106
{
107
mX
= x;
108
}
109
110
inline
void
Vector3D::setY
(
double
y )
111
{
112
mY
= y;
113
}
114
115
inline
void
Vector3D::setZ
(
double
z )
116
{
117
mZ
= z;
118
}
119
120
#endif
121
#endif
Vector3D::standardise
void standardise()
Standardises the vector.
Definition
Vector3D.cpp:24
Vector3D::mX
double mX
X-component of the vector.
Definition
Vector3D.h:40
Vector3D::setX
void setX(double x)
Sets the x-component of the vector.
Definition
Vector3D.h:105
Vector3D::getY
double getY() const
Returns the y-component of the vector.
Definition
Vector3D.h:95
Vector3D::mZ
double mZ
Z-component of the vector.
Definition
Vector3D.h:44
Vector3D::getX
double getX() const
Returns the x-component of the vector.
Definition
Vector3D.h:90
Vector3D::setY
void setY(double y)
Sets the y-component of the vector.
Definition
Vector3D.h:110
Vector3D::getZ
double getZ() const
Returns the z-component of the vector.
Definition
Vector3D.h:100
Vector3D::getLength
double getLength() const
Returns the length of the vector.
Definition
Vector3D.cpp:19
Vector3D::Vector3D
Vector3D(double x, double y, double z)
Constructor taking the three components as arguments.
Definition
Vector3D.h:82
Vector3D::mY
double mY
Y-component of the vector.
Definition
Vector3D.h:42
Vector3D::Vector3D
Vector3D()=default
Vector3D::setZ
void setZ(double z)
Sets the z-component of the vector.
Definition
Vector3D.h:115
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:427
operator!=
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:432
Generated on
for QGIS API Documentation by
1.17.0