本文整理汇总了C++中SkyPoint::alt方法的典型用法代码示例。如果您正苦于以下问题:C++ SkyPoint::alt方法的具体用法?C++ SkyPoint::alt怎么用?C++ SkyPoint::alt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkyPoint
的用法示例。
在下文中一共展示了SkyPoint::alt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showHorCoords
void modCalcAzel::showHorCoords ( SkyPoint sp )
{
azBox->show( sp.az() );
elBox->show( sp.alt() );
}
示例2: 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() ) );
}
示例3: riseSetTime
QTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ) {
//this object does not rise or set; return an invalid time
if ( checkCircumpolar(geo->lat()) )
return QTime( 25, 0, 0 );
//First of all, if the object is below the horizon at date/time dt, adjust the time
//to bring it above the horizon
KStarsDateTime dt2 = dt;
SkyPoint p = recomputeCoords( dt, geo );
p.EquatorialToHorizontal( &(geo->GSTtoLST( dt.gst() )), geo->lat() );
if ( p.alt()->Degrees() < 0.0 ) {
if ( p.az()->Degrees() < 180.0 ) { //object has not risen yet
dt2 = dt.addSecs( 12.*3600. );
} else { //object has already set
dt2 = dt.addSecs( -12.*3600. );
}
}
return geo->UTtoLT( KStarsDateTime( dt2.date(), riseSetTimeUT( dt2, geo, rst ) ) ).time();
}
示例4: render
void ExportEyepieceView::render() {
float baseWidth = m_renderChart->width();
float baseHeight = m_renderChart->height();
if( m_renderImage )
m_output = QImage( int(baseWidth * 2.25), int(baseHeight), QImage::Format_ARGB32 ); // 0.25 * baseWidth gap between the images
else
m_output = QImage( int(baseWidth), int(baseHeight), QImage::Format_ARGB32 );
m_output.fill( Qt::white );
QPainter op( &m_output );
op.drawPixmap( QPointF(0,0), *m_renderChart );
if( m_renderImage )
op.drawPixmap( QPointF(baseWidth * 1.25,0), *m_renderImage );
if( m_tickConfig != 0 && Options::useAltAz() ) { // FIXME: this is very skymap-state-heavy for my happiness --asimha
// we must draw ticks
QImage tickOverlay( baseWidth, baseHeight, QImage::Format_ARGB32 );
tickOverlay.fill( Qt::transparent );
QPainter p( &tickOverlay );
p.setPen( Qt::red ); // FIXME: Determine color depending on situation, or make it configurable
double rEnd = 0.85 * ( baseWidth / 2.);
double rStart = 0.8 * ( baseWidth / 2.);
QFont font;
font.setPixelSize( ( rEnd - rStart ) );
p.setFont( font );
GeoLocation *geo = KStarsData::Instance()->geo();
double alt0 = m_sp->alt().Degrees(); // altitude when hour = 0, i.e. at m_dt (see below).
dms northAngle0 = EyepieceField::findNorthAngle( m_sp, geo->lat() );
for( float hour = -3.5; hour <= 3.5; hour += 0.5 ) {
dms rotation; // rotation
// FIXME: Code duplication : code duplicated from EyepieceField. This should really be a member of SkyPoint or something.
SkyPoint sp = SkyPoint::timeTransformed( m_sp, m_dt, geo, hour );
double alt = sp.alt().Degrees();
dms northAngle = EyepieceField::findNorthAngle( &sp, geo->lat() );
rotation = ( northAngle - northAngle0 );
if( m_tickConfig == 2 ) {
// Dobsonian: add additional CW rotation by altitude, but compensate for the fact that we've already rotated by alt0
rotation = rotation - dms( ( alt - alt0 ) );
}
rotation = rotation.reduce();
p.save();
p.translate( baseWidth/2.0, baseHeight/2.0 );
p.rotate( -( rotation.Degrees() + 90.0 ) );
p.drawLine( QPointF( rStart, 0 ), QPointF( rEnd, 0 ) );
QTime ct = geo->UTtoLT( m_dt.addSecs( 3600.0 * hour ) ).time();
p.drawText( QPointF( rEnd + 0.01 * baseWidth, 0 ), QString().sprintf( "%02d:%02d", ct.hour(), ct.minute() ) );
p.restore();
}
p.end();
op.drawImage( QPointF(0,0), tickOverlay );
if( m_renderImage ) {
op.drawImage( QPointF(baseWidth * 1.25, 0), tickOverlay );
}
}
op.end();
m_outputDisplay->setPixmap( (QPixmap::fromImage( m_output )).scaled( m_outputDisplay->width(), m_outputDisplay->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
}
示例5: processLines
//.........这里部分代码省略.........
if (latCheckBatch->isChecked() )
ostream << latB.toDMSString() << space;
// Read Epoch and write in ostream if corresponds
if(epochCheckBatch->isChecked() ) {
epoch0B = fields[i].toDouble();
i++;
} else
epoch0B = getEpoch( epochBoxBatch->text() );
if ( allRadioBatch->isChecked() )
ostream << epoch0B << space;
else
if(epochCheckBatch->isChecked() )
ostream << epoch0B << space;
// We make the first calculations
KStarsDateTime dt;
dt.setFromEpoch( epoch0B );
jdf = KStarsDateTime(dtB,utB).djd();
jd0 = dt.djd();
LST = KStarsDateTime(dtB,utB).gst().Degrees() + longB.Degrees();
// Equatorial coordinates are the input coords.
if (!horInputCoords) {
// Read RA and write in ostream if corresponds
if(raCheckBatch->isChecked() ) {
raB = dms::fromString( fields[i],FALSE);
i++;
} else
raB = raBoxBatch->createDms(FALSE);
if ( allRadioBatch->isChecked() )
ostream << raB.toHMSString() << space;
else
if(raCheckBatch->isChecked() )
ostream << raB.toHMSString() << space;
// Read DEC and write in ostream if corresponds
if(decCheckBatch->isChecked() ) {
decB = dms::fromString( fields[i], TRUE);
i++;
} else
decB = decBoxBatch->createDms();
if ( allRadioBatch->isChecked() )
ostream << decB.toDMSString() << space;
else
if(decCheckBatch->isChecked() )
ostream << decB.toDMSString() << space;
sp = SkyPoint (raB, decB);
sp.apparentCoord(jd0, jdf);
sp.EquatorialToHorizontal( &LST, &latB );
ostream << sp.az()->toDMSString() << space << sp.alt()->toDMSString() << endl;
// Input coords are horizontal coordinates
} else {
if(azCheckBatch->isChecked() ) {
azB = dms::fromString( fields[i],FALSE);
i++;
} else
azB = azBoxBatch->createDms();
if ( allRadioBatch->isChecked() )
ostream << azB.toHMSString() << space;
else
if(raCheckBatch->isChecked() )
ostream << azB.toHMSString() << space;
// Read DEC and write in ostream if corresponds
if(elCheckBatch->isChecked() ) {
elB = dms::fromString( fields[i], TRUE);
i++;
} else
elB = decBoxBatch->createDms();
if ( allRadioBatch->isChecked() )
ostream << elB.toDMSString() << space;
else
if(elCheckBatch->isChecked() )
ostream << elB.toDMSString() << space;
sp.setAz(azB);
sp.setAlt(elB);
sp.HorizontalToEquatorial( &LST, &latB );
ostream << sp.ra()->toHMSString() << space << sp.dec()->toDMSString() << endl;
}
}
fOut.close();
}
示例6: slotAddObject
void ObservingList::slotAddObject( SkyObject *obj, bool session, bool update ) {
bool addToWishList=true;
if( ! obj )
obj = ks->map()->clickedObject();
if( obj->name() == "star" ) {
KMessageBox::sorry(0, i18n( "Unnamed stars are not supported in the observing lists"));
return;
}
//First, make sure object is not already in the list
if ( obsList().contains( obj ) ) {
addToWishList = false;
if( ! session ) {
ks->statusBar()->changeItem( i18n( "%1 is already in your wishlist.", obj->name() ), 0 );
return;
}
}
if ( session && sessionList().contains( obj ) ) {
ks->statusBar()->changeItem( i18n( "%1 is already in the session plan.", obj->name() ), 0 );
return;
}
QString smag = "--";
if ( - 30.0 < obj->mag() && obj->mag() < 90.0 )
smag = QString::number( obj->mag(), 'g', 2 ); // The lower limit to avoid display of unrealistic comet magnitudes
SkyPoint p = obj->recomputeCoords( dt, geo );
//Insert object in the Wish List
if( addToWishList ) {
m_ObservingList.append( obj );
m_CurrentObject = obj;
QList<QStandardItem*> itemList;
QString ra, dec;
if(obj->name() == "star" ) {
ra = obj->ra0().toHMSString();
dec = obj->dec0().toDMSString();
}
else {
ra = p.ra().toHMSString();
dec = p.dec().toDMSString();
}
itemList << new QStandardItem( obj->translatedName() )
<< new QStandardItem( ra )
<< new QStandardItem( dec )
<< new QStandardItem( smag )
<< new QStandardItem( obj->typeName() );
m_Model->appendRow( itemList );
//Note addition in statusbar
ks->statusBar()->changeItem( i18n( "Added %1 to observing list.", obj->name() ), 0 );
ui->TableView->resizeColumnsToContents();
if( ! update ) slotSaveList();
}
//Insert object in the Session List
if( session ){
m_SessionList.append(obj);
dt.setTime( TimeHash.value( obj->name(), obj->transitTime( dt, geo ) ) );
dms lst(geo->GSTtoLST( dt.gst() ));
p.EquatorialToHorizontal( &lst, geo->lat() );
QList<QStandardItem*> itemList;
QString ra, dec, time = "--", alt = "--", az = "--";
QStandardItem *BestTime = new QStandardItem();
if(obj->name() == "star" ) {
ra = obj->ra0().toHMSString();
dec = obj->dec0().toDMSString();
BestTime->setData( QString( "--" ), Qt::DisplayRole );
}
else {
ra = p.ra().toHMSString();
dec = p.dec().toDMSString();
BestTime->setData( TimeHash.value( obj->name(), obj->transitTime( dt, geo ) ), Qt::DisplayRole );
alt = p.alt().toDMSString();
az = p.az().toDMSString();
}
// TODO: Change the rest of the parameters to their appropriate datatypes.
itemList << new QStandardItem( obj->translatedName() )
<< new QStandardItem( ra )
<< new QStandardItem( dec )
<< new QStandardItem( smag )
<< new QStandardItem( obj->typeName() )
<< BestTime
<< new QStandardItem( alt )
<< new QStandardItem( az );
m_Session->appendRow( itemList );
//Adding an object should trigger the modified flag
isModified = true;
ui->SessionView->resizeColumnsToContents();
//Note addition in statusbar
ks->statusBar()->changeItem( i18n( "Added %1 to session list.", obj->name() ), 0 );
}
setSaveImagesButton();
//.........这里部分代码省略.........