本文整理汇总了C++中SkyPoint::B1950ToJ2000方法的典型用法代码示例。如果您正苦于以下问题:C++ SkyPoint::B1950ToJ2000方法的具体用法?C++ SkyPoint::B1950ToJ2000怎么用?C++ SkyPoint::B1950ToJ2000使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkyPoint
的用法示例。
在下文中一共展示了SkyPoint::B1950ToJ2000方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAllObjects
void CatalogDB::GetAllObjects(const QString &catalog,
QList< SkyObject* > &sky_list,
QList < QPair <int, QString> > &object_names,
CatalogComponent *catalog_ptr) {
sky_list.clear();
QString selected_catalog = QString::number(FindCatalog(catalog));
skydb_.open();
QSqlQuery get_query(skydb_);
get_query.prepare("SELECT Epoch, Type, RA, Dec, Magnitude, Prefix, "
"IDNumber, LongName, MajorAxis, MinorAxis, "
"PositionAngle, Flux FROM ObjectDesignation JOIN DSO "
"JOIN Catalog WHERE Catalog.id = :catID AND "
"ObjectDesignation.id_Catalog = Catalog.id AND "
"ObjectDesignation.UID_DSO = DSO.UID");
get_query.bindValue("catID", selected_catalog);
// kWarning() << get_query.lastQuery();
// kWarning() << get_query.lastError();
// kWarning() << FindCatalog(catalog);
if (!get_query.exec()) {
kWarning() << get_query.lastQuery();
kWarning() << get_query.lastError();
}
while (get_query.next()) {
int cat_epoch = get_query.value(0).toInt();
unsigned char iType = get_query.value(1).toInt();
dms RA(get_query.value(2).toDouble());
dms Dec(get_query.value(3).toDouble());
float mag = get_query.value(4).toFloat();
QString catPrefix = get_query.value(5).toString();
int id_number_in_catalog = get_query.value(6).toInt();
QString lname = get_query.value(7).toString();
float a = get_query.value(8).toFloat();
float b = get_query.value(9).toFloat();
float PA = get_query.value(10).toFloat();
float flux = get_query.value(11).toFloat();
QString name = catPrefix + ' ' + QString::number(id_number_in_catalog);
SkyPoint t;
t.set(RA, Dec);
if (cat_epoch == 1950) {
// Assume B1950 epoch
t.B1950ToJ2000(); // t.ra() and t.dec() are now J2000.0
// coordinates
} else if (cat_epoch == 2000) {
// Do nothing
{ }
} else {
// FIXME: What should we do?
// FIXME: This warning will be printed for each line in the
// catalog rather than once for the entire catalog
kWarning() << "Unknown epoch while dealing with custom "
"catalog. Will ignore the epoch and assume"
" J2000.0";
}
RA = t.ra();
Dec = t.dec();
if (iType == 0) { // Add a star
StarObject *o = new StarObject(RA, Dec, mag, lname);
sky_list.append(o);
} else { // Add a deep-sky object
DeepSkyObject *o = new DeepSkyObject(iType, RA, Dec, mag,
name, QString(), lname,
catPrefix, a, b, -PA);
o->setFlux(flux);
o->setCustomCatalog(catalog_ptr);
sky_list.append(o);
// Add name to the list of object names
if (!name.isEmpty()) {
object_names.append(qMakePair<int,QString>(iType, name));
}
}
if (!lname.isEmpty() && lname != name) {
object_names.append(qMakePair<int,QString>(iType, lname));
}
}
get_query.clear();
skydb_.close();
}