QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
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:
38
42 enum class Mode
43 {
44 Off = 1,
45 Crs = 2,
46 Cube = 3,
47 };
48
49 Qgs3DAxisSettings() = default;
50
51 bool operator==( Qgs3DAxisSettings const &rhs ) const;
52 bool operator!=( Qgs3DAxisSettings const &rhs ) const;
53
55 void readXml( const QDomElement &element, const QgsReadWriteContext &context );
57 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const;
58
60 int defaultViewportSize() const { return mDefaultViewportSize;}
62 void setDefaultViewportSize( int size ) { mDefaultViewportSize = size; }
63
65 double minViewportRatio() const { return mMinViewportRatio;}
67 void setMinViewportRatio( double ratio );
68
70 double maxViewportRatio() const { return mMaxViewportRatio;}
72 void setMaxViewportRatio( double ratio );
73
75 Qgs3DAxisSettings::Mode mode() const { return mMode; }
77 void setMode( Qgs3DAxisSettings::Mode type ) { mMode = type; }
78
80 Qt::AnchorPoint horizontalPosition() const { return mHorizontalPosition; }
82 void setHorizontalPosition( Qt::AnchorPoint position ) { mHorizontalPosition = position; }
83
85 Qt::AnchorPoint verticalPosition() const { return mVerticalPosition; }
87 void setVerticalPosition( Qt::AnchorPoint position ) { mVerticalPosition = position; }
88
89 private:
90 double mMinViewportRatio = 0.06;
91 double mMaxViewportRatio = 0.5;
92 int mDefaultViewportSize = 40;
94 Qt::AnchorPoint mHorizontalPosition = Qt::AnchorPoint::AnchorRight;
95 Qt::AnchorPoint mVerticalPosition = Qt::AnchorPoint::AnchorTop;
96
97};
98
99#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)