QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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:
41 enum class Mode
42 {
43 Off = 1,
44 Crs = 2,
45 Cube = 3,
46 };
47
48 Qgs3DAxisSettings() = default;
49
50 bool operator==( Qgs3DAxisSettings const &rhs ) const;
51 bool operator!=( Qgs3DAxisSettings const &rhs ) const;
52
54 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
56 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
57
59 int defaultViewportSize() const { return mDefaultViewportSize; }
61 void setDefaultViewportSize( int size ) { mDefaultViewportSize = size; }
62
64 double minViewportRatio() const { return mMinViewportRatio; }
66 void setMinViewportRatio( double ratio );
67
69 double maxViewportRatio() const { return mMaxViewportRatio; }
71 void setMaxViewportRatio( double ratio );
72
74 Qgs3DAxisSettings::Mode mode() const { return mMode; }
76 void setMode( Qgs3DAxisSettings::Mode type ) { mMode = type; }
77
79 Qt::AnchorPoint horizontalPosition() const { return mHorizontalPosition; }
81 void setHorizontalPosition( Qt::AnchorPoint position ) { mHorizontalPosition = position; }
82
84 Qt::AnchorPoint verticalPosition() const { return mVerticalPosition; }
86 void setVerticalPosition( Qt::AnchorPoint position ) { mVerticalPosition = position; }
87
88 private:
89 double mMinViewportRatio = 0.06;
90 double mMaxViewportRatio = 0.5;
91 int mDefaultViewportSize = 40;
93 Qt::AnchorPoint mHorizontalPosition = Qt::AnchorPoint::AnchorRight;
94 Qt::AnchorPoint mVerticalPosition = Qt::AnchorPoint::AnchorTop;
95};
96
97#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
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)