Skip to content
Permalink
Browse files

New members in QgsVectorSimplifyMethod for QPaint simplification

  • Loading branch information
ahuarte47 committed Feb 23, 2016
1 parent 89597f3 commit c4d7981678c04a512f5c3bb189d773f4c3f49ead
@@ -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 */

0 comments on commit c4d7981

Please sign in to comment.
You can’t perform that action at this time.