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 /** @short Sets the extra rotation applied to FOV symbols (before correction) to the given angle. */
368 void setExtraFovRotation(double angle);
369
370 /** @short Gets the extra rotation applied to FOV symbols. */
371 double extraFovRotation() const {
372 return m_fovExtraRotation;
373 }
374
375 public slots:
376 /** Recalculates the positions of objects in the sky, and then repaints the sky map.
377 * If the positions don't need to be recalculated, use update() instead of forceUpdate().
378 * This saves a lot of CPU time.
379 * @param now if true, paintEvent() is run immediately. Otherwise, it is added to the event queue
380 */
381 void forceUpdate(bool now = false);
382
383 /** @short Convenience function; simply calls forceUpdate(true).
384 * @see forceUpdate()
385 */
387 {
388 forceUpdate(true);
389 }
390
391 /**
392 * @short Update the focus point and call forceUpdate()
393 * @param now is passed on to forceUpdate()
394 */
395 void slotUpdateSky(bool now);
396
397 /** Toggle visibility of geo infobox */
398 void slotToggleGeoBox(bool);
399
400 /** Toggle visibility of focus infobox */
401 void slotToggleFocusBox(bool);
402
403 /** Toggle visibility of time infobox */
404 void slotToggleTimeBox(bool);
405
406 /** Toggle visibility of all infoboxes */
407 void slotToggleInfoboxes(bool);
408
409 /** Sets the base sky rotation (before correction) to the given angle */
410 void slotSetSkyRotation(double angle);
411
412 /** Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky
413 * Map after each step, until the Focus point is within 1 step of the Destination point.
414 * For the final step, snap directly to Destination, and redraw the map.
415 */
416 void slewFocus();
417
418 /** @short Center the display at the point ClickedPoint.
419 *
420 * The essential part of the function is to simply set the Destination point, which will emit
421 * the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this
422 * function performs some bookkeeping tasks, such updating whether we are tracking the new
423 * object/position, adding a Planet Trail if required, etc.
424 *
425 * @see destinationChanged()
426 * @see slewFocus()
427 */
428 void slotCenter();
429
430 /** @short Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
431 * @note the URL is generated using the coordinates of ClickedPoint.
432 */
433 void slotDSS();
434
435 /** @short Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer.
436 * @note the URL is generated using the coordinates of ClickedPoint.
437 */
438 void slotSDSS();
439
440 /**
441 * @brief slotCopyCoordinates Copies J2000 and JNow equatorial coordinates to the clipboard in addition to horizontal coords.
442 */
443 void slotCopyCoordinates();
444
445 /**
446 * @brief slotCopyTLE Copy satellite TLE to clipboard.
447 */
448 void slotCopyTLE();
449
450 /** @short Popup menu function: Show webpage about ClickedObject
451 * (only available for some objects).
452 */
453 void slotInfo();
454
455 /** @short Popup menu function: Show image of ClickedObject
456 * (only available for some objects).
457 */
458 void slotImage();
459
460 /** @short Popup menu function: Show the Detailed Information window for ClickedObject. */
461 void slotDetail();
462
463 /** Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which
464 * have User Labels attached.
465 */
466 void slotAddObjectLabel();
467
468 /** Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which
469 * have User Labels attached.
470 */
472
473 /** Remove custom object from internet search in the local catalog */
475
476 /** @short Add a Planet Trail to ClickedObject.
477 * @note Trails are added simply by calling KSPlanetBase::addToTrail() to add the first point.
478 * as long as the trail is not empty, new points will be automatically appended to it.
479 * @note if ClickedObject is not a Solar System body, this function does nothing.
480 * @see KSPlanetBase::addToTrail()
481 */
482 void slotAddPlanetTrail();
483
484 /** @short Remove the PlanetTrail from ClickedObject.
485 * @note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as
486 * the trail is empty, no new points will be automatically appended.
487 * @see KSPlanetBase::clearTrail()
488 */
490
491 /** @short Render a fading text label on the screen to flash information */
492 void slotDisplayFadingText(const QString &text);
493
494 /** Checks whether the timestep exceeds a threshold value. If so, sets
495 * ClockSlewing=true and sets the SimClock to ManualMode.
496 */
497 void slotClockSlewing();
498
499 /** Enables the angular distance measuring mode. It saves the first
500 * position of the ruler in a SkyPoint. It makes difference between
501 * having clicked on the skymap and not having done so
502 * \note This method is draw-backend independent.
503 */
505
506 void slotBeginStarHop(); // TODO: Add docs
507
508 /** Computes the angular distance, prints the result in the status
509 * bar and disables the angular distance measuring mode
510 * If the user has clicked on the map the status bar shows the
511 * name of the clicked object plus the angular distance. If
512 * the user did not clicked on the map, just pressed ], only
513 * the angular distance is printed
514 * \note This method is draw-backend independent.
515 */
516 void slotEndRulerMode();
517
518 /** Disables the angular distance measuring mode. Nothing is printed
519 * in the status bar */
520 void slotCancelRulerMode();
521
522 /** @short Open Flag Manager window with clickedObject() RA and Dec entered.
523 */
524 void slotAddFlag();
525
526 /** @short Open Flag Manager window with RA and Dec entered.
527 */
528 void slotAddFlagRaw();
529
530 /** @short Open Flag Manager window with selected flag focused and ready to edit.
531 *@param flagIdx index of flag to be edited.
532 */
533 void slotEditFlag(int flagIdx);
534
535 /** @short Delete selected flag.
536 *@param flagIdx index of flag to be deleted.
537 */
538 void slotDeleteFlag(int flagIdx);
539
540#ifdef HAVE_OPENGL
541 void slotToggleGL();
542#endif
543
544 /** Run Xplanet Viewer to display images of the planets*/
546
547 /** Zoom in one step. */
548 void slotZoomIn();
549
550 /** Zoom out one step. */
551 void slotZoomOut();
552
553 /** Set default zoom. */
554 void slotZoomDefault();
555
556 /** Object pointing for Printing Wizard done */
557 void slotObjectSelected();
558
559 void slotCancelLegendPreviewMode();
560
561 void slotFinishFovCaptureMode();
562
563 void slotCaptureFov();
564
565 signals:
566 /** Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination
567 * point is changed, slewFocus() will iteratively step the Focus toward Destination
568 * until it is reached.
569 * @see SkyMap::setDestination()
570 * @see SkyMap::slewFocus()
571 */
573
574 /** Emitted when zoom level is changed. */
576
577 /** Emitted when current object changed. */
579
580 /** Emitted when pointing changed. (At least should) */
582
583 /** Emitted when position under mouse changed. */
585
586 /** Emitted when a position is clicked */
588
589 /** Emitted when a position is clicked */
591
592 /** Emitted when a sky object is removed from the database */
594
595 /** Emitter when mosaic center is dragged in the sky map */
597
598 void updateQueued();
599
600 protected:
601 bool event(QEvent *event) override;
602
603 /** Process keystrokes:
604 * @li arrow keys Slew the map
605 * @li +/- keys Zoom in and out
606 * @li <i>Space</i> Toggle between Horizontal and Equatorial coordinate systems
607 * @li 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon)
608 * @li [ Place starting point for measuring an angular distance
609 * @li ] End point for Angular Distance; display measurement.
610 * @li <i>Escape</i> Cancel Angular measurement
611 * @li ,/< Step backward one time step
612 * @li ./> Step forward one time step
613 */
614 void keyPressEvent(QKeyEvent *e) override;
615
616 /** When keyRelease is triggered, just set the "slewing" flag to false,
617 * and update the display (to draw objects that are hidden when slewing==true). */
618 void keyReleaseEvent(QKeyEvent *e) override;
619
620 /** Determine RA, Dec coordinates of clicked location. Find the SkyObject
621 * which is nearest to the clicked location.
622 *
623 * If left-clicked: Set set mouseButtonDown==true, slewing==true; display
624 * nearest object name in status bar.
625 * If right-clicked: display popup menu appropriate for nearest object.
626 */
627 void mousePressEvent(QMouseEvent *e) override;
628
629 /** set mouseButtonDown==false, slewing==false */
630 void mouseReleaseEvent(QMouseEvent *e) override;
631
632 /** Center SkyMap at double-clicked location */
633 void mouseDoubleClickEvent(QMouseEvent *e) override;
634
635 /** This function does several different things depending on the state of the program:
636 * @li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor,
637 * and continue this function.
638 * @li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen,
639 * and return.
640 * @li If dragging the mouse in the map, update focus such that RA, Dec under the mouse
641 * cursor remains constant.
642 * @li If just moving the mouse, simply update the curso coordinates in the status bar.
643 */
644 void mouseMoveEvent(QMouseEvent *e) override;
645
646 /** Zoom in and out with the mouse wheel. */
647 void wheelEvent(QWheelEvent *e) override;
648
649 /** If the skymap will be resized, the sky must be new computed. So this
650 * function calls explicitly new computing of the skymap.
651 */
652 void resizeEvent(QResizeEvent *) override;
653
654 private slots:
655 /** @short display tooltip for object under cursor. It's called by m_HoverTimer.
656 * if mouse didn't moved for last HOVER_INTERVAL milliseconds.
657 */
658 void slotTransientLabel();
659
660 /** Set the shape of mouse cursor to a cross with 4 arrows. */
661 void setMouseMoveCursor();
662
663 /** Set the shape of mouse cursor to an open hand. */
664 void setMouseDragCursor();
665
666 private:
667
668 /** @short Sets the shape of the mouse cursor to a magnifying glass. */
669 void setZoomMouseCursor();
670
671 /** @short Sets the shape of the mouse cursor to a rotation symbol. */
672 void setRotationMouseCursor();
673
674 /** @short Sets the shape of the mouse cursor to a fov rotation symbol. */
675 void setFovRotationMouseCursor();
676
677 /** Calculate the zoom factor for the given keyboard modifier
678 */
679 double zoomFactor(const int modifier);
680
681 /** calculate the magnitude factor (1, .5, .2, or .1) for the given
682 * keyboard modifier.
683 */
684 double magFactor(const int modifier);
685
686 /** Decrease the magnitude limit by a step size determined by the
687 * keyboard modifier.
688 * @param modifier
689 */
690 void decMagLimit(const int modifier);
691
692 /** Increase the magnitude limit by a step size determined by the
693 * keyboard modifier.
694 * @param modifier
695 */
696 void incMagLimit(const int modifier);
697
698 /** Convenience routine to either zoom in or increase mag limit
699 * depending on the Alt modifier. The Shift and Control modifiers
700 * will adjust the size of the zoom or the mag step.
701 * @param modifier
702 */
703 void zoomInOrMagStep(const int modifier);
704
705 /** Convenience routine to either zoom out or decrease mag limit
706 * depending on the Alt modifier. The Shift and Control modifiers
707 * will adjust the size of the zoom or the mag step.
708 * @param modifier
709 */
710 void zoomOutOrMagStep(const int modifier);
711
712 void beginRulerMode(bool starHopRuler); // TODO: Add docs
713
714 /**
715 * Determine the rotation angle of the SkyMap
716 *
717 * This is simply Options::skyRotation() if the erect observer
718 * correction is not applicable, but otherwise it is
719 * determined by adding a correction amount dependent on the
720 * focus of the sky map
721 */
722 dms determineSkyRotation();
723
724 /**
725 * @short Strart xplanet.
726 * @param outputFile Output file path.
727 */
728 void startXplanet(const QString &outputFile = "");
729
730 bool mouseButtonDown { false };
731 bool midMouseButtonDown { false };
732 /// True if mouseMoveEvent; needed by setMouseMoveCursor
733 bool mouseMoveCursor { false };
734 bool mouseDragCursor { false };
735 bool slewing { false };
736 bool clockSlewing { false };
737 //if false only old pixmap will repainted with bitBlt(), this
738 // saves a lot of cpu usage
739 bool computeSkymap { false };
740 // True if we are either looking for angular distance or star hopping directions
741 bool rulerMode { false };
742 // True only if we are looking for star hopping directions. If
743 // false while rulerMode is true, it means we are measuring angular
744 // distance. FIXME: Find a better way to do this
745 bool starHopDefineMode { false };
746 double y0;
747
748 QPoint rotationStart;
749 dms rotationStartAngle;
750
751 QPoint fovRotationStart;
752 dms fovRotationStartAngle;
753
754 double m_Scale;
755
756 KStarsData *data { nullptr };
757 KSPopupMenu *pmenu { nullptr };
758
759 /// Coordinates of point under cursor. It's update in function mouseMoveEvent
760 SkyPoint m_MousePoint;
761
762 // A copy of m_MousePoint, copied when the mouse is pressed.
763 SkyPoint m_MousePointPressed;
764
765 SkyPoint Focus, ClickedPoint, FocusPoint, Destination;
766 SkyObject *ClickedObject { nullptr };
767 SkyObject *FocusObject { nullptr };
768
769 Projector *m_proj { nullptr };
770
771 SkyLine AngularRuler; //The line for measuring angles in the map
772 QRect ZoomRect; //The manual-focus circle.
773
774 // Mouse should not move for that interval to display tooltip
775 static const int HOVER_INTERVAL = 500;
776 // Timer for tooltips
777 QTimer m_HoverTimer;
778
779 // InfoBoxes. Used in destructor to save state
780 InfoBoxWidget *m_timeBox { nullptr };
781 InfoBoxWidget *m_geoBox { nullptr };
782 InfoBoxWidget *m_objBox { nullptr };
783 InfoBoxes *m_iboxes { nullptr };
784
785 // legend
786 bool m_previewLegend { false };
787 Legend m_legend;
788
789 bool m_objPointingMode { false };
790 bool m_fovCaptureMode { false };
791 bool m_touchMode { false };
792 bool m_pinchMode { false };
793 bool m_tapAndHoldMode { false };
794 qreal m_pinchScale { 0.0 };
795
796 QWidget *m_SkyMapDraw { nullptr }; // Can be dynamic_cast<> to SkyMapDrawAbstract
797
798 // NOTE: These are pointers to the individual widgets
799#ifdef HAVE_OPENGL
800 SkyMapQDraw *m_SkyMapQDraw { nullptr };
801 SkyMapGLDraw *m_SkyMapGLDraw { nullptr };
802#endif
803
804 static SkyMap *pinstance;
805 /// Good to keep the original ruler start-point for purposes of dynamic_cast
806 const SkyPoint *m_rulerStartPoint { nullptr };
807
808 // Extra rotation applied to FOV symbols.
809 double m_fovExtraRotation { 0.0 };
810};
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:74
The Projector class is the primary class that serves as an interface to handle projections.
Definition projector.h:58
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
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:360
void setZoomFactor(double factor)
@ Set zoom factor.
Definition skymap.cpp:1207
void zoomChanged()
Emitted when zoom level is changed.
void setMouseCursorShape(Cursor type)
Sets the shape of the default mouse cursor.
Definition skymap.cpp:1365
void slotToggleTimeBox(bool)
Toggle visibility of time infobox.
Definition skymap.cpp:301
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:596
void setupProjector()
Call to set up the projector before a draw cycle.
Definition skymap.cpp:1293
void slotObjectSelected()
Object pointing for Printing Wizard done.
Definition skymap.cpp:951
float fov()
Definition skymap.cpp:1237
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:537
void setClickedPoint(const SkyPoint *f)
Set the ClickedPoint to the skypoint given as an argument.
Definition skymap.cpp:1052
void slotToggleGeoBox(bool)
Toggle visibility of geo infobox.
Definition skymap.cpp:291
void slotCopyTLE()
slotCopyTLE Copy satellite TLE to clipboard.
Definition skymap.cpp:579
void slotAddPlanetTrail()
Add a Planet Trail to ClickedObject.
Definition skymap.cpp:928
void slotAddObjectLabel()
Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which have User La...
Definition skymap.cpp:912
void slotUpdateSky(bool now)
Update the focus point and call forceUpdate()
Definition skymap.cpp:491
void slotZoomOut()
Zoom out one step.
Definition skymap.cpp:1197
void setClickedObject(SkyObject *o)
Set the ClickedObject pointer to the argument.
Definition skymap.cpp:399
void slotEndRulerMode()
Computes the angular distance, prints the result in the status bar and disables the angular distance ...
Definition skymap.cpp:676
void updateInfoBoxes()
Update info boxes coordinates.
Definition skymap.cpp:368
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:886
void slotClockSlewing()
Checks whether the timestep exceeds a threshold value.
Definition skymap.cpp:984
void slotCancelRulerMode()
Disables the angular distance measuring mode.
Definition skymap.cpp:782
void forceUpdate(bool now=false)
Recalculates the positions of objects in the sky, and then repaints the sky map.
Definition skymap.cpp:1217
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:918
void setFocusAltAz(const dms &alt, const dms &az)
sets the focus point of the sky map, using its alt/az coordinates
Definition skymap.cpp:1012
void mousePointChanged(SkyPoint *)
Emitted when position under mouse changed.
void updateAngleRuler()
update the geometry of the angle ruler.
Definition skymap.cpp:1413
void slotSetSkyRotation(double angle)
Sets the base sky rotation (before correction) to the given angle.
Definition skymap.cpp:1262
void slotDSS()
Popup menu function: Display 1st-Generation DSS image with the Image Viewer.
Definition skymap.cpp:505
void slotToggleInfoboxes(bool)
Toggle visibility of all infoboxes.
Definition skymap.cpp:306
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
Definition skymap.cpp:1024
~SkyMap() override
Destructor (empty)
Definition skymap.cpp:312
void slotDisplayFadingText(const QString &text)
Render a fading text label on the screen to flash information.
Definition skymap.cpp:1433
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:209
void forceUpdateNow()
Convenience function; simply calls forceUpdate(true).
Definition skymap.h:386
bool isObjectLabeled(SkyObject *o)
Definition skymap.cpp:873
void slotZoomDefault()
Set default zoom.
Definition skymap.cpp:1202
double extraFovRotation() const
Gets the extra rotation applied to FOV symbols.
Definition skymap.h:371
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:831
void slotAddFlag()
Open Flag Manager window with clickedObject() RA and Dec entered.
Definition skymap.cpp:788
void slotImage()
Popup menu function: Show image of ClickedObject (only available for some objects).
Definition skymap.cpp:854
void destinationChanged()
Emitted by setDestination(), and connected to slewFocus().
void slotToggleFocusBox(bool)
Toggle visibility of focus infobox.
Definition skymap.cpp:296
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:1036
void slotAddFlagRaw()
Open Flag Manager window with RA and Dec entered.
Definition skymap.cpp:818
void setExtraFovRotation(double angle)
Sets the extra rotation applied to FOV symbols (before correction) to the given angle.
Definition skymap.cpp:1286
void slotStartXplanetViewer()
Run Xplanet Viewer to display images of the planets.
Definition skymap.cpp:1425
void slewFocus()
Step the Focus point toward the Destination point.
Definition skymap.cpp:1077
void updateFocus()
Update the focus position according to current options.
Definition skymap.cpp:1057
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:640
void slotDeleteFlag(int flagIdx)
Delete selected flag.
Definition skymap.cpp:840
void slotZoomIn()
Zoom in one step.
Definition skymap.cpp:1192
void keyPressEvent(QKeyEvent *e) override
Process keystrokes:
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument.
Definition skymap.cpp:404
void slotInfo()
Popup menu function: Show webpage about ClickedObject (only available for some objects).
Definition skymap.cpp:864
void slotCenter()
Center the display at the point ClickedPoint.
Definition skymap.cpp:413
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:892
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:938
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:50
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
QGraphicsView(QGraphicsScene *scene, QWidget *parent)
void scale(qreal sx, qreal sy)
Q_OBJECTQ_OBJECT
QWidget(QWidget *parent, Qt::WindowFlags f)
void setFocus()
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:58:39 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.