Skip to content
Permalink
Browse files

Show curve point radius in infotool and fix bug in geometryutils

  • Loading branch information
mhugent committed May 27, 2016
1 parent 33977d1 commit 64e05ff69db017042079f18317d71f309110e5f6
Showing with 13 additions and 0 deletions.
  1. +1 −0 src/core/geometry/qgsgeometryutils.cpp
  2. +12 −0 src/gui/qgsmaptoolidentify.cpp
@@ -83,6 +83,7 @@ QgsPointV2 QgsGeometryUtils::closestVertex( const QgsAbstractGeometryV2& geom, c
id.part = vertexId.part;
id.ring = vertexId.ring;
id.vertex = vertexId.vertex;
id.type = vertexId.type;
}
}

@@ -310,6 +310,18 @@ void QgsMapToolIdentify::closestVertexAttributes( const QgsAbstractGeometryV2& g
str = QLocale::system().toString( closestPoint.m(), 'g', 10 );
derivedAttributes.insert( "Closest vertex M", str );
}

if ( vId.type == QgsVertexId::CurveVertex )
{
double radius, centerX, centerY;
QgsVertexId vIdBefore = vId;
--vIdBefore.vertex;
QgsVertexId vIdAfter = vId;
++vIdAfter.vertex;
QgsGeometryUtils::circleCenterRadius( geometry.vertexAt( vIdBefore ), geometry.vertexAt( vId ),
geometry.vertexAt( vIdAfter ), radius, centerX, centerY );
derivedAttributes.insert( "Closest vertex radius", QLocale::system().toString( radius ) );
}
}

QString QgsMapToolIdentify::formatCoordinate( const QgsPoint& canvasPoint ) const

0 comments on commit 64e05ff

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