• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SkyMap Class Reference

#include <skymap.h>

Inheritance diagram for SkyMap:
Inheritance graph
[legend]

Public Types

enum  Projection {
  Lambert, AzimuthalEquidistant, Orthographic, Equirectangular,
  Stereographic, Gnomonic, UnknownProjection
}
 

Public Slots

void addLink ()
 
void forceUpdate (bool now=false)
 
void forceUpdateNow ()
 
void slewFocus ()
 
void slotAddFlag ()
 
void slotAddObjectLabel ()
 
void slotAddPlanetTrail ()
 
void slotBeginAngularDistance ()
 
void slotBeginStarHop ()
 
void slotCancelLegendPreviewMode ()
 
void slotCancelRulerMode ()
 
void slotCaptureFov ()
 
void slotCenter ()
 
void slotClockSlewing ()
 
void slotDeleteFlag (int flagIdx)
 
void slotDetail ()
 
void slotDSS ()
 
void slotEditFlag (int flagIdx)
 
void slotEndRulerMode ()
 
void slotFinishFovCaptureMode ()
 
void slotImage ()
 
void slotInfo ()
 
void slotObjectSelected ()
 
void slotRemoveObjectLabel ()
 
void slotRemovePlanetTrail ()
 
void slotSDSS ()
 
void slotToggleFocusBox (bool)
 
void slotToggleGeoBox (bool)
 
void slotToggleInfoboxes (bool)
 
void slotToggleTimeBox (bool)
 
void slotZoomDefault ()
 
void slotZoomIn ()
 
void slotZoomOut ()
 

Signals

void destinationChanged ()
 
void linkAdded ()
 
void mousePointChanged (SkyPoint *)
 
void objectChanged (SkyObject *)
 
void positionChanged (SkyPoint *)
 
void zoomChanged ()
 

Public Member Functions

 ~SkyMap ()
 
SkyObject * clickedObject () const
 
SkyPoint * clickedPoint ()
 
SkyPoint * destination ()
 
void drawObjectLabels (QList< SkyObject * > &labelObjects)
 
void exportSkyImage (QPaintDevice *pd, bool scale=false)
 
void exportSkyImage (SkyQPainter *painter, bool scale=false)
 
SkyPoint * focus ()
 
SkyObject * focusObject () const
 
SkyPoint * focusPoint ()
 
float fov ()
 
SkyPoint getCenterPoint ()
 
SkyMapDrawAbstract * getSkyMapDrawAbstract ()
 
bool isInFovCaptureMode ()
 
bool isInObjectPointingMode ()
 
bool isObjectLabeled (SkyObject *o)
 
bool isSlewing () const
 
const Projector * projector () const
 
void setClickedObject (SkyObject *o)
 
void setClickedPoint (SkyPoint *f)
 
void setDestination (const SkyPoint &f)
 
void setDestination (const dms &ra, const dms &dec)
 
void setDestinationAltAz (const dms &alt, const dms &az)
 
void setFocus (SkyPoint *f)
 
void setFocus (const dms &ra, const dms &dec)
 
void setFocusAltAz (const dms &alt, const dms &az)
 
void setFocusObject (SkyObject *o)
 
void setFocusPoint (SkyPoint *f)
 
void setFovCaptureMode (bool enabled)
 
void setLegend (const Legend &legend)
 
void setObjectPointingMode (bool enabled)
 
void setPreviewLegend (bool preview)
 
void setupProjector ()
 
void setZoomFactor (double factor)
 
void showFocusCoords ()
 
void stopTracking ()
 
void updateAngleRuler ()
 
void updateFocus ()
 

Static Public Member Functions

static SkyMap * Create ()
 
static SkyMap * Instance ()
 
static bool IsSlewing ()
 

Protected Member Functions

 SkyMap ()
 
virtual void keyPressEvent (QKeyEvent *e)
 
virtual void keyReleaseEvent (QKeyEvent *e)
 
virtual void mouseDoubleClickEvent (QMouseEvent *e)
 
virtual void mouseMoveEvent (QMouseEvent *e)
 
virtual void mousePressEvent (QMouseEvent *e)
 
virtual void mouseReleaseEvent (QMouseEvent *e)
 
virtual void resizeEvent (QResizeEvent *)
 
virtual void wheelEvent (QWheelEvent *e)
 

Detailed Description

This is the canvas on which the sky is painted.

It's the main widget for KStars. Contains SkyPoint members for the map's Focus (current central position), Destination (requested central position), FocusPoint (next queued position to be focused), MousePoint (position of mouse cursor), and ClickedPoint (position of last mouse click). Also contains the InfoBoxes for on-screen data display.

