QGIS API Documentation 3.27.0-Master (1c05421486)
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;
54 Qgs3DAxisSettings &operator=( Qgs3DAxisSettings const &rhs );
55
57 bool operator==( Qgs3DAxisSettings const &rhs ) const;
58
60 bool operator!=( Qgs3DAxisSettings const &rhs ) const;
61
63 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
65 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
66
68 int defaultViewportSize() const { return mDefaultViewportSize;}
70 void setDefaultViewportSize( int size ) { mDefaultViewportSize = size; }
71
73 double minViewportRatio() const { return mMinViewportRatio;}
75 void setMinViewportRatio( double ratio );
76
78 double maxViewportRatio() const { return mMaxViewportRatio;}
80 void setMaxViewportRatio( double ratio );
81
83 Qgs3DAxisSettings::Mode mode() const { return mMode; }
85 void setMode( Qgs3DAxisSettings::Mode type ) { mMode = type; }
86
88 Qt::AnchorPoint horizontalPosition() const { return mHorizontalPosition; }
90 void setHorizontalPosition( Qt::AnchorPoint position ) { mHorizontalPosition = position; }
91
93 Qt::AnchorPoint verticalPosition() const { return mVerticalPosition; }
95 void setVerticalPosition( Qt::AnchorPoint position ) { mVerticalPosition = position; }
96
97 private:
98 double mMinViewportRatio = 0.06;
99 double mMaxViewportRatio = 0.5;
100 int mDefaultViewportSize = 40;
102 Qt::AnchorPoint mHorizontalPosition = Qt::AnchorPoint::AnchorRight;
103 Qt::AnchorPoint mVerticalPosition = Qt::AnchorPoint::AnchorTop;
104
105};
106
107#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)