本文整理汇总了C++中KStarsData::lst方法的典型用法代码示例。如果您正苦于以下问题:C++ KStarsData::lst方法的具体用法?C++ KStarsData::lst怎么用?C++ KStarsData::lst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KStarsData
的用法示例。
在下文中一共展示了KStarsData::lst方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void CatalogComponent::update( KSNumbers * ) {
if ( selected() ) {
KStarsData *data = KStarsData::Instance();
foreach ( SkyObject *obj, m_ObjectList ) {
DeepSkyObject *dso = dynamic_cast< DeepSkyObject * >( obj );
StarObject *so = dynamic_cast< StarObject *>( obj );
Q_ASSERT( dso || so ); // We either have stars, or deep sky objects
if( dso ) {
// Update the deep sky object if need be
if ( dso->updateID != data->updateID() ) {
dso->updateID = data->updateID();
if ( dso->updateNumID != data->updateNumID() ) {
dso->updateCoords( data->updateNum() );
}
dso->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
}
}
else {
// Do exactly the same thing for stars
if ( so->updateID != data->updateID() ) {
so->updateID = data->updateID();
if ( so->updateNumID != data->updateNumID() ) {
so->updateCoords( data->updateNum() );
}
so->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
}
}
}
this->updateID = data->updateID();
}
示例2: CoordinateGrid
EquatorialCoordinateGrid::EquatorialCoordinateGrid( SkyComposite *parent )
: CoordinateGrid( parent, i18n("Equatorial Coordinate Grid" ) )
{
KStarsData *data = KStarsData::Instance();
intro();
double eps = 0.1;
double minRa = 0.0;
double maxRa = 23.0;
double dRa = 2.0;
double minDec = -80.0;
double maxDec = 90.0;
double dDec = 20.0;
double dDec2 = 4.0;
double dRa2 = 0.2;
double max, dec, dec2, ra, ra2;
LineList* lineList;
for ( ra = minRa; ra < maxRa; ra += dRa ) {
for ( dec = -90.0; dec < maxDec - eps; dec += dDec ) {
lineList = new LineList();
max = dec + dDec;
if ( max > 90.0 ) max = 90.0;
for ( dec2 = dec; dec2 <= max + eps; dec2 += dDec2 ) {
SkyPoint* p = new SkyPoint( ra, dec2 );
p->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
lineList->append( p );
}
appendLine( lineList );
}
}
for ( dec = minDec; dec < maxDec + eps; dec += dDec ) {
// Do not paint the line on the equator
if ( dec < 0.1 && dec > -0.1 )
continue;
// Adjust point density
int nPoints = int(round( fabs(cos(dec* dms::PI / 180.0)) * dRa / dRa2 ));
if ( nPoints < 5 )
nPoints = 5;
double dRa3 = dRa / nPoints;
for ( ra = minRa; ra < maxRa + eps; ra += dRa ) {
lineList = new LineList();
for ( ra2 = ra; ra2 <= ra + dRa + eps; ra2 += dRa3 ) {
SkyPoint* p = new SkyPoint( ra2, dec );
p->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
lineList->append( p );
}
appendLine( lineList );
}
}
summary();
}
示例3: updatePlanets
void SolarSystemSingleComponent::updatePlanets(KSNumbers *num) {
if ( selected() ) {
KStarsData *data = KStarsData::Instance();
m_Planet->findPosition( num, data->geo()->lat(), data->lst(), m_Earth );
m_Planet->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
if ( m_Planet->hasTrail() )
m_Planet->updateTrail( data->lst(), data->geo()->lat() );
}
}
示例4: update
void SolarSystemComposite::update( KSNumbers *num )
{
// if ( ! selected() ) return;
KStarsData *data = KStarsData::Instance();
m_Sun->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
m_Moon->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
m_JupiterMoons->update( num );
foreach ( SkyComponent *comp, components() ) {
comp->update( num );
}
示例5: num
Ecliptic::Ecliptic(SkyComposite *parent ) :
LineListIndex( parent, i18n("Ecliptic") ),
m_label( name() )
{
KStarsData *data = KStarsData::Instance();
KSNumbers num( data->ut().djd() );
dms elat(0.0), elng(0.0);
const double eps = 0.1;
const double minRa = 0.0;
const double maxRa = 23.0;
const double dRa = 2.0;
const double dRa2 = 2. / 5.;
for(double ra = minRa; ra < maxRa; ra += dRa ) {
LineList* lineList = new LineList();
for(double ra2 = ra; ra2 <= ra + dRa + eps; ra2 += dRa2 ) {
elng.setH( ra2 );
SkyPoint* o = new SkyPoint();
o->setFromEcliptic( num.obliquity(), elng, elat );
o->setRA0( o->ra().Hours() );
o->setDec0( o->dec().Degrees() );
o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
lineList->append( o );
}
appendLine( lineList );
}
}
示例6: drawCompassLabels
void Ecliptic::drawCompassLabels() {
const Projector* proj = SkyMap::Instance()->projector();
KStarsData* data = KStarsData::Instance();
SkyLabeler* skyLabeler = SkyLabeler::Instance();
// Set proper color for labels
QColor color( data->colorScheme()->colorNamed( "CompassColor" ) );
skyLabeler->setPen( QPen( QBrush(color), 1, Qt::SolidLine) );
KSNumbers num( data->ut().djd() );
dms elat(0.0), elng(0.0);
QString label;
for( int ra = 0; ra < 23; ra += 6 ) {
elng.setH( ra );
SkyPoint o;
o.setFromEcliptic( num.obliquity(), elng, elat );
o.setRA0( o.ra() );
o.setDec0( o.dec() );
o.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
bool visible;
QPointF cpoint = proj->toScreen( &o, false, &visible );
if( visible && proj->checkVisibility( &o ) ) {
label.setNum( o.ra().reduce().Degrees() );
skyLabeler->drawGuideLabel( cpoint, label, 0.0 );
}
}
}
示例7: update
// Don't precess the location of the names
void ConstellationNamesComponent::update( KSNumbers* )
{
if ( ! selected() )
return;
KStarsData *data = KStarsData::Instance();
foreach(SkyObject* o, m_ObjectList)
o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
}
示例8: update
void HorizonComponent::update( KSNumbers * )
{
if ( ! selected() )
return;
KStarsData *data = KStarsData::Instance();
foreach ( SkyPoint *p, pointList() ) {
p->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
}
示例9: JITupdate
// Don't precess the points, just account for the Earth's rotation
void NoPrecessIndex::JITupdate( LineList* lineList )
{
KStarsData *data = KStarsData::Instance();
lineList->updateID = data->updateID();
SkyList* points = lineList->points();
for (int i = 0; i < points->size(); i++ ) {
points->at( i )->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
}
}
示例10: update
void ListComponent::update( KSNumbers *num )
{
if ( ! selected() )
return;
KStarsData *data = KStarsData::Instance();
foreach ( SkyObject *o, m_ObjectList ) {
if( num )
o->updateCoords( num );
o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
}
}
示例11: setPosition
void SkyObjItem::setPosition(SkyObject* so)
{
KStarsData *data = KStarsData::Instance();
KStarsDateTime ut = data->geo()->LTtoUT(KStarsDateTime(KDateTime::currentLocalDateTime()));
SkyPoint sp = so->recomputeCoords(ut, data->geo());
//check altitude of object at this time.
sp.EquatorialToHorizontal(data->lst(), data->geo()->lat());
double rounded_altitude = (int)(sp.alt().Degrees()/5.0)*5.0;
m_Position = i18n("Now visible: About %1 degrees above the %2 horizon", rounded_altitude, KSUtils::toDirectionString( sp.az() ) );
}
示例12: PointListComponent
HorizonComponent::HorizonComponent(SkyComposite *parent )
: PointListComponent( parent )
{
KStarsData *data = KStarsData::Instance();
emitProgressText( i18n("Creating horizon" ) );
//Define Horizon
for ( unsigned int i=0; i<NCIRCLE; ++i ) {
SkyPoint *o = new SkyPoint();
o->setAz( i*360./NCIRCLE );
o->setAlt( 0.0 );
o->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
pointList().append( o );
}
}
示例13: findPA
double Projector::findPA( SkyObject *o, float x, float y ) const
{
//Find position angle of North using a test point displaced to the north
//displace by 100/zoomFactor radians (so distance is always 100 pixels)
//this is 5730/zoomFactor degrees
KStarsData *data = KStarsData::Instance();
double newDec = o->dec().Degrees() + 5730.0/m_vp.zoomFactor;
if ( newDec > 90.0 )
newDec = 90.0;
SkyPoint test( o->ra().Hours(), newDec );
if ( m_vp.useAltAz )
test.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
Vector2f t = toScreenVec( &test );
float dx = t.x() - x;
float dy = y - t.y(); //backwards because QWidget Y-axis increases to the bottom
float north;
if ( dy ) {
north = atan2f( dx, dy )*180.0/dms::PI;
} else {
north = (dx > 0.0 ? -90.0 : 90.0);
}
return ( north + o->pa() );
}
示例14: main
//.........这里部分代码省略.........
//Set Geographic Location
dat->setLocationFromOptions();
//Set color scheme
dat->colorScheme()->loadFromConfig();
//set clock now that we have a location:
//Check to see if user provided a date/time string. If not, use current CPU time
QString datestring = parser.value( "date" );
KStarsDateTime kdt;
if ( ! datestring.isEmpty() ) {
if ( datestring.contains( "-" ) ) { //assume ISODate format
if ( datestring.contains( ":" ) ) { //also includes time
//kdt = QDateTime::fromString( datestring, QDateTime::ISODate );
kdt = QDateTime::fromString( datestring, Qt::ISODate );
} else { //string probably contains date only
//kdt.setDate( QDate::fromString( datestring, Qt::ISODate ) );
kdt.setDate( QDate::fromString( datestring, Qt::ISODate ) );
kdt.setTime( QTime( 0, 0, 0 ) );
}
} else { //assume Text format for date string
kdt = dat->geo()->LTtoUT( QDateTime::fromString( datestring, Qt::TextDate ) );
}
if ( ! kdt.isValid() ) {
qWarning() << i18n( "Using CPU date/time instead." ) ;
kdt = KStarsDateTime::currentDateTimeUtc();
}
} else {
kdt = KStarsDateTime::currentDateTimeUtc();
}
dat->clock()->setUTC( kdt );
SkyMap *map = SkyMap::Create();
map->resize( w, h );
QPixmap sky( w, h );
dat->setFullTimeUpdate();
dat->updateTime(dat->geo(), map );
SkyPoint dest( Options::focusRA(), Options::focusDec() );
map->setDestination( dest );
map->destination()->EquatorialToHorizontal( dat->lst(), dat->geo()->lat() );
map->setFocus( map->destination() );
map->focus()->EquatorialToHorizontal( dat->lst(), dat->geo()->lat() );
//Execute the specified script
QString scriptfile = parser.value( "script" );
if ( ! scriptfile.isEmpty() ) {
if ( dat->executeScript( scriptfile, map ) ) {
std::cout << i18n( "Script executed." ).toUtf8().data() << std::endl;
} else {
qWarning() << i18n( "Could not execute script." ) ;
}
}
qApp->processEvents();
map->setupProjector();
map->exportSkyImage( &sky );
qApp->processEvents();
if ( ! sky.save( fname, format ) )
qWarning() << "Unable to save image: " << fname;
else
qDebug() << "Saved to file: %1" << fname;
delete map;
delete dat;
return 0;
}
//Try to parse the given date string
QString datestring = parser.value( "date" );
if ( ! datestring.isEmpty() && ! KStarsDateTime::fromString( datestring ).isValid() )
{
qWarning() << i18n( "Using CPU date/time instead." ) ;
datestring.clear();
}
#endif
// Create writable data dir if it does not exist
QDir writableDir;
writableDir.mkdir(KSPaths::writableLocation(QStandardPaths::GenericDataLocation));
#ifndef KSTARS_LITE
KStars::createInstance( true, ! parser.isSet( "paused" ), datestring );
// no session.. just start up normally
const QStringList urls = parser.positionalArguments();
// take arguments
if( ! urls.isEmpty() )
{
foreach (const QString &url, urls) {
const QUrl u = QUrl::fromUserInput(url, QDir::currentPath());
KStars::Instance()->openFITS(u);
}
}
示例15: loadStaticData
//.........这里部分代码省略.........
QT_FSEEK(nameFile, nameReader.getDataOffset(), SEEK_SET);
swapBytes = dataReader.getByteSwap();
long int nstars = 0;
//KDE_fseek(dataFile, dataReader.getDataOffset(), SEEK_SET);
QT_FSEEK(dataFile, dataReader.getDataOffset(), SEEK_SET);
qint16 faintmag;
quint8 htm_level;
quint16 t_MSpT;
fread( &faintmag, 2, 1, dataFile );
if( swapBytes )
faintmag = bswap_16( faintmag );
fread( &htm_level, 1, 1, dataFile );
fread( &t_MSpT, 2, 1, dataFile ); // Unused
if( swapBytes )
faintmag = bswap_16( faintmag );
if( faintmag / 100.0 > m_FaintMagnitude )
m_FaintMagnitude = faintmag / 100.0;
if( htm_level != m_skyMesh->level() )
qDebug() << "WARNING: HTM Level in shallow star data file and HTM Level in m_skyMesh do not match. EXPECT TROUBLE" << endl;
for(int i = 0; i < m_skyMesh -> size(); ++i) {
Trixel trixel = i;// = ( ( i >= 256 ) ? ( i - 256 ) : ( i + 256 ) );
for(unsigned long j = 0; j < (unsigned long)dataReader.getRecordCount(i); ++j) {
if(!fread(&stardata, sizeof(starData), 1, dataFile)){
qDebug() << "FILE FORMAT ERROR: Could not read starData structure for star #" << j << " under trixel #" << trixel << endl;
}
/* Swap Bytes when required */
if(swapBytes)
byteSwap( &stardata );
if(stardata.flags & 0x01) {
/* Named Star - Read the nameFile */
visibleName = "";
if(!fread(&starname, sizeof( starName ), 1, nameFile))
qDebug() << "ERROR: fread() call on nameFile failed in trixel " << trixel << " star " << j << endl;
name = QByteArray(starname.longName, 32);
gname = QByteArray(starname.bayerName, 8);
if ( ! gname.isEmpty() && gname.at(0) != '.')
visibleName = gname;
if(! name.isEmpty() ) {
// HEV: look up star name in internationalization filesource
name = i18nc("star name", name.toLocal8Bit().data());
} else {
name = i18n("star");
}
}
else
qDebug() << "ERROR: Named star file contains unnamed stars! Expect trouble." << endl;
/* Create the new StarObject */
star = new StarObject;
star->init( &stardata );
if( star->getHDIndex() != 0 && name == i18n("star"))
name = QString("HD %1").arg(star->getHDIndex());
star->setNames( name, visibleName );
star->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
++nstars;
if ( ! gname.isEmpty() ) m_genName.insert( gname, star );
if ( ! name.isEmpty() && name != i18n("star")) {
objectNames(SkyObject::STAR).append( name );
}
if ( ! visibleName.isEmpty() && gname != name ) {
objectNames(SkyObject::STAR).append( star -> gname(false) );
}
m_ObjectList.append( star );
m_starIndex->at( trixel )->append( star );
double pm = star->pmMagnitude();
for (int j = 0; j < m_highPMStars.size(); j++ ) {
HighPMStarList* list = m_highPMStars.at( j );
if ( list->append( trixel, star, pm ) ) break;
}
if( star->getHDIndex() != 0 )
m_HDHash.insert( star->getHDIndex(), star );
}
}
dataReader.closeFile();
nameReader.closeFile();
starsLoaded = true;
return true;
}