void ConstellationNamesComponent::draw( SkyPainter *skyp )
{
    Q_UNUSED(skyp);
    if ( ! selected() )
        return;

    const Projector *proj = SkyMap::Instance()->projector();
    SkyLabeler* skyLabeler = SkyLabeler::Instance();
    skyLabeler->useStdFont();
    skyLabeler->setPen( QColor( KStarsData::Instance()->colorScheme()->colorNamed( "CNameColor" ) ) );

    QString name;
    foreach(SkyObject *p, m_ObjectList) {
        if( ! proj->checkVisibility( p ) )
            continue; 

        bool visible = false;
        QPointF o = proj->toScreen( p, false, &visible );
        if( !visible || !proj->onScreen( o ) )
            continue;

        if( Options::useLatinConstellNames() || Options::useLocalConstellNames() )
            name = p->name();
        else
            name = p->name2();

        o.setX( o.x() - 5.0 * name.length() );
        skyLabeler->drawGuideLabel( o, name, 0.0 );
    }

    skyLabeler->resetFont();
}
示例#2
0
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 );
        }
    }
}
示例#3
0
void StarComponent::drawLabels()
{
    if( m_hideLabels )
        return;

    SkyLabeler *labeler = SkyLabeler::Instance();
    labeler->setPen( QColor( KStarsData::Instance()->colorScheme()->colorNamed( "SNameColor" ) ) );

    int max = int( m_zoomMagLimit * 10.0 );
    if ( max < 0 ) max = 0;
    if ( max > MAX_LINENUMBER_MAG ) max = MAX_LINENUMBER_MAG;

    for ( int i = 0; i <= max; i++ ) {
        LabelList* list = m_labelList[ i ];
        for ( int j = 0; j < list->size(); j++ ) {
            labeler->drawNameLabel( list->at(j).obj, list->at(j).o );
        }
        list->clear();
    }

}
void SatellitesComponent::drawLabel( Satellite *sat, QPointF pos )
{
    SkyLabeler *labeler = SkyLabeler::Instance();
    labeler->setPen( KStarsData::Instance()->colorScheme()->colorNamed( "SatLabelColor" ) );
    labeler->drawNameLabel( sat, pos );
}