2009-04-05 16:46:13 +00:00
|
|
|
|
|
|
|
class QgsTolerance
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgstolerance.h>
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2009-04-05 16:46:13 +00:00
|
|
|
/**Type of unit of tolerance value from settings*/
|
2012-09-24 02:28:15 +02:00
|
|
|
enum UnitType
|
|
|
|
{
|
2009-04-05 16:46:13 +00:00
|
|
|
/**Map unit value*/
|
|
|
|
MapUnits,
|
|
|
|
/**Pixels unit of tolerance*/
|
|
|
|
Pixels
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2009-04-13 10:55:56 +00:00
|
|
|
* Static function to get vertex tolerance value for a layer.
|
|
|
|
* The value is read from settings and transformed if necessary.
|
2009-04-05 16:46:13 +00:00
|
|
|
* @return value of vertex tolerance in map units
|
|
|
|
*/
|
2013-12-05 18:27:45 +07:00
|
|
|
static double vertexSearchRadius( QgsMapLayer* layer, const QgsMapSettings& mapSettings );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static function to get vertex tolerance value for a layer.
|
|
|
|
* The value is read from settings and transformed if necessary.
|
|
|
|
* @return value of vertex tolerance in map units
|
|
|
|
*/
|
2014-02-21 17:33:09 +07:00
|
|
|
//! @deprecated since 2.4 - use override with QgsMapSettings
|
2013-12-05 18:27:45 +07:00
|
|
|
static double vertexSearchRadius( QgsMapLayer* layer, QgsMapRenderer* renderer ) /Deprecated/;
|
2009-04-05 16:46:13 +00:00
|
|
|
|
|
|
|
/**
|
2009-04-13 10:55:56 +00:00
|
|
|
* Static function to get default tolerance value for a layer.
|
|
|
|
* The value is read from settings and transformed if necessary.
|
2009-04-05 16:46:13 +00:00
|
|
|
* @return value of default tolerance in map units
|
|
|
|
*/
|
2013-12-05 18:27:45 +07:00
|
|
|
static double defaultTolerance( QgsMapLayer* layer, const QgsMapSettings& mapSettings );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static function to get default tolerance value for a layer.
|
|
|
|
* The value is read from settings and transformed if necessary.
|
|
|
|
* @return value of default tolerance in map units
|
|
|
|
*/
|
2014-02-21 17:33:09 +07:00
|
|
|
//! @deprecated since 2.4 - use override with QgsMapSettings
|
2013-12-05 18:27:45 +07:00
|
|
|
static double defaultTolerance( QgsMapLayer* layer, QgsMapRenderer* renderer ) /Deprecated/;
|
2009-04-05 16:46:13 +00:00
|
|
|
|
2009-04-13 10:55:56 +00:00
|
|
|
/**
|
2009-04-05 16:46:13 +00:00
|
|
|
* Static function to translate tolerance value into current map unit value
|
2012-09-24 02:28:15 +02:00
|
|
|
* @param tolerance tolerance value to be translated
|
|
|
|
* @param layer reference layer
|
2013-12-05 18:27:45 +07:00
|
|
|
* @param mapSettings settings of the map
|
2009-04-05 16:46:13 +00:00
|
|
|
* @param units type of units to be translated
|
|
|
|
* @return value of tolerance in map units
|
|
|
|
*/
|
2013-12-05 18:27:45 +07:00
|
|
|
static double toleranceInMapUnits( double tolerance, QgsMapLayer* layer, const QgsMapSettings& mapSettings, UnitType units = MapUnits );
|
2009-04-05 16:46:13 +00:00
|
|
|
|
2013-12-05 18:27:45 +07:00
|
|
|
/**
|
|
|
|
* Static function to translate tolerance value into current map unit value
|
|
|
|
* @param tolerance tolerance value to be translated
|
|
|
|
* @param layer reference layer
|
|
|
|
* @param renderer renderer
|
|
|
|
* @param units type of units to be translated
|
|
|
|
* @return value of tolerance in map units
|
|
|
|
*/
|
2014-02-21 17:33:09 +07:00
|
|
|
//! @deprecated since 2.4 - use the override with QgsMapSettings
|
2013-12-05 18:27:45 +07:00
|
|
|
static double toleranceInMapUnits( double tolerance, QgsMapLayer* layer, QgsMapRenderer* renderer, UnitType units = MapUnits ) /Deprecated/;
|
2009-04-05 16:46:13 +00:00
|
|
|
};
|