SkyMap handles most user interaction events (both mouse and keyboard).

Canvas widget for displaying the sky bitmap; also handles user interaction events.

Author
Jason Harris
Version
1.0

Definition at line 72 of file skymap.h.

Member Enumeration Documentation

enum SkyMap::Projection
Enumerator
Lambert 
AzimuthalEquidistant 
Orthographic 
Equirectangular 
Stereographic 
Gnomonic 
UnknownProjection 

Definition at line 96 of file skymap.h.

Constructor & Destructor Documentation

SkyMap::SkyMap ( )
explicitprotected

Constructor.

Read stored settings from KConfig object (focus position, zoom factor, sky color, etc.). Run initPopupMenus().

Definition at line 146 of file skymap.cpp.

SkyMap::~SkyMap ( )

Destructor (empty)

Definition at line 287 of file skymap.cpp.

Member Function Documentation

void SkyMap::addLink ( )
slot

Popup menu function: Add a custom Image or Information URL.

Opens the AddLinkDialog window.

Definition at line 1074 of file skymap.cpp.

SkyObject* SkyMap::clickedObject ( ) const
inline

Retrieve the object nearest to a mouse click event.

If the user clicks on the sky map, a pointer to the nearest SkyObject is stored in the private member ClickedObject. This function returns the ClickedObject pointer, or NULL if there is no CLickedObject.

Returns
a pointer to the object nearest to a user mouse click.

Definition at line 214 of file skymap.h.

SkyPoint* SkyMap::clickedPoint ( )
inline

Retrieve the ClickedPoint position.

When the user clicks on a point in the sky map, the sky coordinates of the mouse cursor are stored in the private member ClickedPoint. This function retrieves a pointer to ClickedPoint.

Returns
a pointer to ClickedPoint, the sky coordinates where the user clicked.

Definition at line 200 of file skymap.h.

SkyMap * SkyMap::Create ( )
static

Definition at line 134 of file skymap.cpp.

SkyPoint* SkyMap::destination ( )
inline

retrieve the Destination position.

The Destination is the point on the sky to which the focus will be moved.

Returns
a pointer to the destination point of the sky map

Definition at line 129 of file skymap.h.

void SkyMap::destinationChanged ( )
signal

Emitted by setDestination(), and connected to slewFocus().

Whenever the Destination point is changed, slewFocus() will iteratively step the Focus toward Destination until it is reached.

See also
SkyMap::setDestination()
SkyMap::slewFocus()
void SkyMap::drawObjectLabels ( QList< SkyObject * > &  labelObjects)
inline

Proxy method for SkyMapDrawAbstract::drawObjectLabels()

Definition at line 279 of file skymap.h.

void SkyMap::exportSkyImage ( QPaintDevice *  pd,
bool  scale = false 
)
inline

Proxy method for SkyMapDrawAbstract::exportSkyImage()

Definition at line 270 of file skymap.h.

void SkyMap::exportSkyImage ( SkyQPainter *  painter,
bool  scale = false 
)
inline

Definition at line 272 of file skymap.h.

SkyPoint* SkyMap::focus ( )
inline

Retrieve the Focus point; the position on the sky at the center of the skymap.

Returns
a pointer to the central focus point of the sky map

Definition at line 120 of file skymap.h.

SkyObject* SkyMap::focusObject ( ) const
inline

Retrieve the object which is centered in the sky map.

If the user centers the sky map on an object (by double-clicking or using the Find Object dialog), a pointer to the "focused" object is stored in the private member FocusObject. This function returns a pointer to the FocusObject, or NULL if there is not FocusObject.

Returns
a pointer to the object at the center of the sky map.

Definition at line 229 of file skymap.h.

SkyPoint* SkyMap::focusPoint ( )
inline

retrieve the FocusPoint position.

The FocusPoint stores the position on the sky that is to be focused next. This is not exactly the same as the Destination point, because when the Destination is set, it will begin slewing immediately.

Returns
a pointer to the sky point which is to be focused next.

Definition at line 140 of file skymap.h.

void SkyMap::forceUpdate ( bool  now = false)
slot

Recalculates the positions of objects in the sky, and then repaints the sky map.

If the positions don't need to be recalculated, use update() instead of forceUpdate(). This saves a lot of CPU time.

Parameters
nowif true, paintEvent() is run immediately. Otherwise, it is added to the event queue

Definition at line 985 of file skymap.cpp.

void SkyMap::forceUpdateNow ( )
inlineslot

Convenience function; simply calls forceUpdate(true).

See also
forceUpdate()

Definition at line 306 of file skymap.h.

