QGIS API Documentation  2.99.0-Master (13a3f2f)
Public Member Functions | Public Attributes | List of all members
QgsMapUnitScale Class Reference

Struct for storing maximum and minimum scales for measurements in map units. More...

#include <qgsmapunitscale.h>

Public Member Functions

 QgsMapUnitScale (double minScale=0.0, double maxScale=0.0)
 Constructor for QgsMapUnitScale. More...
 
double computeMapUnitsPerPixel (const QgsRenderContext &c) const
 Computes a map units per pixel scaling factor, respecting the minimum and maximum scales set for the object. More...
 
bool operator!= (const QgsMapUnitScale &other) const
 
bool operator== (const QgsMapUnitScale &other) const
 

Public Attributes

double maxScale
 The maximum scale, or 0.0 if unset. More...
 
double maxSizeMM
 The maximum size in millimeters, or 0.0 if unset. More...
 
bool maxSizeMMEnabled
 Whether the maximum size in mm should be respected. More...
 
double minScale
 The minimum scale, or 0.0 if unset. More...
 
double minSizeMM
 The minimum size in millimeters, or 0.0 if unset. More...
 
bool minSizeMMEnabled
 Whether the minimum size in mm should be respected. More...
 

Detailed Description

Struct for storing maximum and minimum scales for measurements in map units.

For measurements in map units, a minimum and a maximum scale can be defined. Outside this range, the measurements aren't scaled anymore proportionally to the map scale.

Definition at line 36 of file qgsmapunitscale.h.

Constructor & Destructor Documentation

◆ QgsMapUnitScale()

QgsMapUnitScale::QgsMapUnitScale ( double  minScale = 0.0,
double  maxScale = 0.0 
)
inlineexplicit

Constructor for QgsMapUnitScale.

Parameters
minScaleminimum allowed scale, or 0.0 if no minimum scale set
maxScalemaximum allowed scale, or 0.0 if no maximum scale set

Definition at line 44 of file qgsmapunitscale.h.

Member Function Documentation

◆ computeMapUnitsPerPixel()

double QgsMapUnitScale::computeMapUnitsPerPixel ( const QgsRenderContext c) const

Computes a map units per pixel scaling factor, respecting the minimum and maximum scales set for the object.

Parameters
crender context
Returns
map units per pixel, limited between minimum and maximum scales

Definition at line 20 of file qgsmapunitscale.cpp.

◆ operator!=()

bool QgsMapUnitScale::operator!= ( const QgsMapUnitScale other) const
inline

Definition at line 84 of file qgsmapunitscale.h.

◆ operator==()

bool QgsMapUnitScale::operator== ( const QgsMapUnitScale other) const
inline

Definition at line 74 of file qgsmapunitscale.h.

Member Data Documentation

◆ maxScale

double QgsMapUnitScale::maxScale

The maximum scale, or 0.0 if unset.

Definition at line 56 of file qgsmapunitscale.h.

◆ maxSizeMM

double QgsMapUnitScale::maxSizeMM

The maximum size in millimeters, or 0.0 if unset.

Definition at line 65 of file qgsmapunitscale.h.

◆ maxSizeMMEnabled

bool QgsMapUnitScale::maxSizeMMEnabled

Whether the maximum size in mm should be respected.

Definition at line 63 of file qgsmapunitscale.h.

◆ minScale

double QgsMapUnitScale::minScale

The minimum scale, or 0.0 if unset.

Definition at line 54 of file qgsmapunitscale.h.

◆ minSizeMM

double QgsMapUnitScale::minSizeMM

The minimum size in millimeters, or 0.0 if unset.

Definition at line 61 of file qgsmapunitscale.h.

◆ minSizeMMEnabled

bool QgsMapUnitScale::minSizeMMEnabled

Whether the minimum size in mm should be respected.

Definition at line 59 of file qgsmapunitscale.h.


The documentation for this class was generated from the following files: