QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
qgscamerapose.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgscamerapose.h
3
--------------------------------------
4
Date : July 2018
5
Copyright : (C) 2018 by Martin Dobias
6
Email : wonder dot sk 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
16
#ifndef QGSCAMERAPOSE_H
17
#define QGSCAMERAPOSE_H
18
19
#include "qgis_3d.h"
20
#include "
qgsvector3d.h
"
21
22
#ifndef SIP_RUN
23
namespace
Qt3DRender
24
{
25
class
QCamera;
26
}
27
#endif
28
29
class
QDomDocument;
30
class
QDomElement;
31
45
class
_3D_EXPORT
QgsCameraPose
46
{
47
public
:
49
QgsVector3D
centerPoint
()
const
{
return
mCenterPoint; }
51
void
setCenterPoint(
const
QgsVector3D
&point );
52
54
float
distanceFromCenterPoint
()
const
{
return
mDistanceFromCenterPoint; }
56
void
setDistanceFromCenterPoint(
float
distance );
57
59
float
pitchAngle
()
const
{
return
mPitchAngle; }
61
void
setPitchAngle(
float
pitch );
62
64
float
headingAngle
()
const
{
return
mHeadingAngle; }
66
void
setHeadingAngle
(
float
heading ) { mHeadingAngle = heading; }
67
69
void
updateCamera( Qt3DRender::QCamera *camera )
SIP_SKIP
;
70
75
void
updateCameraGlobe( Qt3DRender::QCamera *camera,
double
lat,
double
lon )
SIP_SKIP
;
76
78
QDomElement writeXml( QDomDocument &doc )
const
;
80
void
readXml(
const
QDomElement &elem );
81
82
// TODO c++20 - replace with = default
83
bool
operator==
(
const
QgsCameraPose
&other )
const
84
{
85
return
mCenterPoint == other.mCenterPoint && mDistanceFromCenterPoint == other.mDistanceFromCenterPoint && mPitchAngle == other.mPitchAngle && mHeadingAngle == other.mHeadingAngle;
86
}
87
bool
operator!=
(
const
QgsCameraPose
&other )
const
{
return
!
operator==
( other ); }
88
89
private
:
91
QgsVector3D
mCenterPoint;
93
float
mDistanceFromCenterPoint = 1000;
95
// prevent bug in QgsCameraPose::updateCamera when updating camera rotation.
96
// With a mPitchAngle < 0.2 or > 179.8, QQuaternion::fromEulerAngles( mPitchAngle, mHeadingAngle, 0 )
97
// will return bad rotation angle.
98
// See https://bugreports.qt.io/browse/QTBUG-72103
99
float
mPitchAngle = 0.0f;
100
102
float
mHeadingAngle = 0;
103
};
104
105
106
#endif
// QGSCAMERAPOSE_H
QgsCameraPose
Encapsulates camera pose in a 3D scene.
Definition
qgscamerapose.h:46
QgsCameraPose::headingAngle
float headingAngle() const
Returns heading (yaw) angle in degrees.
Definition
qgscamerapose.h:64
QgsCameraPose::operator==
bool operator==(const QgsCameraPose &other) const
Definition
qgscamerapose.h:83
QgsCameraPose::centerPoint
QgsVector3D centerPoint() const
Returns center point (towards which point the camera is looking).
Definition
qgscamerapose.h:49
QgsCameraPose::pitchAngle
float pitchAngle() const
Returns pitch angle in degrees.
Definition
qgscamerapose.h:59
QgsCameraPose::operator!=
bool operator!=(const QgsCameraPose &other) const
Definition
qgscamerapose.h:87
QgsCameraPose::distanceFromCenterPoint
float distanceFromCenterPoint() const
Returns distance of the camera from the center point.
Definition
qgscamerapose.h:54
QgsCameraPose::setHeadingAngle
void setHeadingAngle(float heading)
Sets heading (yaw) angle in degrees.
Definition
qgscamerapose.h:66
QgsVector3D
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition
qgsvector3d.h:33
Qt3DRender
Definition
qgs3d.h:45
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:427
qgsvector3d.h
Generated on
for QGIS API Documentation by
1.17.0