float SkyMap::fov ( )
Returns
the angular field of view of the sky map, in degrees.
Note
it must use either the height or the width of the window to calculate the FOV angle. It chooses whichever is larger.

Definition at line 1005 of file skymap.cpp.

SkyPoint SkyMap::getCenterPoint ( )

Definition at line 705 of file skymap.cpp.

SkyMapDrawAbstract* SkyMap::getSkyMapDrawAbstract ( )
inline

Definition at line 274 of file skymap.h.

SkyMap * SkyMap::Instance ( )
static

Definition at line 141 of file skymap.cpp.

bool SkyMap::isInFovCaptureMode ( )
inline

Definition at line 291 of file skymap.h.

bool SkyMap::isInObjectPointingMode ( )
inline

Definition at line 285 of file skymap.h.

bool SkyMap::isObjectLabeled ( SkyObject *  o)
Returns
true if the object currently has a user label attached.
Note
this function only checks for a label explicitly added to the object with the right-click popup menu; other kinds of labels are not detected by this function.
Parameters
opointer to the sky object to be tested for a User label.

Definition at line 701 of file skymap.cpp.

static bool SkyMap::IsSlewing ( )
inlinestatic

Definition at line 91 of file skymap.h.

bool SkyMap::isSlewing ( ) const

Definition at line 1133 of file skymap.cpp.

void SkyMap::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Process keystrokes:

  • arrow keys Slew the map
  • +/- keys Zoom in and out
  • Space Toggle between Horizontal and Equatorial coordinate systems
  • 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon)
  • [ Place starting point for measuring an angular distance
  • ] End point for Angular Distance; display measurement.
  • Escape Cancel Angular measurement
  • ,/< Step backward one time step
  • ./> Step forward one time step

Definition at line 71 of file skymapevents.cpp.

void SkyMap::keyReleaseEvent ( QKeyEvent *  e)
protectedvirtual

When keyRelease is triggered, just set the "slewing" flag to false, and update the display (to draw objects that are hidden when slewing==true).

Definition at line 381 of file skymapevents.cpp.

void SkyMap::linkAdded ( )
signal

Emitted by SkyMap::addLink().

This Signal is used to inform the Details Dialog that it needs to update its lists of URL links.

void SkyMap::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual

Center SkyMap at double-clicked location.

Definition at line 611 of file skymapevents.cpp.

void SkyMap::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

This function does several different things depending on the state of the program:

  • If Angle-measurement mode is active, update the end-ruler point to the mouse cursor, and continue this function.
  • If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen, and return.
  • If dragging the mouse in the map, update focus such that RA, Dec under the mouse cursor remains constant.
  • If just moving the mouse, simply update the curso coordinates in the status bar.

Definition at line 405 of file skymapevents.cpp.

void SkyMap::mousePointChanged ( SkyPoint *  )
signal

Emitted when position under mouse changed.

void SkyMap::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Determine RA, Dec coordinates of clicked location.

Find the SkyObject which is nearest to the clicked location.

If left-clicked: Set set mouseButtonDown==true, slewing==true; display nearest object name in status bar. If right-clicked: display popup menu appropriate for nearest object.

Definition at line 543 of file skymapevents.cpp.

void SkyMap::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

set mouseButtonDown==false, slewing==false

Definition at line 508 of file skymapevents.cpp.

void SkyMap::objectChanged ( SkyObject *  )
signal

Emitted when current object changed.

void SkyMap::positionChanged ( SkyPoint *  )
signal

Emitted when pointing changed.

(At least should)

const Projector* SkyMap::projector ( ) const
inline

Get the current projector.

Returns
a pointer to the current projector.

Definition at line 264 of file skymap.h.

void SkyMap::resizeEvent ( QResizeEvent *  )
protectedvirtual

If the skymap will be resized, the sky must be new computed.

So this function calls explicitly new computing of the skymap.

Definition at line 55 of file skymapevents.cpp.

void SkyMap::setClickedObject ( SkyObject *  o)

Set the ClickedObject pointer to the argument.

Parameters
opointer to the SkyObject to be assigned as the ClickedObject

Definition at line 361 of file skymap.cpp.

void SkyMap::setClickedPoint ( SkyPoint *  f)

Set the ClickedPoint to the skypoint given as an argument.

Parameters
fpointer to the new ClickedPoint.

Definition at line 829 of file skymap.cpp.

void SkyMap::setDestination ( const SkyPoint &  f)

sets the destination point of the sky map.

Note
setDestination() emits the destinationChanged() SIGNAL, which triggers the SLOT function SkyMap::slewFocus(). This function iteratively steps the Focus point toward Destination, repainting the sky at each step (if Options::useAnimatedSlewing()==true).
Parameters
fa pointer to the SkyPoint the map should slew to

