summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-10-01 09:44:35 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-10-01 09:44:35 (GMT)
commita10ba5ed81e43545b4398dbb09047389940517d9 (patch)
treeb90a6425e240b55a6cc3f2c57c7cbef4d0a02e47
parent4d0ae872e95efb865423d0f4b48b74686a938373 (diff)
Avoid polluting the global namespace with Eigen stuff.
-rw-r--r--kstars/auxiliary/ksutils.h11
-rw-r--r--kstars/ksnumbers.h12
2 files changed, 10 insertions, 13 deletions
diff --git a/kstars/auxiliary/ksutils.h b/kstars/auxiliary/ksutils.h
index f27a967..b75405a 100644
--- a/kstars/auxiliary/ksutils.h
+++ b/kstars/auxiliary/ksutils.h
@@ -29,7 +29,6 @@
#include <cstddef>
#include <Eigen/Core>
-using namespace Eigen;
#include <QPointF>
#include "dms.h"
#include "skyobjects/starobject.h"
@@ -80,22 +79,22 @@ namespace KSUtils {
/** Convert from spherical to cartesian coordiate system.
* Resulting vector have unit length
*/
- inline Vector3d fromSperical(dms longitude, dms latitude) {
+ inline Eigen::Vector3d fromSperical(dms longitude, dms latitude) {
double sinL, sinB;
double cosL, cosB;
longitude.SinCos( sinL, cosL );
latitude.SinCos( sinB, cosB );
- return Vector3d(cosB*cosL, cosB*sinL, sinB);
+ return Eigen::Vector3d(cosB*cosL, cosB*sinL, sinB);
}
/** Convert a vector to a point */
- inline QPointF vecToPoint(const Vector2f& vec) {
+ inline QPointF vecToPoint(const Eigen::Vector2f& vec) {
return QPointF( vec[0], vec[1] );
}
/** Convert a point to a vector */
- inline Vector2f pointToVec(const QPointF& p) {
- return Vector2f(p.x(),p.y());
+ inline Eigen::Vector2f pointToVec(const QPointF& p) {
+ return Eigen::Vector2f(p.x(),p.y());
}
/**
diff --git a/kstars/ksnumbers.h b/kstars/ksnumbers.h
index aba30f4..5d3c74a 100644
--- a/kstars/ksnumbers.h
+++ b/kstars/ksnumbers.h
@@ -26,8 +26,6 @@
#include <Eigen/Dense>
-using Eigen::Matrix3d;
-
/** @class KSNumbers
*
*There are several time-dependent values used in position calculations,
@@ -112,10 +110,10 @@ public:
inline double p2b( int i1, int i2 ) const { return P2B(i1, i2); }
/** @return the precession matrix directly **/
- inline const Matrix3d &p2() const { return P1; }
- inline const Matrix3d &p1() const { return P2; }
- inline const Matrix3d &p1b() const { return P1B; }
- inline const Matrix3d &p2b() const { return P2B; }
+ inline const Eigen::Matrix3d &p2() const { return P1; }
+ inline const Eigen::Matrix3d &p1() const { return P2; }
+ inline const Eigen::Matrix3d &p1b() const { return P1B; }
+ inline const Eigen::Matrix3d &p2b() const { return P2B; }
/**
*@short compute constant values that need to be computed only once per instance of the application
@@ -140,7 +138,7 @@ private:
dms XP, YP, ZP, XB, YB, ZB;
double CX, SX, CY, SY, CZ, SZ;
double CXB, SXB, CYB, SYB, CZB, SZB;
- Matrix3d P1, P2, P1B, P2B;
+ Eigen::Matrix3d P1, P2, P1B, P2B;
double deltaObliquity, deltaEcLong;
double e, T;
long double days; // JD for which the last update was called