summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/skymap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kstars/kstars/skymap.cpp')
-rw-r--r--kstars/kstars/skymap.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/kstars/kstars/skymap.cpp b/kstars/kstars/skymap.cpp
index 19c27001..4117ef61 100644
--- a/kstars/kstars/skymap.cpp
+++ b/kstars/kstars/skymap.cpp
@@ -53,13 +53,13 @@
SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name )
: TQWidget (parent,name), computeSkymap(true), angularDistanceMode(false),
- ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0),
+ ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0),
ClickedObject(0), FocusObject(0), TransientObject(0),
starpix(0), pts(0), sp(0)
{
if ( parent ) ksw = (KStars*) parent->parent();
else ksw = 0;
-
+
pts = new TQPointArray( 2000 ); // points for milkyway and horizon
sp = new SkyPoint(); // needed by coordinate grid
@@ -88,12 +88,12 @@ SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name )
sky = new TQPixmap();
sky2 = new TQPixmap();
pmenu = new KSPopupMenu( ksw );
-
+
//Initialize Transient label stuff
TransientTimeout = 100; //fade label color every 0.2 sec
connect( &HoverTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientLabel() ) );
connect( &TransientTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientTimeout() ) );
-
+
IBoxes = new InfoBoxes( Options::windowWidth(), Options::windowHeight(),
Options::positionTimeBox(), Options::shadeTimeBox(),
Options::positionGeoBox(), Options::shadeGeoBox(),
@@ -173,9 +173,9 @@ void SkyMap::showFocusCoords( bool coordsOnly ) {
//display object info in infoBoxes
TQString oname;
oname = i18n( "nothing" );
- if ( focusObject() != NULL && Options::isTracking() )
+ if ( focusObject() != NULL && Options::isTracking() )
oname = focusObject()->translatedLongName();
-
+
infoBoxes()->focusObjChanged(oname);
}
@@ -421,24 +421,24 @@ SkyObject* SkyMap::objectNearest( SkyPoint *p ) {
void SkyMap::slotTransientLabel( void ) {
//This function is only called if the HoverTimer manages to timeout.
- //(HoverTimer is restarted with every mouseMoveEvent; so if it times
+ //(HoverTimer is restarted with every mouseMoveEvent; so if it times
//out, that means there was no mouse movement for HOVER_INTERVAL msec.)
//Identify the object nearest to the mouse cursor as the
- //TransientObject. The TransientObject is automatically labeled
+ //TransientObject. The TransientObject is automatically labeled
//in SkyMap::paintEvent().
- //Note that when the TransientObject pointer is not NULL, the next
- //mouseMoveEvent calls fadeTransientLabel(), which will fade out the
+ //Note that when the TransientObject pointer is not NULL, the next
+ //mouseMoveEvent calls fadeTransientLabel(), which will fade out the
//TransientLabel and then set TransientObject to NULL.
//
- //Do not show a transient label if the map is in motion, or if the mouse
+ //Do not show a transient label if the map is in motion, or if the mouse
//pointer is below the opaque horizon, or if the object has a permanent label
- if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() &&
+ if ( ! slewing && ! ( Options::useAltAz() && Options::showGround() &&
mousePoint()->alt()->Degrees() < 0.0 ) ) {
SkyObject *so = objectNearest( mousePoint() );
-
+
if ( so && ! isObjectLabeled( so ) ) {
setTransientObject( so );
-
+
TransientColor = data->colorScheme()->colorNamed( "UserLabelColor" );
if ( TransientTimer.isActive() ) TransientTimer.stop();
update();
@@ -460,38 +460,38 @@ void SkyMap::slotTransientTimeout( void ) {
//to fade the labels, we will need to smoothly transition from UserLabelColor to SkyColor.
TQColor c1 = data->colorScheme()->colorNamed( "UserLabelColor" );
TQColor c2 = data->colorScheme()->colorNamed( "SkyColor" );
-
+
int dRed = ( c2.red() - c1.red() )/20;
int dGreen = ( c2.green() - c1.green() )/20;
int dBlue = ( c2.blue() - c1.blue() )/20;
int newRed = TransientColor.red() + dRed;
int newGreen = TransientColor.green() + dGreen;
int newBlue = TransientColor.blue() + dBlue;
-
+
//Check to see if we have arrived at the target color (SkyColor).
//If so, point TransientObject to NULL.
if ( abs(newRed-c2.red()) < abs(dRed) || abs(newGreen-c2.green()) < abs(dGreen) || abs(newBlue-c2.blue()) < abs(dBlue) ) {
setTransientObject( NULL );
TransientTimer.stop();
- } else {
+ } else {
TransientColor.setRgb( newRed, newGreen, newBlue );
}
update();
}
-void SkyMap::setFocusObject( SkyObject *o ) {
- FocusObject = o;
-
- if ( FocusObject )
+void SkyMap::setFocusObject( SkyObject *o ) {
+ FocusObject = o;
+
+ if ( FocusObject )
Options::setFocusObject( FocusObject->name() );
- else
+ else
Options::setFocusObject( i18n( "nothing" ) );
}
void SkyMap::slotCenter( void ) {
setFocusPoint( clickedPoint() );
- if ( Options::useAltAz() )
+ if ( Options::useAltAz() )
focusPoint()->EquatorialToHorizontal( data->LST, data->geo()->lat() );
//clear the planet trail of old focusObject, if it was temporary
@@ -536,7 +536,7 @@ void SkyMap::slotCenter( void ) {
}
//update the destination to the selected coordinates
- if ( Options::useAltAz() ) {
+ if ( Options::useAltAz() ) {
if ( Options::useRefraction() )
setDestinationAltAz( refract( focusPoint()->alt(), true ).Degrees(), focusPoint()->az()->Degrees() );
else
@@ -558,7 +558,7 @@ void SkyMap::slotCenter( void ) {
s = focusPoint()->ra()->toHMSString() + ", " + focusPoint()->dec()->toDMSString(true);
ksw->statusBar()->changeItem( s, 2 );
}
-
+
showFocusCoords(); //update FocusBox
}
@@ -598,7 +598,7 @@ void SkyMap::slotDSS( void ) {
//concat all the segments into the kview command line:
KURL url (URLprefix + RAString + DecString + URLsuffix);
-
+
TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." );
new ImageViewer (&url, message, this);
}
@@ -640,7 +640,7 @@ void SkyMap::slotDSS2( void ) {
//concat all the segments into the kview command line:
KURL url (URLprefix + RAString + DecString + URLsuffix);
-
+
TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." );
new ImageViewer (&url, message, this);
}
@@ -665,7 +665,7 @@ void SkyMap::slotEndAngularDistance(void) {
if(angularDistanceMode) {
if ( SkyObject *so = objectNearest( mousePoint() ) ) {
angularDistance = so->angularDistanceTo( previousClickedPoint() );
- ksw->statusBar()->changeItem( so->translatedLongName() +
+ ksw->statusBar()->changeItem( so->translatedLongName() +
" " +
i18n("Angular distance: " ) +
angularDistance.toDMSString(), 0 );
@@ -837,7 +837,7 @@ void SkyMap::updateFocus() {
if ( Options::useAltAz() ) {
//Tracking any object in Alt/Az mode requires focus updates
double dAlt = focusObject()->alt()->Degrees();
- if ( Options::useRefraction() )
+ if ( Options::useRefraction() )
dAlt = refract( focusObject()->alt(), true ).Degrees();
setFocusAltAz( dAlt, focusObject()->az()->Degrees() );
focus()->HorizontalToEquatorial( data->LST, data->geo()->lat() );
@@ -921,9 +921,9 @@ void SkyMap::slewFocus( void ) {
slewing = true;
//since we are slewing, fade out the transient label
- if ( transientObject() && ! TransientTimer.isActive() )
+ if ( transientObject() && ! TransientTimer.isActive() )
fadeTransientLabel();
-
+
forceUpdate();
kapp->processEvents(10); //keep up with other stuff
@@ -952,7 +952,7 @@ void SkyMap::slewFocus( void ) {
setFocus( destination() );
focus()->EquatorialToHorizontal( data->LST, data->geo()->lat() );
}
-
+
data->HourAngle->setH( data->LST->Hours() - focus()->ra()->Hours() );
slewing = false;
@@ -965,7 +965,7 @@ void SkyMap::slewFocus( void ) {
//we want to attach a label to the nearest object.
if ( Options::useHoverLabel() )
HoverTimer.start( HOVER_INTERVAL, true );
-
+
forceUpdate();
}
}
@@ -985,7 +985,7 @@ double SkyMap::findPA( SkyObject *o, int x, int y, double scale ) {
SkyPoint test( o->ra()->Hours(), newDec );
if ( Options::useAltAz() ) test.EquatorialToHorizontal( data->LST, data->geo()->lat() );
TQPoint t = getXY( &test, Options::useAltAz(), Options::useRefraction(), scale );
- double dx = double( t.x() - x );
+ double dx = double( t.x() - x );
double dy = double( y - t.y() ); //backwards because TQWidget Y-axis increases to the bottom
double north;
if ( dy ) {
@@ -1184,7 +1184,7 @@ void SkyMap::forceUpdate( bool now )
}
float SkyMap::fov() {
- if ( width() >= height() )
+ if ( width() >= height() )
return 28.65*width()/Options::zoomFactor();
else
return 28.65*height()/Options::zoomFactor();
@@ -1195,12 +1195,12 @@ bool SkyMap::checkVisibility( SkyPoint *p, float FOV, double XMax ) {
bool useAltAz = Options::useAltAz();
//Skip objects below the horizon if:
- // + usingQt::Horizontal coords,
+ // + using Horizontal coords,
// + the ground is drawn,
// + and either of the following is true:
// - focus is above the horizon
// - field of view is larger than 50 degrees
- if ( useAltAz && Options::showGround() && p->alt()->Degrees() < -2.0
+ if ( useAltAz && Options::showGround() && p->alt()->Degrees() < -2.0
&& ( focus()->alt()->Degrees() > 0. || FOV > 50. ) ) return false;
if ( useAltAz ) {
@@ -1237,7 +1237,7 @@ bool SkyMap::unusablePoint (double dx, double dy)
void SkyMap::setZoomMouseCursor()
{
mouseMoveCursor = false; // no mousemove cursor
-
+
TQPainter p;
TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems)
// the center of the pixmap
@@ -1262,7 +1262,7 @@ void SkyMap::setZoomMouseCursor()
p.drawEllipse( mx - 7, my - 7, 14, 14 );
p.drawLine( mx + 5, my + 5, mx + 12, my + 12 );
p.end();
-
+
cursorPix.setMask (mask); // set the mask
TQCursor cursor (cursorPix);
setCursor (cursor);
@@ -1271,7 +1271,7 @@ void SkyMap::setZoomMouseCursor()
void SkyMap::setDefaultMouseCursor()
{
mouseMoveCursor = false; // no mousemove cursor
-
+
TQPainter p;
TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems)
// the center of the pixmap