Skip to content
Permalink
Browse files

Take into account z dimension from center points

  • Loading branch information
pblottiere committed Feb 16, 2018
1 parent 12392f7 commit d91bd457497065ef04cda3656c62995992796158
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/core/geometry/qgscircle.cpp
  2. +2 −2 src/core/geometry/qgsellipse.cpp
@@ -183,7 +183,7 @@ QgsCircle QgsCircle::fromCenterPoint( const QgsPoint &center, const QgsPoint &pt
double azimuth = QgsGeometryUtils::lineAngle( center.x(), center.y(), pt1.x(), pt1.y() ) * 180.0 / M_PI;

QgsPoint centerPt( center );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1, centerPt );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1, centerPt );

return QgsCircle( centerPt, centerPt.distance( pt1 ), azimuth );
}
@@ -81,7 +81,7 @@ QgsEllipse QgsEllipse::fromCenterPoint( const QgsPoint &center, const QgsPoint &
double azimuth = 90.0;

QgsPoint centerPt( center );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1, centerPt );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1, centerPt );

return QgsEllipse( centerPt, axis_a, axis_b, azimuth );
}
@@ -96,7 +96,7 @@ QgsEllipse QgsEllipse::fromCenter2Points( const QgsPoint &center, const QgsPoint
double axis_b = center.distance( pp );

QgsPoint centerPt( center );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << pt1 << pt2, centerPt );
QgsGeometryUtils::setZValueFromPoints( QgsPointSequence() << center << pt1 << pt2, centerPt );

return QgsEllipse( centerPt, axis_a, axis_b, azimuth );
}

0 comments on commit d91bd45

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