#8725-R: minor changes

This commit is contained in:
Alvaro Huarte 2014-01-15 08:40:43 +01:00 committed by Matthias Kuhn
parent 22c0c79422
commit 8fb87f1828
6 changed files with 15 additions and 3 deletions

View File

@ -29,6 +29,9 @@ class QgsSimplifyMethod
/** Gets the tolerance of simplification */
double tolerance() const;
/** Returns the optimal tolerance for Douglas-Peucker simplification algorithms */
double toleranceForDouglasPeuckerAlgorithms() const;
/** Sets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries */
void setForceLocalOptimization( bool localOptimization );
/** Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries */

View File

@ -53,6 +53,12 @@ void QgsSimplifyMethod::setForceLocalOptimization( bool localOptimization )
{
mForceLocalOptimization = localOptimization;
}
double QgsSimplifyMethod::toleranceForDouglasPeuckerAlgorithms() const
{
//TODO: define more precise value, now, it is experimental but conservative
return mTolerance / 5.0;
}
QgsAbstractGeometrySimplifier* QgsSimplifyMethod::createGeometrySimplifier( const QgsSimplifyMethod& simplifyMethod )
{

View File

@ -48,6 +48,9 @@ class CORE_EXPORT QgsSimplifyMethod
//! Gets the tolerance of simplification
inline double tolerance() const { return mTolerance; }
//! Returns the optimal tolerance for Douglas-Peucker simplification algorithms
double toleranceForDouglasPeuckerAlgorithms() const;
//! Sets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries
void setForceLocalOptimization( bool localOptimization );
//! Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries

View File

@ -309,7 +309,7 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause )
double tolerance = simplifyMethod.methodType() == QgsSimplifyMethod::OptimizeForRendering
?
simplifyMethod.tolerance() / 5.0f /* experimental */
simplifyMethod.toleranceForDouglasPeuckerAlgorithms()
:
simplifyMethod.tolerance();

View File

@ -1755,7 +1755,7 @@
<item row="2" column="1" colspan="4">
<widget class="QCheckBox" name="mSimplifyDrawingAtProvider">
<property name="text">
<string>Runs on provider side, otherwise it will execute once obtained the geometry from data source</string>
<string>Simplify on provider side if possible</string>
</property>
</widget>
</item>

View File

@ -1014,7 +1014,7 @@
<item row="2" column="1" colspan="4">
<widget class="QCheckBox" name="mSimplifyDrawingAtProvider">
<property name="text">
<string>Runs on provider side, otherwise it will execute once obtained the geometry from data source</string>
<string>Simplify on provider side if possible</string>
</property>
</widget>
</item>