21 #ifndef _ASTROCALCDIALOG_HPP_ 22 #define _ASTROCALCDIALOG_HPP_ 25 #include <QTreeWidget> 26 #include <QTreeWidgetItem> 31 #include "StelDialog.hpp" 32 #include "StelCore.hpp" 34 #include "SolarSystem.hpp" 36 #include "NebulaMgr.hpp" 37 #include "StarMgr.hpp" 38 #include "StelUtils.hpp" 40 class Ui_astroCalcDialogForm;
41 class QListWidgetItem;
89 GraphMagnitudeVsTime = 1,
91 GraphDistanceVsTime = 3,
92 GraphElongationVsTime = 4,
93 GraphAngularSizeVsTime = 5,
94 GraphPhaseAngleVsTime = 6
103 static QVector<Vec3d> EphemerisListCoords;
104 static QVector<QString> EphemerisListDates;
105 static QVector<float> EphemerisListMagnitudes;
106 static int DisplayedPositionIndex;
114 Ui_astroCalcDialogForm *ui;
117 void currentCelestialPositions();
118 void populateCelestialCategoryList();
119 void saveCelestialPositions();
120 void selectCurrentCelestialPosition(
const QModelIndex &modelIndex);
122 void saveCelestialPositionsMagnitudeLimit(
double mag);
123 void saveCelestialPositionsHorizontalCoordinatesFlag(
bool b);
124 void saveCelestialPositionsCategory(
int index);
127 void generateEphemeris();
128 void cleanupEphemeris();
129 void selectCurrentEphemeride(
const QModelIndex &modelIndex);
130 void saveEphemeris();
131 void onChangedEphemerisPosition(
const QModelIndex &modelIndex);
132 void reGenerateEphemeris();
134 void saveEphemerisCelestialBody(
int index);
135 void saveEphemerisTimeStep(
int index);
138 void calculatePhenomena();
139 void cleanupPhenomena();
140 void selectCurrentPhenomen(
const QModelIndex &modelIndex);
141 void savePhenomena();
142 void savePhenomenaAngularSeparation(
double v);
144 void savePhenomenaCelestialBody(
int index);
145 void savePhenomenaCelestialGroup(
int index);
146 void savePhenomenaOppositionFlag(
bool b);
149 void drawAltVsTimeDiagram();
151 void drawCurrentTimeDiagram();
153 void drawTransitTimeDiagram();
155 void mouseOverLine(QMouseEvent *event);
157 void saveGraphsCelestialBody(
int index);
158 void saveGraphsFirstId(
int index);
159 void saveGraphsSecondId(
int index);
160 void drawXVsTimeGraphs();
163 void saveWutMagnitudeLimit(
double mag);
164 void saveWutTimeInterval(
int index);
165 void calculateWutObjects();
166 void selectWutObject();
167 void saveWutObjects();
169 void updateAstroCalcData();
171 void changePage(QListWidgetItem *current, QListWidgetItem *previous);
173 void updateSolarSystemData();
183 QTimer *currentTimeLine;
184 QHash<QString,QString> wutObjects;
185 QHash<QString,int> wutCategories;
188 void setCelestialPositionsHeaderNames();
190 void setEphemerisHeaderNames();
192 void setPhenomenaHeaderNames();
195 void initListCelestialPositions();
197 void initListEphemeris();
199 void initListPhenomena();
205 void populateCelestialBodyList();
207 void populateEphemerisTimeStepsList();
209 void populateMajorPlanetList();
211 void populateGroupCelestialBodyList();
213 void prepareAxesAndGraph();
214 void prepareXVsTimeAxesAndGraph();
216 void populateTimeIntervalsList();
218 void populateWutGroups();
220 void populateFunctionsList();
226 QMap<double, double> findClosestApproach(PlanetP& object1, PlanetP& object2,
double startJD,
double stopJD,
double maxSeparation,
bool opposition);
227 double findDistance(
double JD, PlanetP object1, PlanetP object2,
bool opposition);
228 bool findPrecise(QPair<double, double>* out, PlanetP object1, PlanetP object2,
double JD,
double step,
int prevSign,
bool opposition);
229 void fillPhenomenaTable(
const QMap<double, double> list,
const PlanetP object1,
const PlanetP object2,
bool opposition);
231 QMap<double, double> findClosestApproach(PlanetP& object1, NebulaP& object2,
double startJD,
double stopJD,
double maxSeparation);
232 double findDistance(
double JD, PlanetP object1, NebulaP object2);
233 bool findPrecise(QPair<double, double>* out, PlanetP object1, NebulaP object2,
double JD,
double step,
int prevSign);
234 void fillPhenomenaTable(
const QMap<double, double> list,
const PlanetP object1,
const NebulaP object2);
236 QMap<double, double> findClosestApproach(PlanetP& object1,
StelObjectP& object2,
double startJD,
double stopJD,
double maxSeparation);
237 double findDistance(
double JD, PlanetP object1,
StelObjectP object2);
238 bool findPrecise(QPair<double, double>* out, PlanetP object1,
StelObjectP object2,
double JD,
double step,
int prevSign);
239 void fillPhenomenaTable(
const QMap<double, double> list,
const PlanetP object1,
const StelObjectP object2);
241 QString delimiter, acEndl;
242 QStringList ephemerisHeader, phenomenaHeader, positionsHeader;
243 static float brightLimit;
244 static float minY, maxY, transitX, minY1, maxY1, minY2, maxY2;
245 static QString yAxis1Legend, yAxis2Legend;
249 void updateTabBarListWidgetWidth();
257 : QTreeWidgetItem(parent)
262 bool operator < (
const QTreeWidgetItem &other)
const 264 int column = treeWidget()->sortColumn();
266 if (column == AstroCalcDialog::CColumnName)
268 QRegExp dso(
"^(\\w+)\\s*(\\d+)\\s*(.*)$");
269 QRegExp mp(
"^[(](\\d+)[)]\\s(.+)$");
271 if (dso.exactMatch(text(column)))
272 a = dso.capturedTexts().at(2).toInt();
273 if (a==0 && mp.exactMatch(text(column)))
274 a = mp.capturedTexts().at(1).toInt();
275 if (dso.exactMatch(other.text(column)))
276 b = dso.capturedTexts().at(2).toInt();
277 if (b==0 && mp.exactMatch(other.text(column)))
278 b = mp.capturedTexts().at(1).toInt();
282 return text(column).toLower() < other.text(column).toLower();
290 return text(column).toFloat() < other.text(column).toFloat();
294 return text(column).toLower() < other.text(column).toLower();
304 : QTreeWidgetItem(parent)
309 bool operator < (
const QTreeWidgetItem &other)
const 311 int column = treeWidget()->sortColumn();
319 return text(column).toFloat() < other.text(column).toFloat();
323 return text(column).toLower() < other.text(column).toLower();
333 : QTreeWidgetItem(parent)
338 bool operator < (
const QTreeWidgetItem &other)
const 340 int column = treeWidget()->sortColumn();
348 return text(column).toLower() < other.text(column).toLower();
353 #endif // _ASTROCALCDIALOG_HPP_ EphemerisColumns
Defines the number and the order of the columns in the ephemeris table.
date and time of ephemeris
CPositionsColumns
Defines the number and the order of the columns in the table that lists celestial bodies positions...
Manage i18n operations such as message translation and date/time localization.
Main class for Stellarium core processing.
Base class for all the GUI windows in Stellarium.
extra data (surface brightness, separation, period, etc.)
PhenomenaColumns
Defines the number and the order of the columns in the phenomena table.
GraphsTypes
Defines the type of graphs.
This StelObjectModule derivative is used to model SolarSystem bodies.
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.
date and time of ephemeris
Stores the star catalogue data.
Manage the selection and queries on one or more StelObjects.
double getDecAngle(const QString &str)
Convert a string longitude, latitude, RA or Declination angle to radians.
void styleChanged()
Notify that the application style changed.
Manage a collection of nebulae.