24
24
25
25
namespace QgsWms
26
26
{
27
+
28
+ /* *
29
+ * \ingroup server
30
+ * \class QgsWmsRenderContext
31
+ * \brief Rendering context for the WMS renderer
32
+ * \since QGIS 3.8
33
+ */
27
34
class QgsWmsRenderContext
28
35
{
29
36
public:
37
+ // ! Available rendering options
30
38
enum Flag
31
39
{
32
40
UseScaleDenominator = 0x01 ,
@@ -42,39 +50,102 @@ namespace QgsWms
42
50
};
43
51
Q_DECLARE_FLAGS ( Flags, Flag )
44
52
53
+ /* *
54
+ * Default constructor for QgsWmsRenderContext.
55
+ */
45
56
QgsWmsRenderContext () = default ;
46
57
58
+ /* *
59
+ * Constructor for QgsWmsRenderContext.
60
+ * \param project The project to use for the rendering
61
+ * \param interface The server interface
62
+ */
47
63
QgsWmsRenderContext ( const QgsProject *project, QgsServerInterface *interface );
48
64
65
+ /* *
66
+ * Sets WMS parameters.
67
+ */
49
68
void setParameters ( const QgsWmsParameters ¶meters );
50
69
70
+ /* *
71
+ * Returns WMS parameters.
72
+ */
51
73
QgsWmsParameters parameters () const ;
52
74
75
+ /* *
76
+ * Returns settings of the server.
77
+ */
53
78
const QgsServerSettings &settings () const ;
54
79
80
+ /* *
81
+ * Returns the project.
82
+ */
55
83
const QgsProject *project () const ;
56
84
85
+ /* *
86
+ * Sets or unsets a rendering flag according to the \a on value.
87
+ */
57
88
void setFlag ( Flag flag, bool on = true );
58
89
90
+ /* *
91
+ * Returns the status of a rendering flag.
92
+ * \param flag The flag to test
93
+ * \returns true if the rendering option is activated, false otherwise
94
+ */
59
95
bool testFlag ( Flag flag ) const ;
60
96
97
+ /* *
98
+ * Returns a list of all layers read from the project.
99
+ */
61
100
QList<QgsMapLayer *> layers () const ;
62
101
102
+ /* *
103
+ * Returns a list of all layers to actually render according to the
104
+ * current configuration.
105
+ */
63
106
QList<QgsMapLayer *> layersToRender () const ;
64
107
108
+ /* *
109
+ * Returns a SLD document for a specific layer. An empty document is
110
+ * returned if not available.
111
+ */
65
112
QDomElement sld ( const QgsMapLayer &layer ) const ;
66
113
114
+ /* *
115
+ * Returns a style's name for a specific layer. An empty string is
116
+ * returned if not available.
117
+ */
67
118
QString style ( const QgsMapLayer &layer ) const ;
68
119
120
+ /* *
121
+ * Returns the scale denominator to use for rendering according to the
122
+ * current configuration.
123
+ */
69
124
double scaleDenominator () const ;
70
125
126
+ /* *
127
+ * Sets a custom scale denominator. In this case, layers to render are
128
+ * updated according to their scale visibility.
129
+ */
71
130
void setScaleDenominator ( double scaleDenominator );
72
131
132
+ /* *
133
+ * Returns true if the extent has to be updated before the rendering,
134
+ * false otherwise.
135
+ */
73
136
bool updateExtent () const ;
74
137
138
+ /* *
139
+ * Returns WMS parameters for a specific layer. An empty instance is
140
+ * returned if not available.
141
+ */
75
142
QgsWmsParametersLayer parameters ( const QgsMapLayer &layer ) const ;
76
143
77
144
#ifdef HAVE_SERVER_PYTHON_PLUGINS
145
+
146
+ /* *
147
+ * Returns the access control interface.
148
+ */
78
149
QgsAccessControl *accessControl ();
79
150
#endif
80
151
0 commit comments