QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
qgs3daxissettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgs3daxissettings.h
3 --------------------------------------
4 Date : April 2022
5 copyright : (C) 2021 B. De Mezzo
6 email : benoit dot de dot mezzo at oslandia 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 QGS3DAXISSETTINGS_H
17#define QGS3DAXISSETTINGS_H
18
19#include <QString>
20#include <QMap>
21
22#include "qgis_3d.h"
23
25class QDomElement;
26
27#define SIP_NO_FILE
28
35class _3D_EXPORT Qgs3DAxisSettings
36{
37 public:
38
42 enum class Mode
43 {
44 Off = 1,
45 Crs = 2,
46 Cube = 3,
47 };
48
50 Qgs3DAxisSettings() = default;
51
53 bool operator==( Qgs3DAxisSettings const &rhs ) const;
54
56 bool operator!=( Qgs3DAxisSettings const &rhs ) const;
57
59 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
61 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
62
64 int defaultViewportSize() const { return mDefaultViewportSize;}
66 void setDefaultViewportSize( int size ) { mDefaultViewportSize = size; }
67
69 double minViewportRatio() const { return mMinViewportRatio;}
71 void setMinViewportRatio( double ratio );
72
74 double maxViewportRatio() const { return mMaxViewportRatio;}
76 void setMaxViewportRatio( double ratio );
77
79 Qgs3DAxisSettings::Mode mode() const { return mMode; }
81 void setMode( Qgs3DAxisSettings::Mode type ) { mMode = type; }
82
84 Qt::AnchorPoint horizontalPosition() const { return mHorizontalPosition; }
86 void setHorizontalPosition( Qt::AnchorPoint position ) { mHorizontalPosition = position; }
87
89 Qt::AnchorPoint verticalPosition() const { return mVerticalPosition; }
91 void setVerticalPosition( Qt::AnchorPoint position ) { mVerticalPosition = position; }
92
93 private:
94 double mMinViewportRatio = 0.06;
95 double mMaxViewportRatio = 0.5;
96 int mDefaultViewportSize = 40;
98 Qt::AnchorPoint mHorizontalPosition = Qt::AnchorPoint::AnchorRight;
99 Qt::AnchorPoint mVerticalPosition = Qt::AnchorPoint::AnchorTop;
100
101};
102
103#endif // QGS3DAXISSETTINGS_H
Contains the configuration of a 3d axis.
double minViewportRatio() const
Returns the minimal axis viewport ratio (see Qt3DRender::QViewport::normalizedRect())
void setMode(Qgs3DAxisSettings::Mode type)
Sets the type of the 3daxis.
Qgs3DAxisSettings()=default
default constructor
double maxViewportRatio() const
Returns the maximal axis viewport ratio (see Qt3DRender::QViewport::normalizedRect())
Mode
Axis representation enum.
@ Crs
Respect CRS directions.
void setDefaultViewportSize(int size)
Sets the defaultl axis viewport size in millimeters.
Qt::AnchorPoint verticalPosition() const
Returns the vertical position for the 3d axis.
void setHorizontalPosition(Qt::AnchorPoint position)
Sets the horizontal position for the 3d axis.
int defaultViewportSize() const
Returns the default axis viewport size in millimeters.
Qgs3DAxisSettings::Mode mode() const
Returns the type of the 3daxis.
Qt::AnchorPoint horizontalPosition() const
Returns the horizontal position for the 3d axis.
void setVerticalPosition(Qt::AnchorPoint position)
Sets the vertical position for the 3d axis.
The class is used as a container of context for various read/write operations on other objects.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)