New members in QgsVectorSimplifyMethod for QPaint simplification

This commit is contained in:
Alvaro Huarte 2016-02-23 08:07:30 +01:00
parent 89597f35f5
commit c4d7981678
6 changed files with 18 additions and 6 deletions

View File

@ -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.

View File

@ -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 */

View File

@ -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;

View File

@ -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

View File

@ -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 )
{

View File

@ -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 */