mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
New members in QgsVectorSimplifyMethod for QPaint simplification
This commit is contained in:
parent
89597f35f5
commit
c4d7981678
@ -26,7 +26,7 @@ class QgsSimplifyMethod
|
||||
|
||||
//! Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.
|
||||
void setTolerance( double tolerance );
|
||||
//! Gets the tolerance of simplification in map units . Represents the maximum distance in map units between two coordinates which can be considered equal.
|
||||
//! Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.
|
||||
double tolerance() const;
|
||||
|
||||
//! Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal.
|
||||
|
@ -29,6 +29,11 @@ class QgsVectorSimplifyMethod
|
||||
/** Gets the simplification hints of the vector layer managed */
|
||||
QFlags<QgsVectorSimplifyMethod::SimplifyHint> simplifyHints() const;
|
||||
|
||||
/** Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal */
|
||||
void setTolerance( double tolerance );
|
||||
/** Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal */
|
||||
double tolerance() const;
|
||||
|
||||
/** Sets the simplification threshold of the vector layer managed */
|
||||
void setThreshold( float threshold );
|
||||
/** Gets the simplification threshold of the vector layer managed */
|
||||
|
@ -42,7 +42,7 @@ class CORE_EXPORT QgsSimplifyMethod
|
||||
|
||||
//! Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.
|
||||
void setTolerance( double tolerance );
|
||||
//! Gets the tolerance of simplification in map units . Represents the maximum distance in map units between two coordinates which can be considered equal.
|
||||
//! Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal.
|
||||
inline double tolerance() const { return mTolerance; }
|
||||
|
||||
//! Sets the simplification threshold in pixels. Represents the maximum distance in pixels between two coordinates which can be considered equal.
|
||||
@ -61,9 +61,9 @@ class CORE_EXPORT QgsSimplifyMethod
|
||||
protected:
|
||||
//! Simplification method
|
||||
MethodType mMethodType;
|
||||
//! Tolerance of simplification, it represents the maximum distance between two coordinates which can be considered equal
|
||||
//! Simplification tolerance, it represents the maximum distance between two coordinates which can be considered equal
|
||||
double mTolerance;
|
||||
/** Simplification threshold */
|
||||
//! Simplification threshold
|
||||
float mThreshold;
|
||||
//! Simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries
|
||||
bool mForceLocalOptimization;
|
||||
|
@ -224,12 +224,11 @@ bool QgsVectorLayerRenderer::render()
|
||||
simplifyMethod.setMethodType( QgsSimplifyMethod::OptimizeForRendering );
|
||||
simplifyMethod.setTolerance( map2pixelTol );
|
||||
simplifyMethod.setThreshold( mSimplifyMethod.threshold() );
|
||||
|
||||
simplifyMethod.setForceLocalOptimization( mSimplifyMethod.forceLocalOptimization() );
|
||||
|
||||
featureRequest.setSimplifyMethod( simplifyMethod );
|
||||
|
||||
QgsVectorSimplifyMethod vectorMethod = mSimplifyMethod;
|
||||
vectorMethod.setTolerance( map2pixelTol );
|
||||
mContext.setVectorSimplifyMethod( vectorMethod );
|
||||
}
|
||||
else
|
||||
|
@ -20,6 +20,7 @@
|
||||
QgsVectorSimplifyMethod::QgsVectorSimplifyMethod()
|
||||
: mSimplifyHints( QGis::DEFAULT_MAPTOPIXEL_THRESHOLD > 1 ? QgsVectorSimplifyMethod::FullSimplification : QgsVectorSimplifyMethod::GeometrySimplification )
|
||||
, mThreshold( QGis::DEFAULT_MAPTOPIXEL_THRESHOLD )
|
||||
, mTolerance( 1 )
|
||||
, mLocalOptimization( true )
|
||||
, mMaximumScale( 1 )
|
||||
{
|
||||
|
@ -42,6 +42,11 @@ class CORE_EXPORT QgsVectorSimplifyMethod
|
||||
/** Gets the simplification hints of the vector layer managed */
|
||||
inline SimplifyHints simplifyHints() const { return mSimplifyHints; }
|
||||
|
||||
/** Sets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal */
|
||||
void setTolerance( double tolerance ) { mTolerance = tolerance; }
|
||||
/** Gets the tolerance of simplification in map units. Represents the maximum distance in map units between two coordinates which can be considered equal */
|
||||
inline double tolerance() const { return mTolerance; }
|
||||
|
||||
/** Sets the simplification threshold of the vector layer managed */
|
||||
void setThreshold( float threshold ) { mThreshold = threshold; }
|
||||
/** Gets the simplification threshold of the vector layer managed */
|
||||
@ -60,6 +65,8 @@ class CORE_EXPORT QgsVectorSimplifyMethod
|
||||
private:
|
||||
/** Simplification hints for fast rendering of features of the vector layer managed */
|
||||
SimplifyHints mSimplifyHints;
|
||||
/** Simplification tolerance, it represents the maximum distance between two coordinates which can be considered equal */
|
||||
double mTolerance;
|
||||
/** Simplification threshold */
|
||||
float mThreshold;
|
||||
/** Simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries */
|
||||
|
Loading…
x
Reference in New Issue
Block a user