Techdraw: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -180,7 +180,7 @@ void TaskSectionView::setUiEdit()
|
||||
Base::Vector3d projectedViewDirection = m_base->projectPoint(sectionNormalVec, false);
|
||||
projectedViewDirection.Normalize();
|
||||
double viewAngle = atan2(-projectedViewDirection.y, -projectedViewDirection.x);
|
||||
m_compass->setDialAngle(viewAngle * 180.0 / M_PI);
|
||||
m_compass->setDialAngle(viewAngle * 180.0 / std::numbers::pi);
|
||||
m_viewDirectionWidget->setValueNoNotify(sectionNormalVec * -1.0);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ void TaskSectionView::slotViewDirectionChanged(Base::Vector3d newDirection)
|
||||
Base::Vector3d projectedViewDirection = m_base->projectPoint(newDirection, false);
|
||||
projectedViewDirection.Normalize();
|
||||
double viewAngle = atan2(projectedViewDirection.y, projectedViewDirection.x);
|
||||
m_compass->setDialAngle(viewAngle * 180.0 / M_PI);
|
||||
m_compass->setDialAngle(viewAngle * 180.0 / std::numbers::pi);
|
||||
checkAll(false);
|
||||
directionChanged(true);
|
||||
applyAligned();
|
||||
@@ -281,7 +281,7 @@ void TaskSectionView::slotViewDirectionChanged(Base::Vector3d newDirection)
|
||||
//the CompassWidget reports that the view direction angle has changed
|
||||
void TaskSectionView::slotChangeAngle(double newAngle)
|
||||
{
|
||||
double angleRadians = newAngle * M_PI / 180.0;
|
||||
double angleRadians = newAngle * std::numbers::pi / 180.0;
|
||||
double unitX = cos(angleRadians);
|
||||
double unitY = sin(angleRadians);
|
||||
Base::Vector3d localUnit(unitX, unitY, 0.0);
|
||||
|
||||
Reference in New Issue
Block a user