Skip to content

Commit 389076f

Browse files
committed
Add doc for QgsWmsRenderContext
1 parent dcd43dc commit 389076f

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

src/server/services/wms/qgswmsrendercontext.h

+71
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@
2424

2525
namespace QgsWms
2626
{
27+
28+
/**
29+
* \ingroup server
30+
* \class QgsWmsRenderContext
31+
* \brief Rendering context for the WMS renderer
32+
* \since QGIS 3.8
33+
*/
2734
class QgsWmsRenderContext
2835
{
2936
public:
37+
//! Available rendering options
3038
enum Flag
3139
{
3240
UseScaleDenominator = 0x01,
@@ -42,39 +50,102 @@ namespace QgsWms
4250
};
4351
Q_DECLARE_FLAGS( Flags, Flag )
4452

53+
/**
54+
* Default constructor for QgsWmsRenderContext.
55+
*/
4556
QgsWmsRenderContext() = default;
4657

58+
/**
59+
* Constructor for QgsWmsRenderContext.
60+
* \param project The project to use for the rendering
61+
* \param interface The server interface
62+
*/
4763
QgsWmsRenderContext( const QgsProject *project, QgsServerInterface *interface );
4864

65+
/**
66+
* Sets WMS parameters.
67+
*/
4968
void setParameters( const QgsWmsParameters &parameters );
5069

70+
/**
71+
* Returns WMS parameters.
72+
*/
5173
QgsWmsParameters parameters() const;
5274

75+
/**
76+
* Returns settings of the server.
77+
*/
5378
const QgsServerSettings &settings() const;
5479

80+
/**
81+
* Returns the project.
82+
*/
5583
const QgsProject *project() const;
5684

85+
/**
86+
* Sets or unsets a rendering flag according to the \a on value.
87+
*/
5788
void setFlag( Flag flag, bool on = true );
5889

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+
*/
5995
bool testFlag( Flag flag ) const;
6096

97+
/**
98+
* Returns a list of all layers read from the project.
99+
*/
61100
QList<QgsMapLayer *> layers() const;
62101

102+
/**
103+
* Returns a list of all layers to actually render according to the
104+
* current configuration.
105+
*/
63106
QList<QgsMapLayer *> layersToRender() const;
64107

108+
/**
109+
* Returns a SLD document for a specific layer. An empty document is
110+
* returned if not available.
111+
*/
65112
QDomElement sld( const QgsMapLayer &layer ) const;
66113

114+
/**
115+
* Returns a style's name for a specific layer. An empty string is
116+
* returned if not available.
117+
*/
67118
QString style( const QgsMapLayer &layer ) const;
68119

120+
/**
121+
* Returns the scale denominator to use for rendering according to the
122+
* current configuration.
123+
*/
69124
double scaleDenominator() const;
70125

126+
/**
127+
* Sets a custom scale denominator. In this case, layers to render are
128+
* updated according to their scale visibility.
129+
*/
71130
void setScaleDenominator( double scaleDenominator );
72131

132+
/**
133+
* Returns true if the extent has to be updated before the rendering,
134+
* false otherwise.
135+
*/
73136
bool updateExtent() const;
74137

138+
/**
139+
* Returns WMS parameters for a specific layer. An empty instance is
140+
* returned if not available.
141+
*/
75142
QgsWmsParametersLayer parameters( const QgsMapLayer &layer ) const;
76143

77144
#ifdef HAVE_SERVER_PYTHON_PLUGINS
145+
146+
/**
147+
* Returns the access control interface.
148+
*/
78149
QgsAccessControl *accessControl();
79150
#endif
80151

0 commit comments

Comments
 (0)