kstars
#include <skymap.h>

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 () |
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.
- Version
- 1.0
Member Enumeration Documentation
enum SkyMap::Projection |
Constructor & Destructor Documentation
|
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
|
slot |
Popup menu function: Add a custom Image or Information URL.
Opens the AddLinkDialog window.
Definition at line 1074 of file skymap.cpp.
|
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.
|
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.
|
static |
Definition at line 134 of file skymap.cpp.
|
inline |
|
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.
Proxy method for SkyMapDrawAbstract::drawObjectLabels()
|
inline |
Proxy method for SkyMapDrawAbstract::exportSkyImage()
|
inline |
|
inline |
|
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.
|
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.
|
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
-
now if true, paintEvent() is run immediately. Otherwise, it is added to the event queue
Definition at line 985 of file skymap.cpp.
|
inlineslot |
Convenience function; simply calls forceUpdate(true).
- See also
- forceUpdate()
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.
|
inline |
|
static |
Definition at line 141 of file skymap.cpp.
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
-
o pointer to the sky object to be tested for a User label.
Definition at line 701 of file skymap.cpp.
bool SkyMap::isSlewing | ( | ) | const |
Definition at line 1133 of file skymap.cpp.
|
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.
|
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.
|
signal |
Emitted by SkyMap::addLink().
This Signal is used to inform the Details Dialog that it needs to update its lists of URL links.
|
protectedvirtual |
Center SkyMap at double-clicked location.
Definition at line 611 of file skymapevents.cpp.
|
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.
|
signal |
Emitted when position under mouse changed.
|
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.
|
protectedvirtual |
set mouseButtonDown==false, slewing==false
Definition at line 508 of file skymapevents.cpp.
|
signal |
Emitted when current object changed.
|
signal |
Emitted when pointing changed.
(At least should)
|
inline |
|
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
-
o pointer 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
-
f pointer 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
-
f a pointer to the SkyPoint the map should slew to
Definition at line 812 of file skymap.cpp.
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
-
ra the new right ascension dec the new declination
Definition at line 816 of file skymap.cpp.
sets the destination point of the sky map, using its alt/az coordinates.
- Parameters
-
alt the new altitude az the 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
-
f a pointer to the SkyPoint the map should be centered on
Definition at line 789 of file skymap.cpp.
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
-
ra the new right ascension dec the new declination
Definition at line 793 of file skymap.cpp.
sets the focus point of the sky map, using its alt/az coordinates
- Parameters
-
alt the new altitude az the new azimuth
Definition at line 801 of file skymap.cpp.
void SkyMap::setFocusObject | ( | SkyObject * | o | ) |
Set the FocusObject pointer to the argument.
- Parameters
-
o pointer to the SkyObject to be assigned as the FocusObject
Definition at line 365 of file skymap.cpp.
|
inline |
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 | ) |
void SkyMap::showFocusCoords | ( | ) |
Update object name and coordinates in the Focus InfoBox.
Definition at line 331 of file skymap.cpp.
|
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.
|
slot |
Open Flag Manager window with clickedObject() RA and Dec entered.
Definition at line 614 of file skymap.cpp.
|
slot |
Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User Labels attached.
Definition at line 719 of file skymap.cpp.
|
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.
|
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.
|
slot |
Definition at line 500 of file skymap.cpp.
|
slot |
Definition at line 758 of file skymap.cpp.
|
slot |
Disables the angular distance measuring mode.
Nothing is printed in the status bar
Definition at line 609 of file skymap.cpp.
|
slot |
Definition at line 771 of file skymap.cpp.
|
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.
|
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.
|
slot |
Delete selected flag.
- Parameters
-
flagIdx index of flag to be deleted.
Definition at line 631 of file skymap.cpp.
|
slot |
Popup menu function: Show the Detailed Information window for ClickedObject.
Definition at line 740 of file skymap.cpp.
|
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.
|
slot |
Open Flag Manager window with selected flag focused and ready to edit.
- Parameters
-
flagIdx index of flag to be edited.
Definition at line 623 of file skymap.cpp.
|
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.
|
slot |
Definition at line 764 of file skymap.cpp.
|
slot |
Popup menu function: Show image of ClickedObject (only available for some objects).
Definition at line 643 of file skymap.cpp.
|
slot |
Popup menu function: Show webpage about ClickedObject (only available for some objects).
Definition at line 672 of file skymap.cpp.
|
slot |
Object pointing for Printing Wizard done.
Definition at line 751 of file skymap.cpp.
|
slot |
Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User Labels attached.
Definition at line 714 of file skymap.cpp.
|
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.
|
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.
|
slot |
Toggle visibility of focus infobox.
Definition at line 275 of file skymap.cpp.
|
slot |
Toggle visibility of geo infobox.
Definition at line 271 of file skymap.cpp.
|
slot |
Toggle visibility of all infoboxes.
Definition at line 283 of file skymap.cpp.
|
slot |
Toggle visibility of time infobox.
Definition at line 279 of file skymap.cpp.
|
slot |
Set default zoom.
Definition at line 972 of file skymap.cpp.
|
slot |
Zoom in one step.
Definition at line 964 of file skymap.cpp.
|
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.
|
protectedvirtual |
Zoom in and out with the mouse wheel.
Definition at line 501 of file skymapevents.cpp.
|
signal |
Emitted when zoom level is changed.
The documentation for this class was generated from the following files:
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.