[Kstars-devel] kdeedu/kstars/kstars/tools

Pablo de Vicente p.devicente at wanadoo.es
Thu Jan 13 18:18:30 CET 2005


CVS commit by pvicente: 

Added localized names in the planet viewer tool.
CCMAIL:kstars-devel at kde.org


  M +14 -5     planetviewer.cpp   1.19


--- kdeedu/kstars/kstars/tools/planetviewer.cpp  #1.18:1.19
@@ -46,4 +46,6 @@ PlanetViewer::PlanetViewer(QWidget *pare
         pw->timeStep->tsbox()->setMinValue( 21 );
         pw->timeStep->tsbox()->setValue( 21 );
+        pw->inclinationSpinBox->setValue(0);
+        setInclination(0);
         pw->RunButton->setPixmap( KGlobal::iconLoader()->loadIcon( "1rightarrow", KIcon::Toolbar ) );
         pw->dateBox->setDate( ExtDate::currentDate() );
@@ -87,4 +89,5 @@ PlanetViewer::PlanetViewer(QWidget *pare
         connect( &tmr, SIGNAL( timeout() ), SLOT( tick() ) );
         connect( pw->timeStep, SIGNAL( scaleChanged(float) ), SLOT( setTimeScale(float) ) );
+        connect( pw->inclinationSpinBox, SIGNAL( valueChanged(int) ), SLOT( setInclination(int) ) );
         connect( pw->RunButton, SIGNAL( clicked() ), SLOT( slotRunClock() ) );
         connect( pw->dateBox, SIGNAL( valueChanged( const ExtDate & ) ), SLOT( slotChangeDate( const ExtDate & ) ) );
@@ -107,4 +110,10 @@ void PlanetViewer::setTimeScale(float f)
 }
 
+void PlanetViewer::setInclination(int incl) {
+        dms inclination = dms(incl);
+        double sinInclination;
+        inclination.SinCos(sinInclination,cosInclination);
+}
+
 void PlanetViewer::slotRunClock() {
         isClockRunning = !isClockRunning;
@@ -143,5 +152,5 @@ void PlanetViewer::updatePlanets() {
                         p->helEcLong()->SinCos( s, c );
                         planet[i]->point(0)->setX( p->rsun()*c );
-                        planet[i]->point(0)->setY( p->rsun()*s );
+                        planet[i]->point(0)->setY( p->rsun()*s*cosInclination );
                         planetLabel[i]->point(0)->setX( p->rsun()*c );
                         planetLabel[i]->point(0)->setY( p->rsun()*s );
@@ -199,5 +208,5 @@ void PlanetViewer::initPlotObjects() {
                         while ( !orbitStream.eof() ) {
                                 orbitStream >> x >> y >> z;
-                                orbit[i]->addPoint( new DPoint( x, y ) );
+                                orbit[i]->addPoint( new DPoint( x, y*cosInclination ) );
                         }
                 }
@@ -208,5 +217,5 @@ void PlanetViewer::initPlotObjects() {
         for ( unsigned int i=0; i<9; ++i ) {
                 planet[i] = new KPlotObject( pName[i], pColor[i], KPlotObject::POINTS, 6, KPlotObject::CIRCLE );
-                planetLabel[i] = new KPlotObject( pName[i], pColor[i], KPlotObject::LABEL );
+                planetLabel[i] = new KPlotObject( i18n(pName[i].ascii()), pColor[i], KPlotObject::LABEL );
                 
                 double s, c;
@@ -214,6 +223,6 @@ void PlanetViewer::initPlotObjects() {
                 p->helEcLong()->SinCos( s, c );
                 
-                planet[i]->addPoint( new DPoint( p->rsun()*c, p->rsun()*s ) );
-                planetLabel[i]->addPoint( new DPoint( p->rsun()*c, p->rsun()*s ) );
+                planet[i]->addPoint( new DPoint( p->rsun()*c, p->rsun()*s*cosInclination ) );
+                planetLabel[i]->addPoint( new DPoint( p->rsun()*c, p->rsun()*s*cosInclination ) );
                 pw->map->addObject( planet[i] );
                 pw->map->addObject( planetLabel[i] );




More information about the Kstars-devel mailing list