QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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 *
10 * it under the terms of the GNU General Public License as published by *
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
30class 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
57 QVector3D directionInversed() const { return mDirectionInversed; }
58
63 void setOrigin( const QVector3D &origin );
64
70 void setDirection( const QVector3D direction );
71
76 QVector3D projectedPoint( const QVector3D &point ) const;
77
81 float projectedDistance( const QVector3D &point ) const;
82
84 bool isInFront( const QVector3D &point ) const;
86 double angleToPoint( const QVector3D &point ) const;
87
89 QVector3D point( float distance ) const;
90
91 private:
92 QVector3D mOrigin;
93 QVector3D mDirection;
94 QVector3D mDirectionInversed;
95};
96
97#endif // QGSRAY3D_H
QVector3D origin() const
Returns the origin of the ray.
Definition qgsray3d.h:44
QgsRay3D(const QVector3D &origin, const QVector3D &direction)
Constructor.
Definition qgsray3d.cpp:19
QVector3D direction() const
Returns the direction of the ray see setDirection().
Definition qgsray3d.h:50
QVector3D directionInversed() const
Returns a vector with the direction components inversed ( 1/x, 1/y, 1/z) This can be used as an optim...
Definition qgsray3d.h:57