QGIS API Documentation  3.21.0-Master (56b4176581)
qgsray3d.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsray3d.h
3  --------------------------------------
4  Date : January 2021
5  Copyright : (C) 2021 by Belgacem Nedjima
6  Email : belgacem dot nedjima at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSRAY3D_H
16 #define QGSRAY3D_H
17
18 #include "qgsbox3d.h"
19
20 #include <QVector3D>
21
30 class CORE_EXPORT QgsRay3D
31 {
32  public:
33
38  QgsRay3D( const QVector3D &origin, const QVector3D &direction );
39
44  QVector3D origin() const { return mOrigin; }
45
50  QVector3D direction() const { return mDirection; }
51
56  void setOrigin( const QVector3D &origin );
57
63  void setDirection( const QVector3D direction );
64
69  QVector3D projectedPoint( const QVector3D &point ) const;
71  bool isInFront( const QVector3D &point ) const;
73  double angleToPoint( const QVector3D &point ) const;
74
75  private:
76  QVector3D mOrigin;
77  QVector3D mDirection;
78 };
79
80 #endif // QGSRAY3D_H
A representation of a ray in 3D.
Definition: qgsray3d.h:31
QVector3D origin() const
Returns the origin of the ray.
Definition: qgsray3d.h:44
QVector3D direction() const
Returns the direction of the ray see setDirection()
Definition: qgsray3d.h:50