Definition at line 812 of file skymap.cpp.

void SkyMap::setDestination ( const dms &  ra,
const dms &  dec 
)

sets the destination point of the skymap, using ra/dec coordinates.

Note
This function behaves essentially like the above function. It differs only in the data types of its arguments.
Parameters
rathe new right ascension
decthe new declination

Definition at line 816 of file skymap.cpp.

void SkyMap::setDestinationAltAz ( const dms &  alt,
const dms &  az 
)

sets the destination point of the sky map, using its alt/az coordinates.

Parameters
altthe new altitude
azthe new azimuth

Definition at line 822 of file skymap.cpp.

void SkyMap::setFocus ( SkyPoint *  f)

sets the central focus point of the sky map.

Parameters
fa pointer to the SkyPoint the map should be centered on

Definition at line 789 of file skymap.cpp.

void SkyMap::setFocus ( const dms &  ra,
const dms &  dec 
)

sets the focus point of the skymap, using ra/dec coordinates

Note
This function behaves essentially like the above function. It differs only in the data types of its arguments.
Parameters
rathe new right ascension
decthe new declination

Definition at line 793 of file skymap.cpp.

void SkyMap::setFocusAltAz ( const dms &  alt,
const dms &  az 
)

sets the focus point of the sky map, using its alt/az coordinates

Parameters
altthe new altitude
azthe new azimuth

Definition at line 801 of file skymap.cpp.

void SkyMap::setFocusObject ( SkyObject *  o)

Set the FocusObject pointer to the argument.

Parameters
opointer to the SkyObject to be assigned as the FocusObject

Definition at line 365 of file skymap.cpp.

void SkyMap::setFocusPoint ( SkyPoint *  f)
inline

set the FocusPoint; the position that is to be the next Destination.

Parameters
fa pointer to the FocusPoint SkyPoint.

Definition at line 191 of file skymap.h.

void SkyMap::setFovCaptureMode ( bool  enabled)
inline

Definition at line 289 of file skymap.h.

void SkyMap::setLegend ( const Legend &  legend)
inline

Definition at line 283 of file skymap.h.

void SkyMap::setObjectPointingMode ( bool  enabled)
inline

Definition at line 287 of file skymap.h.

void SkyMap::setPreviewLegend ( bool  preview)
inline

Definition at line 281 of file skymap.h.

void SkyMap::setupProjector ( )

Call to set up the projector before a draw cycle.

Definition at line 1010 of file skymap.cpp.

void SkyMap::setZoomFactor ( double  factor)

@ Set zoom factor.

Parameters
factorzoom factor

Definition at line 976 of file skymap.cpp.

void SkyMap::showFocusCoords ( )

Update object name and coordinates in the Focus InfoBox.

Definition at line 331 of file skymap.cpp.

void SkyMap::slewFocus ( )
slot

Step the Focus point toward the Destination point.

Do this iteratively, redrawing the Sky Map after each step, until the Focus point is within 1 step of the Destination point. For the final step, snap directly to Destination, and redraw the map.

Definition at line 867 of file skymap.cpp.

void SkyMap::slotAddFlag ( )
slot

Open Flag Manager window with clickedObject() RA and Dec entered.

Definition at line 614 of file skymap.cpp.

void SkyMap::slotAddObjectLabel ( )
slot

Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User Labels attached.

Definition at line 719 of file skymap.cpp.

void SkyMap::slotAddPlanetTrail ( )
slot

Add a Planet Trail to ClickedObject.

Note
Trails are added simply by calling KSPlanetBase::addToTrail() to add the first point. as long as the trail is not empty, new points will be automatically appended to it.
if ClickedObject is not a Solar System body, this function does nothing.
See also
KSPlanetBase::addToTrail()

Definition at line 732 of file skymap.cpp.

void SkyMap::slotBeginAngularDistance ( )
slot

Enables the angular distance measuring mode.

It saves the first position of the ruler in a SkyPoint. It makes difference between having clicked on the skymap and not having done so

Definition at line 496 of file skymap.cpp.

void SkyMap::slotBeginStarHop ( )
slot

Definition at line 500 of file skymap.cpp.

void SkyMap::slotCancelLegendPreviewMode ( )
slot

Definition at line 758 of file skymap.cpp.

void SkyMap::slotCancelRulerMode ( void  )
slot

Disables the angular distance measuring mode.

Nothing is printed in the status bar

Definition at line 609 of file skymap.cpp.

void SkyMap::slotCaptureFov ( )
slot

Definition at line 771 of file skymap.cpp.

