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


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

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


在下文中一共展示了KStarsData::skyComposite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateCoords

void KSPlanetBase::updateCoords( const KSNumbers *num, bool includePlanets, const dms *lat, const dms *LST, bool )
{
    KStarsData *kd = KStarsData::Instance();
    if ( includePlanets ) {
        kd->skyComposite()->earth()->findPosition( num ); //since we don't pass lat & LST, localizeCoords will be skipped

        if ( lat && LST ) {
            findPosition( num, lat, LST, kd->skyComposite()->earth() );
            //Don't add to the trail this time
            if( hasTrail() )
                Trail.takeLast();
        } else {
            findGeocentricPosition( num, kd->skyComposite()->earth() );
        }
    }
}
开发者ID:thelastpolaris,项目名称:kstars,代码行数:16,代码来源:ksplanetbase.cpp

示例2: slotGoto

void ConjunctionsTool::slotGoto() {
    int index = m_SortModel->mapToSource( OutputList->currentIndex() ).row(); // Get the number of the line
    long double jd = outputJDList.value( index );
    KStarsDateTime dt;
    KStars *ks = KStars::Instance();
    KStarsData *data = KStarsData::Instance();
    SkyMap *map = ks->map();

    // Show conjunction
    data->setLocation( *geoPlace );
    dt.setDJD( jd );
    data->changeDateTime( dt );
    map->setClickedObject( data->skyComposite()->findByName( m_Model->data( m_Model->index( index, 2 ) ).toString() ) );
    map->setClickedPoint( map->clickedObject() );
    map->slotCenter();
}
开发者ID:KDE,项目名称:kstars,代码行数:16,代码来源:conjunctions.cpp

示例3: slotCompute

void ConjunctionsTool::slotCompute (void)
{
    KStarsDateTime dtStart = startDate -> dateTime();   // Start date
    KStarsDateTime dtStop = stopDate -> dateTime();     // Stop date
    long double startJD = dtStart.djd();                // Start julian day
    long double stopJD = dtStop.djd();                  // Stop julian day
    bool opposition = false;                            // true=opposition, false=conjunction
    if( Opposition->currentIndex() ) opposition = true;
    QStringList objects;                                // List of sky object used as Object1
    KStarsData *data = KStarsData::Instance();
    int progress = 0;

    // Check if we have a valid angle in maxSeparationBox
    dms maxSeparation( 0.0 );
    bool ok;
    maxSeparation = maxSeparationBox->createDms( true, &ok );

    if( !ok ) {
        KMessageBox::sorry( 0, i18n("Maximum separation entered is not a valid angle. Use the What's this help feature for information on how to enter a valid angle") );
        return;
    }

    // Check if Object1 and Object2 are set
    if( FilterTypeComboBox->currentIndex() == 0 && !Object1 ) {
        KMessageBox::sorry( 0, i18n("Please select an object to check conjunctions with, by clicking on the \'Find Object\' button.") );
        return;
    }
    Object2 = KSPlanetBase::createPlanet( Obj2ComboBox->currentIndex() );
    if( FilterTypeComboBox->currentIndex() == 0 && Object1->name() == Object2->name() ) {
        // FIXME: Must free the created Objects
        KMessageBox::sorry( 0 , i18n("Please select two different objects to check conjunctions with.") );
        return;
    }

    // Init KSConjunct object
    KSConjunct ksc;
    connect( &ksc, SIGNAL(madeProgress(int)), this, SLOT(showProgress(int)) );
    ksc.setGeoLocation( geoPlace );

    switch ( FilterTypeComboBox->currentIndex() ) {
    case 1: // All object types
        foreach( int type, data->skyComposite()->objectNames().keys() )
            objects += data->skyComposite()->objectNames( type );
        break;
    case 2: // Stars
        objects += data->skyComposite()->objectNames( SkyObject::STAR );
        objects += data->skyComposite()->objectNames( SkyObject::CATALOG_STAR );
        break;
    case 3: // Solar system
        objects += data->skyComposite()->objectNames( SkyObject::PLANET );
        objects += data->skyComposite()->objectNames( SkyObject::COMET );
        objects += data->skyComposite()->objectNames( SkyObject::ASTEROID );
        objects += data->skyComposite()->objectNames( SkyObject::MOON );
        objects += i18n("Sun");
        // Remove Object2  planet
        objects.removeAll( Object2->name() );
        break;
    case 4: // Planet
        objects += data->skyComposite()->objectNames( SkyObject::PLANET );
        // Remove Object2  planet
        objects.removeAll( Object2->name() );
        break;
    case 5: // Comet
        objects += data->skyComposite()->objectNames( SkyObject::COMET );
        break;
    case 6: // Ateroid
        objects += data->skyComposite()->objectNames( SkyObject::ASTEROID );
        break;
    case 7: // Open Clusters
        objects = data->skyComposite()->objectNames( SkyObject::OPEN_CLUSTER );
        break;
    case 8: // Open Clusters
        objects = data->skyComposite()->objectNames( SkyObject::GLOBULAR_CLUSTER );
        break;
    case 9: // Gaseous nebulae
        objects = data->skyComposite()->objectNames( SkyObject::GASEOUS_NEBULA );
        break;
    case 10: // Planetary nebula
        objects = data->skyComposite()->objectNames( SkyObject::PLANETARY_NEBULA );
        break;
    case 11: // Galaxies
        objects = data->skyComposite()->objectNames( SkyObject::GALAXY );
        break;
    }

    // Remove all Jupiter and Saturn moons
    // KStars crash if we compute a conjunction between a planet and one of this moon
    if ( FilterTypeComboBox->currentIndex() == 1 ||
            FilterTypeComboBox->currentIndex() == 3 ||
            FilterTypeComboBox->currentIndex() == 6 ) {
        objects.removeAll( "Io" );
        objects.removeAll( "Europa" );
        objects.removeAll( "Ganymede" );
        objects.removeAll( "Callisto" );
        objects.removeAll( "Mimas" );
        objects.removeAll( "Enceladus" );
        objects.removeAll( "Tethys" );
        objects.removeAll( "Dione" );
        objects.removeAll( "Rhea" );
        objects.removeAll( "Titan" );
//.........这里部分代码省略.........
开发者ID:KDE,项目名称:kstars,代码行数:101,代码来源:conjunctions.cpp


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