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 d91bd45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
@@ -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.