void SkyMap::slotCenter ( )
slot

Center the display at the point ClickedPoint.

The essential part of the function is to simply set the Destination point, which will emit the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this function performs some bookkeeping tasks, such updating whether we are tracking the new object/position, adding a Planet Trail if required, etc.

See also
destinationChanged()
slewFocus()

Definition at line 373 of file skymap.cpp.

void SkyMap::slotClockSlewing ( )
slot

Checks whether the timestep exceeds a threshold value.

If so, sets ClockSlewing=true and sets the SimClock to ManualMode.

Definition at line 777 of file skymap.cpp.

void SkyMap::slotDeleteFlag ( int  flagIdx)
slot

Delete selected flag.

Parameters
flagIdxindex of flag to be deleted.

Definition at line 631 of file skymap.cpp.

void SkyMap::slotDetail ( )
slot

Popup menu function: Show the Detailed Information window for ClickedObject.

Definition at line 740 of file skymap.cpp.

void SkyMap::slotDSS ( )
slot

Popup menu function: Display 1st-Generation DSS image with the Image Viewer.

Note
the URL is generated using the coordinates of ClickedPoint.

Definition at line 434 of file skymap.cpp.

void SkyMap::slotEditFlag ( int  flagIdx)
slot

Open Flag Manager window with selected flag focused and ready to edit.

Parameters
flagIdxindex of flag to be edited.

Definition at line 623 of file skymap.cpp.

void SkyMap::slotEndRulerMode ( )
slot

Computes the angular distance, prints the result in the status bar and disables the angular distance measuring mode If the user has clicked on the map the status bar shows the name of the clicked object plus the angular distance.

If the user did not clicked on the map, just pressed ], only the angular distance is printed

Definition at line 524 of file skymap.cpp.

void SkyMap::slotFinishFovCaptureMode ( )
slot

Definition at line 764 of file skymap.cpp.

void SkyMap::slotImage ( )
slot

Popup menu function: Show image of ClickedObject (only available for some objects).

Definition at line 643 of file skymap.cpp.

void SkyMap::slotInfo ( )
slot

Popup menu function: Show webpage about ClickedObject (only available for some objects).

Definition at line 672 of file skymap.cpp.

void SkyMap::slotObjectSelected ( )
slot

Object pointing for Printing Wizard done.

Definition at line 751 of file skymap.cpp.

void SkyMap::slotRemoveObjectLabel ( )
slot

Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User Labels attached.

Definition at line 714 of file skymap.cpp.

void SkyMap::slotRemovePlanetTrail ( )
slot

Remove the PlanetTrail from ClickedObject.

Note
The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as the trail is empty, no new points will be automatically appended.
See also
KSPlanetBase::clearTrail()

Definition at line 724 of file skymap.cpp.

void SkyMap::slotSDSS ( )
slot

Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer.

Note
the URL is generated using the coordinates of ClickedPoint.

Definition at line 460 of file skymap.cpp.

void SkyMap::slotToggleFocusBox ( bool  flag)
slot

Toggle visibility of focus infobox.

Definition at line 275 of file skymap.cpp.

void SkyMap::slotToggleGeoBox ( bool  flag)
slot

Toggle visibility of geo infobox.

Definition at line 271 of file skymap.cpp.

void SkyMap::slotToggleInfoboxes ( bool  flag)
slot

Toggle visibility of all infoboxes.

Definition at line 283 of file skymap.cpp.

void SkyMap::slotToggleTimeBox ( bool  flag)
slot

Toggle visibility of time infobox.

Definition at line 279 of file skymap.cpp.

void SkyMap::slotZoomDefault ( )
slot

Set default zoom.

Definition at line 972 of file skymap.cpp.

void SkyMap::slotZoomIn ( )
slot

Zoom in one step.

Definition at line 964 of file skymap.cpp.

void SkyMap::slotZoomOut ( )
slot

Zoom out one step.

Definition at line 968 of file skymap.cpp.

void SkyMap::stopTracking ( )

Definition at line 374 of file skymapevents.cpp.

void SkyMap::updateAngleRuler ( )

update the geometry of the angle ruler.

Definition at line 1127 of file skymap.cpp.

void SkyMap::updateFocus ( )

Update the focus position according to current options.

Definition at line 833 of file skymap.cpp.

void SkyMap::wheelEvent ( QWheelEvent *  e)
protectedvirtual

Zoom in and out with the mouse wheel.

Definition at line 501 of file skymapevents.cpp.

void SkyMap::zoomChanged ( )
signal

Emitted when zoom level is changed.


The documentation for this class was generated from the following files:
  • skymap.h
  • skymap.cpp
  • skymapevents.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal