22#include <QSharedPointer>
23#include <QJsonDocument>
26#include <unordered_map>
28#include "config-kstars.h"
30#include "polyfills/qstring_hash.h"
33#pragma GCC diagnostic push
34#pragma GCC diagnostic ignored "-Wignored-attributes"
37#pragma GCC diagnostic ignored "-Wint-in-bool-context"
41#pragma GCC diagnostic pop
57bool isHardwareLimited();
77inline T clamp(T x, T min, T max)
93inline T reduceAngle(T x, T min, T max)
96 return x - delta * floor((x - min) / delta);
102inline Eigen::Vector3d fromSperical(
const dms &longitude,
const dms &latitude)
107 longitude.
SinCos(sinL, cosL);
108 latitude.
SinCos(sinB, cosB);
109 return Eigen::Vector3d(cosB * cosL, cosB * sinL, sinB);
113inline QPointF vecToPoint(
const Eigen::Vector2f &vec)
115 return QPointF(vec[0], vec[1]);
119inline Eigen::Vector2f pointToVec(
const QPointF &p)
121 return Eigen::Vector2f(p.
x(), p.
y());
140QString getDSSURL(
const dms &ra,
const dms &dec,
float width = 0,
float height = 0,
252 static void Write(
QTextStream &stream, QtMsgType type,
259void copyResourcesFolderFromAppBundle(
QString folder);
260bool setupMacKStarsIfNeeded();
261bool configureAstrometry();
262bool replaceIndexFileNotYetSet();
268QString getAstrometryConfFilePath();
270bool addAstrometryDataDir(
const QString &dataDir);
271bool removeAstrometryDataDir(
const QString &dataDir);
283 JPLParser(
const QString &path);
289 const std::unordered_map<QString, int> &fieldMap()
const
294 template <
typename Lambda>
295 void for_each(
const Lambda &fct)
297 for (
const auto &item : m_data)
299 fct([ &,
this](
const QString & key)
301 return item.toArray().at(m_field_map.at(key));
309 std::unordered_map<QString, int> m_field_map;
316 MPCParser(
const QString &path);
318 template <
typename Lambda>
319 void for_each(
const Lambda &fct)
321 for (
const auto &item : m_data)
323 fct([ &,
this](
const QString & key)
325 return item.toObject().value(key);
357double getAvailableRAM();
359void setGlobalSettings(
const QVariantMap &settings);
373double rangePA(
double pa);
380double range360(
double r);
387double rotationToPositionAngle(
double value);
393double positionAngleToRotation(
double value);
Interface into Qt's logging system.
static void UseDefault()
Use the default logging mechanism.
static void UseStdout()
Output logs to stdout.
static void SyncFilterRules()
SyncFilterRules Sync QtLogging filter rules from Options.
static void Disable()
Disable logging.
static void UseFile()
Store all logs into the specified file.
static void UseStderr()
Output logs to stderr.
KStars utility functions.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
The sky coordinates of a point in the sky.
This is a subclass of SkyObject.
An angle, stored as degrees, but expressible in many ways.
void SinCos(double &s, double &c) const
Compute Sine and Cosine of the angle simultaneously.
void append(QList< T > &&value)