[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/kstars/kstars
From: Alexey Khudyakov <alexey.skladnoy () gmail ! com>
Date: 2011-03-11 16:55:51
Message-ID: 20110311165551.DE8ECAC8CA () svn ! kde ! org
[Download RAW message or body]
SVN commit 1224500 by khudyakov:
remove accessors for m_MousePoint
M +4 -4 skymap.cpp
M +13 -18 skymap.h
M +14 -14 skymapevents.cpp
--- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #1224499:1224500
@@ -351,9 +351,9 @@
//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() &&
- SkyPoint::refract(mousePoint()->alt()).Degrees() < 0.0 ) ) {
+ SkyPoint::refract(m_MousePoint.alt()).Degrees() < 0.0 ) ) {
double maxrad = 1000.0/Options::zoomFactor();
- SkyObject *so = data->skyComposite()->objectNearest( mousePoint(), maxrad );
+ SkyObject *so = data->skyComposite()->objectNearest( &m_MousePoint, maxrad );
if ( so && ! isObjectLabeled( so ) ) {
setTransientObject( so );
@@ -964,7 +964,7 @@
QPoint mp( mapFromGlobal( QCursor::pos() ) );
if (! projector()->unusablePoint( mp )) {
//determine RA, Dec of mouse pointer
- setMousePoint( projector()->fromScreen( mp, data->lst(), data->geo()->lat() ) );
+ m_MousePoint = projector()->fromScreen( mp, data->lst(), data->geo()->lat() );
}
computeSkymap = true;
@@ -1102,7 +1102,7 @@
void SkyMap::updateAngleRuler() {
if( rulerMode && (!pmenu || !pmenu->isVisible()) )
- AngularRuler.setPoint( 1, mousePoint() );
+ AngularRuler.setPoint( 1, &m_MousePoint );
AngularRuler.update( data );
}
--- trunk/KDE/kdeedu/kstars/kstars/skymap.h #1224499:1224500
@@ -620,11 +620,18 @@
#endif
bool mouseButtonDown, midMouseButtonDown;
- bool mouseMoveCursor; // true if mouseMoveEvent; needed by setMouseMoveCursor
+ // true if mouseMoveEvent; needed by setMouseMoveCursor
+ bool mouseMoveCursor;
bool slewing, clockSlewing;
- bool computeSkymap; //if false only old pixmap will repainted with bitBlt(), this saves a lot of \
cpu usage
- bool rulerMode; // True if we are either looking for angular distance or star hopping directions
- bool starHopDefineMode; // True only if we are looking for star hopping directions. If false while \
rulerMode is true, it means we are measuring angular distance. FIXME: Find a better way to do this + \
//if false only old pixmap will repainted with bitBlt(), this + // saves a lot of cpu usage
+ bool computeSkymap;
+ // True if we are either looking for angular distance or star hopping directions
+ bool rulerMode;
+ // True only if we are looking for star hopping directions. If
+ // false while rulerMode is true, it means we are measuring angular
+ // distance. FIXME: Find a better way to do this
+ bool starHopDefineMode;
int scrollCount;
double y0;
@@ -633,21 +640,9 @@
KStarsData *data;
KSPopupMenu *pmenu;
- /**@short Retrieve a pointer to MousePoint, the sky coordinates of the mouse cursor.
- *
- *When the user moves the mouse in the sky map, the sky coordinates of the mouse
- *cursor are continually stored in MousePoint by the function mouseMoveEvent().
- *@return a pointer to MousePoint, the current sky coordinates of the mouse cursor.
+ /**@short Coordinates of point under cursor. It's update in
+ * function mouseMoveEvent
*/
- SkyPoint* mousePoint() { return &m_MousePoint; }
-
- /**@short Set the MousePoint to the skypoint given as an argument.
- *@note In this function, the argument is a SkyPoint, not a pointer to a SkyPoint.
- *This is because setMousePoint always uses the function dXdYToRaDec() for the
- *argument, and this function returns by value.
- *@param f the new MousePoint (typically the output of dXdYToRaDec()).
- */
- void setMousePoint( SkyPoint f ) { m_MousePoint = f; }
SkyPoint m_MousePoint;
SkyPoint Focus, ClickedPoint, FocusPoint, Destination;
--- trunk/KDE/kdeedu/kstars/kstars/skymapevents.cpp #1224499:1224500
@@ -452,8 +452,8 @@
if ( projector()->unusablePoint( e->pos() ) ) return; // break if point is unusable
//determine RA, Dec of mouse pointer
- setMousePoint( projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() ) );
- mousePoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+ m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
+ m_MousePoint.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
double dyPix = 0.5*height() - e->y();
if ( midMouseButtonDown ) { //zoom according to y-offset
@@ -479,18 +479,18 @@
//Update focus such that the sky coords at mouse cursor remain approximately constant
if ( Options::useAltAz() ) {
- mousePoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+ m_MousePoint.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
clickedPoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
- dms dAz = mousePoint()->az() - clickedPoint()->az();
- dms dAlt = mousePoint()->alt() - clickedPoint()->alt();
+ dms dAz = m_MousePoint.az() - clickedPoint()->az();
+ dms dAlt = m_MousePoint.alt() - clickedPoint()->alt();
focus()->setAz( focus()->az().Degrees() - dAz.Degrees() ); //move focus in opposite \
direction focus()->setAz( focus()->az().reduce() );
focus()->setAlt(
KSUtils::clamp( focus()->alt().Degrees() - dAlt.Degrees() , -90.0 , 90.0 ) );
focus()->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
} else {
- dms dRA = mousePoint()->ra() - clickedPoint()->ra();
- dms dDec = mousePoint()->dec() - clickedPoint()->dec();
+ dms dRA = m_MousePoint.ra() - clickedPoint()->ra();
+ dms dDec = m_MousePoint.dec() - clickedPoint()->dec();
focus()->setRA( focus()->ra().Hours() - dRA.Hours() ); //move focus in opposite direction
focus()->setRA( focus()->ra().reduce() );
focus()->setDec(
@@ -505,14 +505,14 @@
}
//redetermine RA, Dec of mouse pointer, using new focus
- setMousePoint( projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() ) );
- mousePoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
- setClickedPoint( mousePoint() );
+ m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
+ m_MousePoint.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+ setClickedPoint( &m_MousePoint );
forceUpdate(); // must be new computed
} else { //mouse button not down
- emit mousePointChanged( mousePoint() );
+ emit mousePointChanged( &m_MousePoint );
}
}
@@ -592,9 +592,9 @@
}
//determine RA, Dec of mouse pointer
- setMousePoint( projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() ) );
- mousePoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
- setClickedPoint( mousePoint() );
+ m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
+ m_MousePoint.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+ setClickedPoint( &m_MousePoint );
clickedPoint()->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
//Find object nearest to clickedPoint()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic