本文整理汇总了C++中StelObjectP::getVMagnitudeWithExtinction方法的典型用法代码示例。如果您正苦于以下问题:C++ StelObjectP::getVMagnitudeWithExtinction方法的具体用法?C++ StelObjectP::getVMagnitudeWithExtinction怎么用?C++ StelObjectP::getVMagnitudeWithExtinction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StelObjectP
的用法示例。
在下文中一共展示了StelObjectP::getVMagnitudeWithExtinction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateEphemeris
void AstroCalcDialog::generateEphemeris()
{
float currentStep, ra, dec;
QString currentPlanet = ui->celestialBodyComboBox->currentData().toString();
initListEphemeris();
switch (ui->ephemerisStepComboBox->currentData().toInt()) {
case 1:
currentStep = 10 * StelCore::JD_MINUTE;
break;
case 2:
currentStep = StelCore::JD_HOUR;
break;
case 3:
currentStep = StelCore::JD_DAY;
break;
case 4:
currentStep = 5 * StelCore::JD_DAY;
break;
case 5:
currentStep = 10 * StelCore::JD_DAY;
break;
case 6:
currentStep = 15 * StelCore::JD_DAY;
break;
case 7:
currentStep = 30 * StelCore::JD_DAY;
break;
case 8:
currentStep = 60 * StelCore::JD_DAY;
break;
default:
currentStep = StelCore::JD_DAY;
break;
}
StelObjectP obj = solarSystem->searchByName(currentPlanet);
if (obj)
{
double currentJD = core->getJD(); // save current JD
double firstJD = StelUtils::qDateTimeToJd(ui->dateFromDateTimeEdit->dateTime());
firstJD = firstJD - StelUtils::getGMTShiftFromQT(firstJD)/24;
int elements = (int)((StelUtils::qDateTimeToJd(ui->dateToDateTimeEdit->dateTime()) - firstJD)/currentStep);
EphemerisListJ2000.clear();
EphemerisListJ2000.reserve(elements);
for (int i=0; i<elements; i++)
{
double JD = firstJD + i*currentStep;
core->setJD(JD);
core->update(0); // force update to get new coordinates
Vec3d pos = obj->getJ2000EquatorialPos(core);
EphemerisListJ2000.append(pos);
StelUtils::rectToSphe(&ra,&dec,pos);
ACTreeWidgetItem *treeItem = new ACTreeWidgetItem(ui->ephemerisTreeWidget);
// local date and time
treeItem->setText(EphemerisDate, StelUtils::jdToQDateTime(JD + StelUtils::getGMTShiftFromQT(JD)/24).toString("yyyy-MM-dd hh:mm:ss"));
treeItem->setText(EphemerisJD, QString::number(JD, 'f', 5));
treeItem->setText(EphemerisRA, StelUtils::radToHmsStr(ra));
treeItem->setTextAlignment(EphemerisRA, Qt::AlignRight);
treeItem->setText(EphemerisDec, StelUtils::radToHmsStr(dec));
treeItem->setTextAlignment(EphemerisDec, Qt::AlignRight);
treeItem->setText(EphemerisMagnitude, QString::number(obj->getVMagnitudeWithExtinction(core), 'f', 2));
treeItem->setTextAlignment(EphemerisMagnitude, Qt::AlignRight);
}
core->setJD(currentJD); // restore time
}
// adjust the column width
for(int i = 0; i < EphemerisCount; ++i)
{
ui->ephemerisTreeWidget->resizeColumnToContents(i);
}
// sort-by-date
ui->ephemerisTreeWidget->sortItems(EphemerisDate, Qt::AscendingOrder);
}