当前位置: 首页>>代码示例>>C++>>正文


C++ KStarsData::geo方法代码示例

本文整理汇总了C++中KStarsData::geo方法的典型用法代码示例。如果您正苦于以下问题:C++ KStarsData::geo方法的具体用法?C++ KStarsData::geo怎么用?C++ KStarsData::geo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KStarsData的用法示例。


在下文中一共展示了KStarsData::geo方法的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();
    }
开发者ID:thelastpolaris,项目名称:kstars,代码行数:31,代码来源:catalogcomponent.cpp

示例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();
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:59,代码来源:equatorialcoordinategrid.cpp

示例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() );
    }
}
开发者ID:birefringence,项目名称:kstars,代码行数:9,代码来源:solarsystemsinglecomponent.cpp

示例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 );
    }
开发者ID:birefringence,项目名称:kstars,代码行数:12,代码来源:solarsystemcomposite.cpp

示例5: 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() ) );
}
开发者ID:spacetime,项目名称:kstars-hackfest,代码行数:12,代码来源:skyobjitem.cpp

示例6: showCurrentTimeAndLocation

void modCalcSidTime::showCurrentTimeAndLocation()
{
    KStarsData* data = KStarsData::Instance();
    LT->setTime(   data->lt().time() );
    Date->setDate( data->lt().date() );

    geo = data->geo();
    LocationButton->setText( geo->fullName() );
    geoBatch = data->geo();
    LocationButtonBatch->setText( geoBatch->fullName() );

    slotConvertST( LT->time() );
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:13,代码来源:modcalcsidtime.cpp

示例7: 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 );
        }
    }
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:26,代码来源:ecliptic.cpp

示例8: QFrame

modCalcAltAz::modCalcAltAz(QWidget *parentSplit)
        : QFrame(parentSplit)
{
    setupUi(this);

    KStarsData *data = KStarsData::Instance();
    RA->setDegType(false);

    //Initialize Date/Time and Location data
    geoPlace = data->geo();
    LocationButton->setText( geoPlace->fullName() );

    //Make sure slotDateTime() gets called, so that LST will be set
    connect(DateTime, SIGNAL(dateTimeChanged(const QDateTime&)), this, SLOT(slotDateTimeChanged(const QDateTime&)));
    DateTime->setDateTime( data->lt().dateTime() );

    connect(NowButton, SIGNAL(clicked()), this, SLOT(slotNow()));
    connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation()));
    connect(ObjectButton, SIGNAL(clicked()), this, SLOT(slotObject()));

    connect(RA,  SIGNAL(editingFinished()), this, SLOT(slotCompute()));
    connect(Dec, SIGNAL(editingFinished()), this, SLOT(slotCompute()));
    connect(Az,  SIGNAL(editingFinished()), this, SLOT(slotCompute()));
    connect(Alt, SIGNAL(editingFinished()), this, SLOT(slotCompute()));

    show();
}
开发者ID:birefringence,项目名称:kstars,代码行数:27,代码来源:modcalcaltaz.cpp

示例9: 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 );
    }
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:28,代码来源:ecliptic.cpp

示例10: update

void HorizonComponent::update( KSNumbers * )
{
    if ( ! selected() )
        return;
    KStarsData *data = KStarsData::Instance();
    foreach ( SkyPoint *p, pointList() ) {
        p->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
    }
开发者ID:birefringence,项目名称:kstars,代码行数:8,代码来源:horizoncomponent.cpp

示例11: initGeo

void modCalcDayLength::initGeo(void)
{
    KStarsData *data = KStarsData::Instance();
    geoPlace = data->geo();
    geoBatch = data->geo();
    Location->setText( geoPlace->fullName() );
    LocationBatch->setText( geoBatch->fullName() );
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:8,代码来源:modcalcdaylength.cpp

示例12: 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() );
}
开发者ID:monisha4,项目名称:kstars-hackfest,代码行数:9,代码来源:constellationnamescomponent.cpp

示例13: 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() );
    }
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:10,代码来源:noprecessindex.cpp

示例14: 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() );
    }
}
开发者ID:Bugsbane,项目名称:kstars,代码行数:11,代码来源:listcomponent.cpp

示例15: 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 );
    }
}
开发者ID:birefringence,项目名称:kstars,代码行数:16,代码来源:horizoncomponent.cpp


注:本文中的KStarsData::geo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。