Skip to content

Commit

Permalink
[TD]fix compile error on Win re M_PI
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jan 10, 2020
1 parent 8d1e1e4 commit 49e4e45
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
23 changes: 22 additions & 1 deletion src/Mod/TechDraw/Gui/QGIViewDimension.cpp
Expand Up @@ -21,6 +21,12 @@
***************************************************************************/

#include "PreCompiled.h"

#ifdef FC_OS_WIN32
#define _USE_MATH_DEFINES //re Windows & M_PI issues
#endif
#include <cmath>

#ifndef _PreComp_
#include <BRep_Builder.hxx>
#include <TopoDS_Compound.hxx>
Expand All @@ -36,7 +42,6 @@
# include <QPaintDevice>
# include <QSvgGenerator>

# include <cmath>
#endif

#include <App/Application.h>
Expand Down Expand Up @@ -2271,4 +2276,20 @@ void QGIViewDimension::setPens(void)
aHead2->setWidth(m_lineWidth);
}

double QGIViewDimension::toDeg(double a)
{
return a*180/M_PI;
}

double QGIViewDimension::toQtRad(double a)
{
return -a;
}

double QGIViewDimension::toQtDeg(double a)
{
return -a*180.0/M_PI;
}


#include <Mod/TechDraw/Gui/moc_QGIViewDimension.cpp>
6 changes: 3 additions & 3 deletions src/Mod/TechDraw/Gui/QGIViewDimension.h
Expand Up @@ -271,9 +271,9 @@ public Q_SLOTS:
{ return QRectF(Rez::guiX(r.MinX), -Rez::guiX(r.MaxY),
Rez::guiX(r.Width()), Rez::guiX(r.Height())); }

static inline double toDeg(double a) { return a*180/M_PI; }
static inline double toQtRad(double a) { return -a; }
static inline double toQtDeg(double a) { return -a*180.0/M_PI; }
static double toDeg(double a);
static double toQtRad(double a);
static double toQtDeg(double a);

double getDefaultExtensionLineOverhang() const;
double getDefaultArrowTailLength() const;
Expand Down

0 comments on commit 49e4e45

Please sign in to comment.