Kstars

skymap.h
1/*
2 SPDX-FileCopyrightText: 2001 Jason Harris <jharris@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "config-kstars.h"
10
11#include "skymapdrawabstract.h"
12#include "printing/legend.h"
13#include "skyobjects/skypoint.h"
14#include "skyobjects/skyline.h"
15#include "nan.h"
16
17#include <QGraphicsView>
18#include <QtGlobal>
19#include <QTimer>
20
21class QPainter;
22class QPaintDevice;
23
24class dms;
25class InfoBoxes;
26class InfoBoxWidget;
27class KSPopupMenu;
28class KStarsData;
29class Projector;
30class SkyObject;
31
32#ifdef HAVE_OPENGL
33class SkyMapGLDraw;
34class SkyMapQDraw;
35#endif
36
37/**
38 * @class SkyMap
39 *
40 * This is the canvas on which the sky is painted. It's the main widget for KStars.
41 * Contains SkyPoint members for the map's Focus (current central position), Destination
42 * (requested central position), FocusPoint (next queued position to be focused),
43 * MousePoint (position of mouse cursor), and ClickedPoint (position of last mouse click).
44 * Also contains the InfoBoxes for on-screen data display.
45 *
46 * SkyMap handles most user interaction events (both mouse and keyboard).
47 *
48 * @short Canvas widget for displaying the sky bitmap; also handles user interaction events.
49 *
50 * @author Jason Harris
51 * @version 1.0
52 */
53class SkyMap : public QGraphicsView
54{
56
57 friend class SkyMapDrawAbstract; // FIXME: SkyMapDrawAbstract requires a lot of access to SkyMap
58 friend class SkyMapQDraw; // FIXME: SkyMapQDraw requires access to computeSkymap
59
60 protected:
61 /**
62 *Constructor. Read stored settings from KConfig object (focus position,
63 *zoom factor, sky color, etc.). Run initPopupMenus().
64 */
65 SkyMap();
66
67 public:
68 static SkyMap *Create();
69
70 static SkyMap *Instance();
71
72 static bool IsFocused()
73 {
74 //return (pinstance->focusObject() || pinstance->focusPoint());
75 return (pinstance->focusObject());
76 }
77
78 static bool IsSlewing()
79 {
80 return pinstance->isSlewing();
81 }
82
83 /** Destructor (empty) */
84 ~SkyMap() override;
85
86 enum Projection
87 {
88 Lambert,
89 AzimuthalEquidistant,
90 Orthographic,
91 Equirectangular,
92 Stereographic,
93 Gnomonic,
94 UnknownProjection
95 };
96
97 enum Cursor
98 {
99 NoCursor,
100 Cross,
101 Circle,
102 };
103
104 /** @return the angular field of view of the sky map, in degrees.
105 *@note it must use either the height or the width of the window to calculate the
106 *FOV angle. It chooses whichever is larger.
107 */
108 float fov();
109
110 /** @short Update object name and coordinates in the Focus InfoBox */
111 void showFocusCoords();
112
113 /** @brief Update info boxes coordinates */
114 void updateInfoBoxes();
115
116 /** @short Update the focus position according to current options. */
117 void updateFocus();
118
119 /** @short Retrieve the Focus point; the position on the sky at the
120 *center of the skymap.
121 *@return a pointer to the central focus point of the sky map
122 */
124 {
125 return &Focus;
126 }
127
128 /** @short retrieve the Destination position.
129 *
130 *The Destination is the point on the sky to which the focus will
131 *be moved.
132 *
133 *@return a pointer to the destination point of the sky map
134 */
136 {
137 return &Destination;
138 }
139
140 /** @short retrieve the FocusPoint position.
141 *
142 *The FocusPoint stores the position on the sky that is to be
143 *focused next. This is not exactly the same as the Destination
144 *point, because when the Destination is set, it will begin slewing
145 *immediately.
146 *
147 *@return a pointer to the sky point which is to be focused next.
148 */
150 {
151 return &FocusPoint;
152 }
153
154 /** @short sets the central focus point of the sky map.
155 *@param f a pointer to the SkyPoint the map should be centered on
156 */
157 void setFocus(SkyPoint *f);
158
159 /** @short sets the focus point of the skymap, using ra/dec coordinates
160 *
161 *@note This function behaves essentially like the above function.
162 *It differs only in the data types of its arguments.
163 *
164 *@param ra the new right ascension
165 *@param dec the new declination
166 */
167 void setFocus(const dms &ra, const dms &dec);
168
169 /** @short sets the focus point of the sky map, using its alt/az coordinates
170 *@param alt the new altitude (actual, without refraction correction)
171 *@param az the new azimuth
172 */
173 void setFocusAltAz(const dms &alt, const dms &az);
174
175 /** @short sets the destination point of the sky map.
176 *@note setDestination() emits the destinationChanged() SIGNAL,
177 *which triggers the SLOT function SkyMap::slewFocus(). This
178 *function iteratively steps the Focus point toward Destination,
179 *repainting the sky at each step (if Options::useAnimatedSlewing()==true).
180 *@param f a pointer to the SkyPoint the map should slew to
181 */
182 void setDestination(const SkyPoint &f);
183
184 /** @short sets the destination point of the skymap, using ra/dec coordinates.
185 *
186 *@note This function behaves essentially like the above function.
187 *It differs only in the data types of its arguments.
188 *
189 *@param ra the new right ascension
190 *@param dec the new declination
191 */
192 void setDestination(const dms &ra, const dms &dec);
193
194 /** @short sets the destination point of the sky map, using its alt/az coordinates.
195 *@param alt the new altitude
196 *@param az the new azimuth
197 *@param altIsRefracted set to true if the altitude supplied is apparent
198 */
199 void setDestinationAltAz(const dms &alt, const dms &az, bool altIsRefracted);
200
201 /** @short set the FocusPoint; the position that is to be the next Destination.
202 *@param f a pointer to the FocusPoint SkyPoint.
203 */
205 {
206 if (f)
207 FocusPoint = *f;
208 }
209
210 /** @short Retrieve the ClickedPoint position.
211 *
212 *When the user clicks on a point in the sky map, the sky coordinates of the mouse
213 *cursor are stored in the private member ClickedPoint. This function retrieves
214 *a pointer to ClickedPoint.
215 *@return a pointer to ClickedPoint, the sky coordinates where the user clicked.
216 */
218 {
219 return &ClickedPoint;
220 }
221
222 /**
223 * @short Retrieve the mouse pointer position.
224 *
225 * @return The sky coordinates where the mouse pointer is over.
226 */
228 {
229 return &m_MousePoint;
230 }
231
232 /** @short Set the ClickedPoint to the skypoint given as an argument.
233 *@param f pointer to the new ClickedPoint.
234 */
235 void setClickedPoint(const SkyPoint *f);
236
237 /** @short Retrieve the object nearest to a mouse click event.
238 *
239 *If the user clicks on the sky map, a pointer to the nearest SkyObject is stored in
240 *the private member ClickedObject. This function returns the ClickedObject pointer,
241 *or nullptr if there is no CLickedObject.
242 *@return a pointer to the object nearest to a user mouse click.
243 */
245 {
246 return ClickedObject;
247 }
248
249 /** @short Set the ClickedObject pointer to the argument.
250 *@param o pointer to the SkyObject to be assigned as the ClickedObject
251 */
253
254 /** @short Retrieve the object which is centered in the sky map.
255 *
256 *If the user centers the sky map on an object (by double-clicking or using the
257 *Find Object dialog), a pointer to the "focused" object is stored in
258 *the private member FocusObject. This function returns a pointer to the
259 *FocusObject, or nullptr if there is not FocusObject.
260 *@return a pointer to the object at the center of the sky map.
261 */
263 {
264 return FocusObject;
265 }
266
267 /** @short Set the FocusObject pointer to the argument.
268 *@param o pointer to the SkyObject to be assigned as the FocusObject
269 */
270 void setFocusObject(SkyObject *o);
271
272 /** @short Call to set up the projector before a draw cycle. */
273 void setupProjector();
274
275 /** @ Set zoom factor.
276 *@param factor zoom factor
277 */
278 void setZoomFactor(double factor);
279
280 bool isSlewing() const;
281
282 // NOTE: This method is draw-backend independent.
283 /** @short update the geometry of the angle ruler. */
284 void updateAngleRuler();
285
286 /** @return true if the object currently has a user label attached.
287 *@note this function only checks for a label explicitly added to the object
288 *with the right-click popup menu; other kinds of labels are not detected by
289 *this function.
290 *@param o pointer to the sky object to be tested for a User label.
291 */
292 bool isObjectLabeled(SkyObject *o);
293
294 /*@*@short Convenience function for shutting off tracking mode. Just calls KStars::slotTrack().
295 */
296 void stopTracking();
297
298 /** Get the current projector.
299 @return a pointer to the current projector. */
300 inline const Projector *projector() const
301 {
302 return m_proj;
303 }
304
305 // NOTE: These dynamic casts must not segfault. If they do, it's good because we know that there is a problem.
306 /**
307 *@short Proxy method for SkyMapDrawAbstract::exportSkyImage()
308 */
309 inline void exportSkyImage(QPaintDevice *pd, bool scale = false)
310 {
311 dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->exportSkyImage(pd, scale);
312 }
313
314 inline void exportSkyImage(SkyQPainter *painter, bool scale = false)
315 {
316 dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->exportSkyImage(painter, scale);
317 }
318
319 SkyMapDrawAbstract *getSkyMapDrawAbstract()
320 {
321 return dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw);
322 }
323
324 /**
325 *@short Proxy method for SkyMapDrawAbstract::drawObjectLabels()
326 */
327 inline void drawObjectLabels(QList<SkyObject *> &labelObjects)
328 {
329 dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->drawObjectLabels(labelObjects);
330 }
331
332 void setPreviewLegend(bool preview)
333 {
334 m_previewLegend = preview;
335 }
336
337 void setLegend(const Legend &legend)
338 {
339 m_legend = legend;
340 }
341
342 bool isInObjectPointingMode() const
343 {
344 return m_objPointingMode;
345 }
346
347 void setObjectPointingMode(bool enabled)
348 {
349 m_objPointingMode = enabled;
350 }
351
352 void setFovCaptureMode(bool enabled)
353 {
354 m_fovCaptureMode = enabled;
355 }
356
357 bool isInFovCaptureMode() const
358 {
359 return m_fovCaptureMode;
360 }
361
362 /** @short Sets the shape of the default mouse cursor. */
363 void setMouseCursorShape(Cursor type);
364
365 SkyPoint getCenterPoint();
366
367 public slots:
368 /** Recalculates the positions of objects in the sky, and then repaints the sky map.
369 * If the positions don't need to be recalculated, use update() instead of forceUpdate().
370 * This saves a lot of CPU time.
371 * @param now if true, paintEvent() is run immediately. Otherwise, it is added to the event queue
372 */
373 void forceUpdate(bool now = false);
374
375 /** @short Convenience function; simply calls forceUpdate(true).
376 * @see forceUpdate()
377 */
379 {
380 forceUpdate(true);
381 }
382
383 /**
384 * @short Update the focus point and call forceUpdate()
385 * @param now is passed on to forceUpdate()
386 */
387 void slotUpdateSky(bool now);
388
389 /** Toggle visibility of geo infobox */
390 void slotToggleGeoBox(bool);
391
392 /** Toggle visibility of focus infobox */
393 void slotToggleFocusBox(bool);
394
395 /** Toggle visibility of time infobox */
396 void slotToggleTimeBox(bool);
397
398 /** Toggle visibility of all infoboxes */
399 void slotToggleInfoboxes(bool);
400
401 /** Sets the base sky rotation (before correction) to the given angle */
402 void slotSetSkyRotation(double angle);
403
404 /** Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky
405 * Map after each step, until the Focus point is within 1 step of the Destination point.
406 * For the final step, snap directly to Destination, and redraw the map.
407 */
408 void slewFocus();
409
410 /** @short Center the display at the point ClickedPoint.
411 *
412 * The essential part of the function is to simply set the Destination point, which will emit
413 * the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this
414 * function performs some bookkeeping tasks, such updating whether we are tracking the new
415 * object/position, adding a Planet Trail if required, etc.
416 *
417 * @see destinationChanged()
418 * @see slewFocus()
419 */
420 void slotCenter();
421
422 /** @short Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
423 * @note the URL is generated using the coordinates of ClickedPoint.
424 */
425 void slotDSS();
426
427 /** @short Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer.
428 * @note the URL is generated using the coordinates of ClickedPoint.
429 */
430 void slotSDSS();
431
432 /**
433 * @brief slotCopyCoordinates Copies J2000 and JNow equatorial coordinates to the clipboard in addition to horizontal coords.
434 */
435 void slotCopyCoordinates();
436
437 /**
438 * @brief slotCopyTLE Copy satellite TLE to clipboard.
439 */
440 void slotCopyTLE();
441
442 /** @short Popup menu function: Show webpage about ClickedObject
443 * (only available for some objects).
444 */
445 void slotInfo();
446
447 /** @short Popup menu function: Show image of ClickedObject
448 * (only available for some objects).
449 */
450 void slotImage();
451
452 /** @short Popup menu function: Show the Detailed Information window for ClickedObject. */
453 void slotDetail();
454
455 /** Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which
456 * have User Labels attached.
457 */
458 void slotAddObjectLabel();
459
460 /** Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which
461 * have User Labels attached.
462 */
464
465 /** Remove custom object from internet search in the local catalog */
467
468 /** @short Add a Planet Trail to ClickedObject.
469 * @note Trails are added simply by calling KSPlanetBase::addToTrail() to add the first point.
470 * as long as the trail is not empty, new points will be automatically appended to it.
471 * @note if ClickedObject is not a Solar System body, this function does nothing.
472 * @see KSPlanetBase::addToTrail()
473 */
474 void slotAddPlanetTrail();
475
476 /** @short Remove the PlanetTrail from ClickedObject.
477 * @note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as
478 * the trail is empty, no new points will be automatically appended.
479 * @see KSPlanetBase::clearTrail()
480 */
482
483 /** @short Render a fading text label on the screen to flash information */
484 void slotDisplayFadingText(const QString &text);
485
486 /** Checks whether the timestep exceeds a threshold value. If so, sets
487 * ClockSlewing=true and sets the SimClock to ManualMode.
488 */
489 void slotClockSlewing();
490
491 /** Enables the angular distance measuring mode. It saves the first
492 * position of the ruler in a SkyPoint. It makes difference between
493 * having clicked on the skymap and not having done so
494 * \note This method is draw-backend independent.
495 */
497
498 void slotBeginStarHop(); // TODO: Add docs
499
500 /** Computes the angular distance, prints the result in the status
501 * bar and disables the angular distance measuring mode
502 * If the user has clicked on the map the status bar shows the
503 * name of the clicked object plus the angular distance. If
504 * the user did not clicked on the map, just pressed ], only
505 * the angular distance is printed
506 * \note This method is draw-backend independent.
507 */
508 void slotEndRulerMode();
509
510 /** Disables the angular distance measuring mode. Nothing is printed
511 * in the status bar */
512 void slotCancelRulerMode();
513
514 /** @short Open Flag Manager window with clickedObject() RA and Dec entered.
515 */
516 void slotAddFlag();
517
518 /** @short Open Flag Manager window with selected flag focused and ready to edit.
519 *@param flagIdx index of flag to be edited.
520 */
521 void slotEditFlag(int flagIdx);
522
523 /** @short Delete selected flag.
524 *@param flagIdx index of flag to be deleted.
525 */
526 void slotDeleteFlag(int flagIdx);
527
528#ifdef HAVE_OPENGL
529 void slotToggleGL();
530#endif
531
532 /** Run Xplanet Viewer to display images of the planets*/
534
535 /** Render eyepiece view */
536 void slotEyepieceView();
537
538 /** Zoom in one step. */
539 void slotZoomIn();
540
541 /** Zoom out one step. */
542 void slotZoomOut();
543
544 /** Set default zoom. */
545 void slotZoomDefault();
546
547 /** Object pointing for Printing Wizard done */
548 void slotObjectSelected();
549
550 void slotCancelLegendPreviewMode();
551
552 void slotFinishFovCaptureMode();
553
554 void slotCaptureFov();
555
556 signals:
557 /** Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination
558 * point is changed, slewFocus() will iteratively step the Focus toward Destination
559 * until it is reached.
560 * @see SkyMap::setDestination()
561 * @see SkyMap::slewFocus()
562 */
564
565 /** Emitted when zoom level is changed. */
567
568 /** Emitted when current object changed. */
570
571 /** Emitted when pointing changed. (At least should) */
573
574 /** Emitted when position under mouse changed. */
576
577 /** Emitted when a position is clicked */
579
580 /** Emitted when a position is clicked */
582
583 /** Emitted when a sky object is removed from the database */
585
586 /** Emitter when mosaic center is dragged in the sky map */
588
589 void updateQueued();
590
591 protected:
592 bool event(QEvent *event) override;
593
594 /** Process keystrokes:
595 * @li arrow keys Slew the map
596 * @li +/- keys Zoom in and out
597 * @li <i>Space</i> Toggle between Horizontal and Equatorial coordinate systems
598 * @li 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon)
599 * @li [ Place starting point for measuring an angular distance
600 * @li ] End point for Angular Distance; display measurement.
601 * @li <i>Escape</i> Cancel Angular measurement
602 * @li ,/< Step backward one time step
603 * @li ./> Step forward one time step
604 */
605 void keyPressEvent(QKeyEvent *e) override;
606
607 /** When keyRelease is triggered, just set the "slewing" flag to false,
608 * and update the display (to draw objects that are hidden when slewing==true). */
609 void keyReleaseEvent(QKeyEvent *e) override;
610
611 /** Determine RA, Dec coordinates of clicked location. Find the SkyObject
612 * which is nearest to the clicked location.
613 *
614 * If left-clicked: Set set mouseButtonDown==true, slewing==true; display
615 * nearest object name in status bar.
616 * If right-clicked: display popup menu appropriate for nearest object.
617 */
618 void mousePressEvent(QMouseEvent *e) override;
619
620 /** set mouseButtonDown==false, slewing==false */
621 void mouseReleaseEvent(QMouseEvent *e) override;
622
623 /** Center SkyMap at double-clicked location */
624 void mouseDoubleClickEvent(QMouseEvent *e) override;
625
626 /** This function does several different things depending on the state of the program:
627 * @li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor,
628 * and continue this function.
629 * @li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen,
630 * and return.
631 * @li If dragging the mouse in the map, update focus such that RA, Dec under the mouse
632 * cursor remains constant.
633 * @li If just moving the mouse, simply update the curso coordinates in the status bar.
634 */
635 void mouseMoveEvent(QMouseEvent *e) override;
636
637 /** Zoom in and out with the mouse wheel. */
638 void wheelEvent(QWheelEvent *e) override;
639
640 /** If the skymap will be resized, the sky must be new computed. So this
641 * function calls explicitly new computing of the skymap.
642 */
643 void resizeEvent(QResizeEvent *) override;
644
645 private slots:
646 /** @short display tooltip for object under cursor. It's called by m_HoverTimer.
647 * if mouse didn't moved for last HOVER_INTERVAL milliseconds.
648 */
649 void slotTransientLabel();
650
651 /** Set the shape of mouse cursor to a cross with 4 arrows. */
652 void setMouseMoveCursor();
653
654 /** Set the shape of mouse cursor to an open hand. */
655 void setMouseDragCursor();
656
657 private:
658
659 /** @short Sets the shape of the mouse cursor to a magnifying glass. */
660 void setZoomMouseCursor();
661
662 /** @short Sets the shape of the mouse cursor to a rotation symbol. */
663 void setRotationMouseCursor();
664
665 /** Calculate the zoom factor for the given keyboard modifier
666 */
667 double zoomFactor(const int modifier);
668
669 /** calculate the magnitude factor (1, .5, .2, or .1) for the given
670 * keyboard modifier.
671 */
672 double magFactor(const int modifier);
673
674 /** Decrease the magnitude limit by a step size determined by the
675 * keyboard modifier.
676 * @param modifier
677 */
678 void decMagLimit(const int modifier);
679
680 /** Increase the magnitude limit by a step size determined by the
681 * keyboard modifier.
682 * @param modifier
683 */
684 void incMagLimit(const int modifier);
685
686 /** Convenience routine to either zoom in or increase mag limit
687 * depending on the Alt modifier. The Shift and Control modifiers
688 * will adjust the size of the zoom or the mag step.
689 * @param modifier
690 */
691 void zoomInOrMagStep(const int modifier);
692
693 /** Convenience routine to either zoom out or decrease mag limit
694 * depending on the Alt modifier. The Shift and Control modifiers
695 * will adjust the size of the zoom or the mag step.
696 * @param modifier
697 */
698 void zoomOutOrMagStep(const int modifier);
699
700 void beginRulerMode(bool starHopRuler); // TODO: Add docs
701
702 /**
703 * Determine the rotation angle of the SkyMap
704 *
705 * This is simply Options::skyRotation() if the erect observer
706 * correction is not applicable, but otherwise it is
707 * determined by adding a correction amount dependent on the
708 * focus of the sky map
709 */
710 dms determineSkyRotation();
711
712 /**
713 * @short Strart xplanet.
714 * @param outputFile Output file path.
715 */
716 void startXplanet(const QString &outputFile = "");
717
718 bool mouseButtonDown { false };
719 bool midMouseButtonDown { false };
720 /// True if mouseMoveEvent; needed by setMouseMoveCursor
721 bool mouseMoveCursor { false };
722 bool mouseDragCursor { false };
723 bool slewing { false };
724 bool clockSlewing { false };
725 //if false only old pixmap will repainted with bitBlt(), this
726 // saves a lot of cpu usage
727 bool computeSkymap { false };
728 // True if we are either looking for angular distance or star hopping directions
729 bool rulerMode { false };
730 // True only if we are looking for star hopping directions. If
731 // false while rulerMode is true, it means we are measuring angular
732 // distance. FIXME: Find a better way to do this
733 bool starHopDefineMode { false };
734 double y0;
735
736 QPoint rotationStart;
737 dms rotationStartAngle;
738
739 double m_Scale;
740
741 KStarsData *data { nullptr };
742 KSPopupMenu *pmenu { nullptr };
743
744 /// Coordinates of point under cursor. It's update in function mouseMoveEvent
745 SkyPoint m_MousePoint;
746
747 SkyPoint Focus, ClickedPoint, FocusPoint, Destination;
748 SkyObject *ClickedObject { nullptr };
749 SkyObject *FocusObject { nullptr };
750
751 Projector *m_proj { nullptr };
752
753 SkyLine AngularRuler; //The line for measuring angles in the map
754 QRect ZoomRect; //The manual-focus circle.
755
756 // Mouse should not move for that interval to display tooltip
757 static const int HOVER_INTERVAL = 500;
758 // Timer for tooltips
759 QTimer m_HoverTimer;
760
761 // InfoBoxes. Used in destructor to save state
762 InfoBoxWidget *m_timeBox { nullptr };
763 InfoBoxWidget *m_geoBox { nullptr };
764 InfoBoxWidget *m_objBox { nullptr };
765 InfoBoxes *m_iboxes { nullptr };
766
767 // legend
768 bool m_previewLegend { false };
769 Legend m_legend;
770
771 bool m_objPointingMode { false };
772 bool m_fovCaptureMode { false };
773 bool m_touchMode { false };
774 bool m_pinchMode { false };
775 bool m_tapAndHoldMode { false };
776 qreal m_pinchScale { 0.0 };
777
778 QWidget *m_SkyMapDraw { nullptr }; // Can be dynamic_cast<> to SkyMapDrawAbstract
779
780 // NOTE: These are pointers to the individual widgets
781#ifdef HAVE_OPENGL
782 SkyMapQDraw *m_SkyMapQDraw { nullptr };
783 SkyMapGLDraw *m_SkyMapGLDraw { nullptr };
784#endif
785
786 static SkyMap *pinstance;
787 /// Good to keep the original ruler start-point for purposes of dynamic_cast
788 const SkyPoint *m_rulerStartPoint { nullptr };
789};
The InfoBoxWidget class is a widget that displays a transparent box for display of text messages.
The InfoBoxes class is a collection of InfoBoxWidget objects that display a transparent box for displ...
The KStars Popup Menu.
Definition kspopupmenu.h:35
KStarsData is the backbone of KStars.
Definition kstarsdata.h:72
The Projector class is the primary class that serves as an interface to handle projections.
Definition projector.h:58
A series of connected line segments in the sky, composed of SkyPoints at its vertices.
Definition skyline.h:27
This class defines the methods that both rendering engines (GLPainter and QPainter) must implement.
This class draws the SkyMap using OpenGL.
This class draws the SkyMap using native QPainter.
Definition skymapqdraw.h:22
This is the canvas on which the sky is painted.
Definition skymap.h:54
SkyPoint * focusPoint()
retrieve the FocusPoint position.
Definition skymap.h:149
void mouseReleaseEvent(QMouseEvent *e) override
set mouseButtonDown==false, slewing==false
void showFocusCoords()
Update object name and coordinates in the Focus InfoBox.
Definition skymap.cpp:327
void setZoomFactor(double factor)
@ Set zoom factor.
Definition skymap.cpp:1167
void zoomChanged()
Emitted when zoom level is changed.
void setMouseCursorShape(Cursor type)
Sets the shape of the default mouse cursor.
Definition skymap.cpp:1309
void slotToggleTimeBox(bool)
Toggle visibility of time infobox.
Definition skymap.cpp:268
SkyPoint * focus()
Retrieve the Focus point; the position on the sky at the center of the skymap.
Definition skymap.h:123
void slotSDSS()
Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer.
Definition skymap.cpp:563
void slotEyepieceView()
Render eyepiece view.
Definition skymap.cpp:607
void setupProjector()
Call to set up the projector before a draw cycle.
Definition skymap.cpp:1246
void slotObjectSelected()
Object pointing for Printing Wizard done.
Definition skymap.cpp:911
float fov()
Definition skymap.cpp:1197
void keyReleaseEvent(QKeyEvent *e) override
When keyRelease is triggered, just set the "slewing" flag to false, and update the display (to draw o...
void drawObjectLabels(QList< SkyObject * > &labelObjects)
Proxy method for SkyMapDrawAbstract::drawObjectLabels()
Definition skymap.h:327
void resizeEvent(QResizeEvent *) override
If the skymap will be resized, the sky must be new computed.
void exportSkyImage(QPaintDevice *pd, bool scale=false)
Proxy method for SkyMapDrawAbstract::exportSkyImage()
Definition skymap.h:309
void objectChanged(SkyObject *)
Emitted when current object changed.
void slotCopyCoordinates()
slotCopyCoordinates Copies J2000 and JNow equatorial coordinates to the clipboard in addition to hori...
Definition skymap.cpp:504
void setClickedPoint(const SkyPoint *f)
Set the ClickedPoint to the skypoint given as an argument.
Definition skymap.cpp:1012
void slotToggleGeoBox(bool)
Toggle visibility of geo infobox.
Definition skymap.cpp:258
void slotCopyTLE()
slotCopyTLE Copy satellite TLE to clipboard.
Definition skymap.cpp:546
void slotAddPlanetTrail()
Add a Planet Trail to ClickedObject.
Definition skymap.cpp:888
void slotAddObjectLabel()
Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User La...
Definition skymap.cpp:872
void slotUpdateSky(bool now)
Update the focus point and call forceUpdate()
Definition skymap.cpp:458
void slotZoomOut()
Zoom out one step.
Definition skymap.cpp:1157
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
Definition skymap.cpp:366
void slotEndRulerMode()
Computes the angular distance, prints the result in the status bar and disables the angular distance ...
Definition skymap.cpp:647
void updateInfoBoxes()
Update info boxes coordinates.
Definition skymap.cpp:335
const Projector * projector() const
Get the current projector.
Definition skymap.h:300
void positionChanged(SkyPoint *)
Emitted when pointing changed.
void mouseMoveEvent(QMouseEvent *e) override
This function does several different things depending on the state of the program:
void slotRemoveObjectLabel()
Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which have Us...
Definition skymap.cpp:846
void slotClockSlewing()
Checks whether the timestep exceeds a threshold value.
Definition skymap.cpp:944
void slotCancelRulerMode()
Disables the angular distance measuring mode.
Definition skymap.cpp:753
void forceUpdate(bool now=false)
Recalculates the positions of objects in the sky, and then repaints the sky map.
Definition skymap.cpp:1177
void objectClicked(SkyObject *)
Emitted when a position is clicked.
SkyPoint * mousePoint()
Retrieve the mouse pointer position.
Definition skymap.h:227
SkyPoint * destination()
retrieve the Destination position.
Definition skymap.h:135
void slotRemovePlanetTrail()
Remove the PlanetTrail from ClickedObject.
Definition skymap.cpp:878
void setFocusAltAz(const dms &alt, const dms &az)
sets the focus point of the sky map, using its alt/az coordinates
Definition skymap.cpp:972
void mousePointChanged(SkyPoint *)
Emitted when position under mouse changed.
void updateAngleRuler()
update the geometry of the angle ruler.
Definition skymap.cpp:1357
void slotSetSkyRotation(double angle)
Sets the base sky rotation (before correction) to the given angle.
Definition skymap.cpp:1222
void slotDSS()
Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
Definition skymap.cpp:472
void slotToggleInfoboxes(bool)
Toggle visibility of all infoboxes.
Definition skymap.cpp:273
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
Definition skymap.cpp:984
~SkyMap() override
Destructor (empty)
Definition skymap.cpp:279
void slotDisplayFadingText(const QString &text)
Render a fading text label on the screen to flash information.
Definition skymap.cpp:1377
SkyObject * clickedObject() const
Retrieve the object nearest to a mouse click event.
Definition skymap.h:244
void positionClicked(SkyPoint *)
Emitted when a position is clicked.
SkyMap()
Constructor.
Definition skymap.cpp:176
void forceUpdateNow()
Convenience function; simply calls forceUpdate(true).
Definition skymap.h:378
bool isObjectLabeled(SkyObject *o)
Definition skymap.cpp:831
void slotZoomDefault()
Set default zoom.
Definition skymap.cpp:1162
void wheelEvent(QWheelEvent *e) override
Zoom in and out with the mouse wheel.
void slotEditFlag(int flagIdx)
Open Flag Manager window with selected flag focused and ready to edit.
Definition skymap.cpp:789
void slotAddFlag()
Open Flag Manager window with clickedObject() RA and Dec entered.
Definition skymap.cpp:759
void slotImage()
Popup menu function: Show image of ClickedObject (only available for some objects).
Definition skymap.cpp:812
void destinationChanged()
Emitted by setDestination(), and connected to slewFocus().
void slotToggleFocusBox(bool)
Toggle visibility of focus infobox.
Definition skymap.cpp:263
void setDestinationAltAz(const dms &alt, const dms &az, bool altIsRefracted)
sets the destination point of the sky map, using its alt/az coordinates.
Definition skymap.cpp:996
void slotStartXplanetViewer()
Run Xplanet Viewer to display images of the planets.
Definition skymap.cpp:1369
void slewFocus()
Step the Focus point toward the Destination point.
Definition skymap.cpp:1037
void updateFocus()
Update the focus position according to current options.
Definition skymap.cpp:1017
SkyPoint * clickedPoint()
Retrieve the ClickedPoint position.
Definition skymap.h:217
void removeSkyObject(SkyObject *object)
Emitted when a sky object is removed from the database.
void mouseDoubleClickEvent(QMouseEvent *e) override
Center SkyMap at double-clicked location
void slotBeginAngularDistance()
Enables the angular distance measuring mode.
Definition skymap.cpp:611
void slotDeleteFlag(int flagIdx)
Delete selected flag.
Definition skymap.cpp:798
void slotZoomIn()
Zoom in one step.
Definition skymap.cpp:1152
void keyPressEvent(QKeyEvent *e) override
Process keystrokes:
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument.
Definition skymap.cpp:371
void slotInfo()
Popup menu function: Show webpage about ClickedObject (only available for some objects).
Definition skymap.cpp:822
void slotCenter()
Center the display at the point ClickedPoint.
Definition skymap.cpp:380
void setFocusPoint(SkyPoint *f)
set the FocusPoint; the position that is to be the next Destination.
Definition skymap.h:204
SkyObject * focusObject() const
Retrieve the object which is centered in the sky map.
Definition skymap.h:262
void slotRemoveCustomObject()
Remove custom object from internet search in the local catalog.
Definition skymap.cpp:852
void mosaicCenterChanged(dms dRA, dms dDE)
Emitter when mosaic center is dragged in the sky map.
void mousePressEvent(QMouseEvent *e) override
Determine RA, Dec coordinates of clicked location.
void slotDetail()
Popup menu function: Show the Detailed Information window for ClickedObject.
Definition skymap.cpp:898
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
The sky coordinates of a point in the sky.
Definition skypoint.h:45
The QPainter-based painting backend.
Definition skyqpainter.h:31
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
void scale(qreal sx, qreal sy)
Q_OBJECTQ_OBJECT
void setFocus()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:49:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.