Changeset View
Changeset View
Standalone View
Standalone View
kstars/skymap.h
Context not available. | |||||
68 | 68 | | |||
---|---|---|---|---|---|
69 | protected: | 69 | protected: | ||
70 | /** | 70 | /** | ||
71 | *Constructor. Read stored settings from KConfig object (focus position, | 71 | * Constructor. Read stored settings from KConfig object (focus position, | ||
72 | *zoom factor, sky color, etc.). Run initPopupMenus(). | 72 | * zoom factor, sky color, etc.). Run initPopupMenus(). | ||
73 | */ | 73 | */ | ||
74 | SkyMap(); | 74 | SkyMap(); | ||
75 | 75 | | |||
76 | public: | 76 | public: | ||
Context not available. | |||||
80 | 80 | | |||
81 | static bool IsSlewing() { return pinstance->isSlewing(); } | 81 | static bool IsSlewing() { return pinstance->isSlewing(); } | ||
82 | 82 | | |||
83 | /** Destructor (empty) */ | 83 | virtual ~SkyMap() override; | ||
84 | ~SkyMap() override; | | |||
85 | 84 | | |||
86 | enum Projection | 85 | enum class Projection : int | ||
87 | { | 86 | { | ||
88 | Lambert, | 87 | Lambert = 0, | ||
89 | AzimuthalEquidistant, | 88 | AzimuthalEquidistant, | ||
90 | Orthographic, | 89 | Orthographic, | ||
91 | Equirectangular, | 90 | Equirectangular, | ||
Context not available. | |||||
94 | UnknownProjection | 93 | UnknownProjection | ||
95 | }; | 94 | }; | ||
96 | 95 | | |||
97 | /** @return the angular field of view of the sky map, in degrees. | 96 | /** | ||
98 | *@note it must use either the height or the width of the window to calculate the | 97 | * @return the angular field of view of the sky map, in degrees. | ||
99 | *FOV angle. It chooses whichever is larger. | 98 | * @note it must use either the height or the width of the window to calculate the | ||
100 | */ | 99 | * FOV angle. It chooses whichever is larger. | ||
100 | */ | ||||
101 | float fov(); | 101 | float fov(); | ||
102 | 102 | | |||
103 | /** @short Update object name and coordinates in the Focus InfoBox */ | 103 | /** @short Update object name and coordinates in the Focus InfoBox */ | ||
Context not available. | |||||
106 | /** @short Update the focus position according to current options. */ | 106 | /** @short Update the focus position according to current options. */ | ||
107 | void updateFocus(); | 107 | void updateFocus(); | ||
108 | 108 | | |||
109 | /** @short Retrieve the Focus point; the position on the sky at the | 109 | /** | ||
110 | *center of the skymap. | 110 | * @short Retrieve the Focus point; the position on the sky at the center of the skymap. | ||
111 | *@return a pointer to the central focus point of the sky map | 111 | * @return a pointer to the central focus point of the sky map | ||
112 | */ | 112 | */ | ||
113 | SkyPoint *focus() { return &Focus; } | 113 | SkyPoint *focus() { return &Focus; } | ||
114 | 114 | | |||
115 | /** @short retrieve the Destination position. | 115 | /** | ||
116 | * | 116 | * @short retrieve the Destination position. | ||
117 | *The Destination is the point on the sky to which the focus will | 117 | * | ||
118 | *be moved. | 118 | * The Destination is the point on the sky to which the focus will be moved. | ||
119 | * | 119 | * | ||
120 | *@return a pointer to the destination point of the sky map | 120 | * @return a pointer to the destination point of the sky map | ||
121 | */ | 121 | */ | ||
122 | SkyPoint *destination() { return &Destination; } | 122 | SkyPoint *destination() { return &Destination; } | ||
123 | 123 | | |||
124 | /** @short retrieve the FocusPoint position. | 124 | /** | ||
125 | * | 125 | * @short retrieve the FocusPoint position. | ||
126 | *The FocusPoint stores the position on the sky that is to be | 126 | * | ||
127 | *focused next. This is not exactly the same as the Destination | 127 | * The FocusPoint stores the position on the sky that is to be focused next. | ||
128 | *point, because when the Destination is set, it will begin slewing | 128 | * This is not exactly the same as the Destination point, because when the | ||
129 | *immediately. | 129 | * Destination is set, it will begin slewing immediately. | ||
130 | * | 130 | * | ||
131 | *@return a pointer to the sky point which is to be focused next. | 131 | * @return a pointer to the sky point which is to be focused next. | ||
132 | */ | 132 | */ | ||
133 | SkyPoint *focusPoint() { return &FocusPoint; } | 133 | SkyPoint *focusPoint() { return &FocusPoint; } | ||
134 | 134 | | |||
135 | /** @short sets the central focus point of the sky map. | 135 | /** | ||
136 | *@param f a pointer to the SkyPoint the map should be centered on | 136 | * @short sets the central focus point of the sky map. | ||
137 | */ | 137 | * @param f a pointer to the SkyPoint the map should be centered on | ||
138 | */ | ||||
138 | void setFocus(SkyPoint *f); | 139 | void setFocus(SkyPoint *f); | ||
139 | 140 | | |||
140 | /** @short sets the focus point of the skymap, using ra/dec coordinates | 141 | /** | ||
141 | * | 142 | * @short sets the focus point of the skymap, using ra/dec coordinates | ||
142 | *@note This function behaves essentially like the above function. | 143 | * | ||
143 | *It differs only in the data types of its arguments. | 144 | * @note This function behaves essentially like the above function. | ||
144 | * | 145 | * It differs only in the data types of its arguments. | ||
145 | *@param ra the new right ascension | 146 | * | ||
146 | *@param dec the new declination | 147 | * @param ra the new right ascension | ||
147 | */ | 148 | * @param dec the new declination | ||
149 | */ | ||||
148 | void setFocus(const dms &ra, const dms &dec); | 150 | void setFocus(const dms &ra, const dms &dec); | ||
149 | 151 | | |||
150 | /** @short sets the focus point of the sky map, using its alt/az coordinates | 152 | /** | ||
151 | *@param alt the new altitude | 153 | * @short sets the focus point of the sky map, using its alt/az coordinates | ||
152 | *@param az the new azimuth | 154 | * | ||
153 | */ | 155 | * @param alt the new altitude | ||
156 | * @param az the new azimuth | ||||
157 | */ | ||||
154 | void setFocusAltAz(const dms &alt, const dms &az); | 158 | void setFocusAltAz(const dms &alt, const dms &az); | ||
155 | 159 | | |||
156 | /** @short sets the destination point of the sky map. | 160 | /** | ||
157 | *@note setDestination() emits the destinationChanged() SIGNAL, | 161 | * @short sets the destination point of the sky map. | ||
158 | *which triggers the SLOT function SkyMap::slewFocus(). This | 162 | * | ||
159 | *function iteratively steps the Focus point toward Destination, | 163 | * @note setDestination() emits the destinationChanged() SIGNAL, | ||
160 | *repainting the sky at each step (if Options::useAnimatedSlewing()==true). | 164 | * which triggers the SLOT function SkyMap::slewFocus(). This | ||
161 | *@param f a pointer to the SkyPoint the map should slew to | 165 | * function iteratively steps the Focus point toward Destination, | ||
162 | */ | 166 | * repainting the sky at each step (if Options::useAnimatedSlewing()==true). | ||
167 | * @param f a pointer to the SkyPoint the map should slew to | ||||
168 | */ | ||||
163 | void setDestination(const SkyPoint &f); | 169 | void setDestination(const SkyPoint &f); | ||
164 | 170 | | |||
165 | /** @short sets the destination point of the skymap, using ra/dec coordinates. | 171 | /** | ||
166 | * | 172 | * @short sets the destination point of the skymap, using ra/dec coordinates. | ||
167 | *@note This function behaves essentially like the above function. | 173 | * | ||
168 | *It differs only in the data types of its arguments. | 174 | * @note This function behaves essentially like the above function. | ||
169 | * | 175 | * It differs only in the data types of its arguments. | ||
170 | *@param ra the new right ascension | 176 | * | ||
171 | *@param dec the new declination | 177 | * @param ra the new right ascension | ||
172 | */ | 178 | * @param dec the new declination | ||
179 | */ | ||||
173 | void setDestination(const dms &ra, const dms &dec); | 180 | void setDestination(const dms &ra, const dms &dec); | ||
174 | 181 | | |||
175 | /** @short sets the destination point of the sky map, using its alt/az coordinates. | 182 | /** | ||
176 | *@param alt the new altitude | 183 | * @short sets the destination point of the sky map, using its alt/az coordinates. | ||
177 | *@param az the new azimuth | 184 | * | ||
178 | */ | 185 | * @param alt the new altitude | ||
186 | * @param az the new azimuth | ||||
187 | */ | ||||
179 | void setDestinationAltAz(const dms &alt, const dms &az); | 188 | void setDestinationAltAz(const dms &alt, const dms &az); | ||
180 | 189 | | |||
181 | /** @short set the FocusPoint; the position that is to be the next Destination. | 190 | /** | ||
182 | *@param f a pointer to the FocusPoint SkyPoint. | 191 | * @short set the FocusPoint; the position that is to be the next Destination. | ||
183 | */ | 192 | * @param f a pointer to the FocusPoint SkyPoint. | ||
193 | */ | ||||
184 | void setFocusPoint(SkyPoint *f) | 194 | void setFocusPoint(SkyPoint *f) | ||
185 | { | 195 | { | ||
186 | if (f) | 196 | if (f) | ||
187 | FocusPoint = *f; | 197 | FocusPoint = *f; | ||
188 | } | 198 | } | ||
189 | 199 | | |||
190 | /** @short Retrieve the ClickedPoint position. | 200 | /** | ||
191 | * | 201 | * @short Retrieve the ClickedPoint position. | ||
192 | *When the user clicks on a point in the sky map, the sky coordinates of the mouse | 202 | * | ||
193 | *cursor are stored in the private member ClickedPoint. This function retrieves | 203 | * When the user clicks on a point in the sky map, the sky coordinates of the mouse | ||
194 | *a pointer to ClickedPoint. | 204 | * cursor are stored in the private member ClickedPoint. This function retrieves | ||
195 | *@return a pointer to ClickedPoint, the sky coordinates where the user clicked. | 205 | * a pointer to ClickedPoint. | ||
196 | */ | 206 | * @return a pointer to ClickedPoint, the sky coordinates where the user clicked. | ||
207 | */ | ||||
197 | SkyPoint *clickedPoint() { return &ClickedPoint; } | 208 | SkyPoint *clickedPoint() { return &ClickedPoint; } | ||
198 | 209 | | |||
199 | /** | 210 | /** | ||
Context not available. | |||||
203 | */ | 214 | */ | ||
204 | SkyPoint *mousePoint() { return &m_MousePoint; } | 215 | SkyPoint *mousePoint() { return &m_MousePoint; } | ||
205 | 216 | | |||
206 | /** @short Set the ClickedPoint to the skypoint given as an argument. | 217 | /** | ||
207 | *@param f pointer to the new ClickedPoint. | 218 | * @short Set the ClickedPoint to the skypoint given as an argument. | ||
208 | */ | 219 | * @param f pointer to the new ClickedPoint. | ||
220 | */ | ||||
209 | void setClickedPoint(SkyPoint *f); | 221 | void setClickedPoint(SkyPoint *f); | ||
210 | 222 | | |||
211 | /** @short Retrieve the object nearest to a mouse click event. | 223 | /** | ||
212 | * | 224 | * @short Retrieve the object nearest to a mouse click event. | ||
213 | *If the user clicks on the sky map, a pointer to the nearest SkyObject is stored in | 225 | * | ||
214 | *the private member ClickedObject. This function returns the ClickedObject pointer, | 226 | * If the user clicks on the sky map, a pointer to the nearest SkyObject is stored in | ||
215 | *or nullptr if there is no CLickedObject. | 227 | * the private member ClickedObject. This function returns the ClickedObject pointer, | ||
216 | *@return a pointer to the object nearest to a user mouse click. | 228 | * or nullptr if there is no CLickedObject. | ||
217 | */ | 229 | * @return a pointer to the object nearest to a user mouse click. | ||
230 | */ | ||||
218 | SkyObject *clickedObject() const { return ClickedObject; } | 231 | SkyObject *clickedObject() const { return ClickedObject; } | ||
219 | 232 | | |||
220 | /** @short Set the ClickedObject pointer to the argument. | 233 | /** | ||
221 | *@param o pointer to the SkyObject to be assigned as the ClickedObject | 234 | * @short Set the ClickedObject pointer to the argument. | ||
222 | */ | 235 | * @param o pointer to the SkyObject to be assigned as the ClickedObject | ||
236 | */ | ||||
223 | void setClickedObject(SkyObject *o); | 237 | void setClickedObject(SkyObject *o); | ||
224 | 238 | | |||
225 | /** @short Retrieve the object which is centered in the sky map. | 239 | /** | ||
226 | * | 240 | * @short Retrieve the object which is centered in the sky map. | ||
227 | *If the user centers the sky map on an object (by double-clicking or using the | 241 | * | ||
228 | *Find Object dialog), a pointer to the "focused" object is stored in | 242 | * If the user centers the sky map on an object (by double-clicking or using the | ||
229 | *the private member FocusObject. This function returns a pointer to the | 243 | * Find Object dialog), a pointer to the "focused" object is stored in | ||
230 | *FocusObject, or nullptr if there is not FocusObject. | 244 | * the private member FocusObject. This function returns a pointer to the | ||
231 | *@return a pointer to the object at the center of the sky map. | 245 | * FocusObject, or nullptr if there is not FocusObject. | ||
232 | */ | 246 | * @return a pointer to the object at the center of the sky map. | ||
247 | */ | ||||
233 | SkyObject *focusObject() const { return FocusObject; } | 248 | SkyObject *focusObject() const { return FocusObject; } | ||
234 | 249 | | |||
235 | /** @short Set the FocusObject pointer to the argument. | 250 | /** | ||
236 | *@param o pointer to the SkyObject to be assigned as the FocusObject | 251 | * @short Set the FocusObject pointer to the argument. | ||
237 | */ | 252 | * @param o pointer to the SkyObject to be assigned as the FocusObject | ||
253 | */ | ||||
238 | void setFocusObject(SkyObject *o); | 254 | void setFocusObject(SkyObject *o); | ||
239 | 255 | | |||
240 | /** @short Call to set up the projector before a draw cycle. */ | 256 | /** @short Call to set up the projector before a draw cycle. */ | ||
241 | void setupProjector(); | 257 | void setupProjector(); | ||
242 | 258 | | |||
243 | /** @ Set zoom factor. | 259 | /** | ||
244 | *@param factor zoom factor | 260 | * Set zoom factor. | ||
245 | */ | 261 | * @param factor zoom factor | ||
262 | */ | ||||
246 | void setZoomFactor(double factor); | 263 | void setZoomFactor(double factor); | ||
247 | 264 | | |||
248 | bool isSlewing() const; | 265 | bool isSlewing() const; | ||
Context not available. | |||||
251 | /** @short update the geometry of the angle ruler. */ | 268 | /** @short update the geometry of the angle ruler. */ | ||
252 | void updateAngleRuler(); | 269 | void updateAngleRuler(); | ||
253 | 270 | | |||
254 | /** @return true if the object currently has a user label attached. | 271 | /** | ||
255 | *@note this function only checks for a label explicitly added to the object | 272 | * @return true if the object currently has a user label attached. | ||
256 | *with the right-click popup menu; other kinds of labels are not detected by | 273 | * @note this function only checks for a label explicitly added to the object | ||
257 | *this function. | 274 | * with the right-click popup menu; other kinds of labels are not detected by this function. | ||
258 | *@param o pointer to the sky object to be tested for a User label. | 275 | * @param o pointer to the sky object to be tested for a User label. | ||
259 | */ | 276 | */ | ||
260 | bool isObjectLabeled(SkyObject *o); | 277 | bool isObjectLabeled(SkyObject *o); | ||
261 | 278 | | |||
262 | /*@*@short Convenience function for shutting off tracking mode. Just calls KStars::slotTrack(). | 279 | /** | ||
263 | */ | 280 | * @short Convenience function for shutting off tracking mode. | ||
281 | * | ||||
282 | * Just calls KStars::slotTrack(). | ||||
283 | */ | ||||
264 | void stopTracking(); | 284 | void stopTracking(); | ||
265 | 285 | | |||
266 | /** Get the current projector. | 286 | /** | ||
267 | @return a pointer to the current projector. */ | 287 | * Get the current projector. | ||
288 | * | ||||
289 | * @return a pointer to the current projector. | ||||
290 | */ | ||||
268 | inline const Projector *projector() const { return m_proj; } | 291 | inline const Projector *projector() const { return m_proj; } | ||
269 | 292 | | |||
270 | // NOTE: These dynamic casts must not segfault. If they do, it's good because we know that there is a problem. | 293 | // NOTE: These dynamic casts must not segfault. If they do, it's good because we know that there is a problem. | ||
271 | /** | 294 | /** @short Proxy method for SkyMapDrawAbstract::exportSkyImage() */ | ||
272 | *@short Proxy method for SkyMapDrawAbstract::exportSkyImage() | | |||
273 | */ | | |||
274 | inline void exportSkyImage(QPaintDevice *pd, bool scale = false) | 295 | inline void exportSkyImage(QPaintDevice *pd, bool scale = false) | ||
275 | { | 296 | { | ||
276 | dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->exportSkyImage(pd, scale); | 297 | dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->exportSkyImage(pd, scale); | ||
Context not available. | |||||
283 | 304 | | |||
284 | SkyMapDrawAbstract *getSkyMapDrawAbstract() { return dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw); } | 305 | SkyMapDrawAbstract *getSkyMapDrawAbstract() { return dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw); } | ||
285 | 306 | | |||
286 | /** | 307 | /** @short Proxy method for SkyMapDrawAbstract::drawObjectLabels() */ | ||
287 | *@short Proxy method for SkyMapDrawAbstract::drawObjectLabels() | | |||
288 | */ | | |||
289 | inline void drawObjectLabels(QList<SkyObject *> &labelObjects) | 308 | inline void drawObjectLabels(QList<SkyObject *> &labelObjects) | ||
290 | { | 309 | { | ||
291 | dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->drawObjectLabels(labelObjects); | 310 | dynamic_cast<SkyMapDrawAbstract *>(m_SkyMapDraw)->drawObjectLabels(labelObjects); | ||
Context not available. | |||||
306 | SkyPoint getCenterPoint(); | 325 | SkyPoint getCenterPoint(); | ||
307 | 326 | | |||
308 | public slots: | 327 | public slots: | ||
309 | /** Recalculates the positions of objects in the sky, and then repaints the sky map. | 328 | /** | ||
310 | * If the positions don't need to be recalculated, use update() instead of forceUpdate(). | 329 | * Recalculates the positions of objects in the sky, and then repaints the sky map. | ||
311 | * This saves a lot of CPU time. | 330 | * If the positions don't need to be recalculated, use update() instead of forceUpdate(). | ||
312 | * @param now if true, paintEvent() is run immediately. Otherwise, it is added to the event queue | 331 | * This saves a lot of CPU time. | ||
313 | */ | 332 | * @param now if true, paintEvent() is run immediately. Otherwise, it is added to the event queue | ||
333 | */ | ||||
314 | void forceUpdate(bool now = false); | 334 | void forceUpdate(bool now = false); | ||
315 | 335 | | |||
316 | /** @short Convenience function; simply calls forceUpdate(true). | 336 | /** | ||
317 | * @see forceUpdate() | 337 | * @short Convenience function; simply calls forceUpdate(true). | ||
318 | */ | 338 | * @see forceUpdate() | ||
339 | */ | ||||
319 | void forceUpdateNow() { forceUpdate(true); } | 340 | void forceUpdateNow() { forceUpdate(true); } | ||
320 | 341 | | |||
321 | /** | 342 | /** | ||
322 | * @short Update the focus point and call forceUpdate() | 343 | * @short Update the focus point and call forceUpdate() | ||
323 | * @param now is passed on to forceUpdate() | 344 | * @param now is passed on to forceUpdate() | ||
324 | */ | 345 | */ | ||
325 | void slotUpdateSky(bool now); | 346 | void slotUpdateSky(bool now); | ||
326 | 347 | | |||
327 | /** Toggle visibility of geo infobox */ | 348 | /** Toggle visibility of geo infobox */ | ||
Context not available. | |||||
336 | /** Toggle visibility of all infoboxes */ | 357 | /** Toggle visibility of all infoboxes */ | ||
337 | void slotToggleInfoboxes(bool); | 358 | void slotToggleInfoboxes(bool); | ||
338 | 359 | | |||
339 | /** Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky | 360 | /** | ||
340 | * Map after each step, until the Focus point is within 1 step of the Destination point. | 361 | * Step the Focus point toward the Destination point. Do this iteratively, redrawing the Sky | ||
341 | * For the final step, snap directly to Destination, and redraw the map. | 362 | * Map after each step, until the Focus point is within 1 step of the Destination point. | ||
342 | */ | 363 | * For the final step, snap directly to Destination, and redraw the map. | ||
364 | */ | ||||
343 | void slewFocus(); | 365 | void slewFocus(); | ||
344 | 366 | | |||
345 | /** @short Center the display at the point ClickedPoint. | 367 | /** | ||
346 | * | 368 | * @short Center the display at the point ClickedPoint. | ||
347 | * The essential part of the function is to simply set the Destination point, which will emit | 369 | * | ||
348 | * the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this | 370 | * The essential part of the function is to simply set the Destination point, which will emit | ||
349 | * function performs some bookkeeping tasks, such updating whether we are tracking the new | 371 | * the destinationChanged() SIGNAL, which triggers the slewFocus() SLOT. Additionally, this | ||
350 | * object/position, adding a Planet Trail if required, etc. | 372 | * function performs some bookkeeping tasks, such updating whether we are tracking the new | ||
351 | * | 373 | * object/position, adding a Planet Trail if required, etc. | ||
352 | * @see destinationChanged() | 374 | * | ||
353 | * @see slewFocus() | 375 | * @see destinationChanged() | ||
354 | */ | 376 | * @see slewFocus() | ||
377 | */ | ||||
355 | void slotCenter(); | 378 | void slotCenter(); | ||
356 | 379 | | |||
357 | /** @short Popup menu function: Display 1st-Generation DSS image with the Image Viewer. | 380 | /** | ||
358 | * @note the URL is generated using the coordinates of ClickedPoint. | 381 | * @short Popup menu function: Display 1st-Generation DSS image with the Image Viewer. | ||
359 | */ | 382 | * @note the URL is generated using the coordinates of ClickedPoint. | ||
383 | */ | ||||
360 | void slotDSS(); | 384 | void slotDSS(); | ||
361 | 385 | | |||
362 | /** @short Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer. | 386 | /** | ||
363 | * @note the URL is generated using the coordinates of ClickedPoint. | 387 | * @short Popup menu function: Display Sloan Digital Sky Survey image with the Image Viewer. | ||
364 | */ | 388 | * @note the URL is generated using the coordinates of ClickedPoint. | ||
389 | */ | ||||
365 | void slotSDSS(); | 390 | void slotSDSS(); | ||
366 | 391 | | |||
367 | /** @short Popup menu function: Show webpage about ClickedObject | 392 | /** | ||
368 | * (only available for some objects). | 393 | * @short Popup menu function: Show webpage about ClickedObject | ||
369 | */ | 394 | * (only available for some objects). | ||
395 | */ | ||||
370 | void slotInfo(); | 396 | void slotInfo(); | ||
371 | 397 | | |||
372 | /** @short Popup menu function: Show image of ClickedObject | 398 | /** | ||
373 | * (only available for some objects). | 399 | * @short Popup menu function: Show image of ClickedObject | ||
374 | */ | 400 | * (only available for some objects). | ||
401 | */ | ||||
375 | void slotImage(); | 402 | void slotImage(); | ||
376 | 403 | | |||
377 | /** @short Popup menu function: Show the Detailed Information window for ClickedObject. */ | 404 | /** @short Popup menu function: Show the Detailed Information window for ClickedObject. */ | ||
378 | void slotDetail(); | 405 | void slotDetail(); | ||
379 | 406 | | |||
380 | /** Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which | 407 | /** | ||
381 | * have User Labels attached. | 408 | * Add ClickedObject to KStarsData::ObjLabelList, which stores pointers to SkyObjects which | ||
382 | */ | 409 | * have User Labels attached. | ||
410 | */ | ||||
383 | void slotAddObjectLabel(); | 411 | void slotAddObjectLabel(); | ||
384 | 412 | | |||
385 | /** Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which | 413 | /** | ||
386 | * have User Labels attached. | 414 | * Remove ClickedObject from KStarsData::ObjLabelList, which stores pointers to SkyObjects which | ||
387 | */ | 415 | * have User Labels attached. | ||
416 | */ | ||||
388 | void slotRemoveObjectLabel(); | 417 | void slotRemoveObjectLabel(); | ||
389 | 418 | | |||
390 | /** @short Add a Planet Trail to ClickedObject. | 419 | /** | ||
391 | * @note Trails are added simply by calling KSPlanetBase::addToTrail() to add the first point. | 420 | * @short Add a Planet Trail to ClickedObject. | ||
392 | * as long as the trail is not empty, new points will be automatically appended to it. | 421 | * @note Trails are added simply by calling KSPlanetBase::addToTrail() to add the first point. | ||
393 | * @note if ClickedObject is not a Solar System body, this function does nothing. | 422 | * as long as the trail is not empty, new points will be automatically appended to it. | ||
394 | * @see KSPlanetBase::addToTrail() | 423 | * @note if ClickedObject is not a Solar System body, this function does nothing. | ||
395 | */ | 424 | * @see KSPlanetBase::addToTrail() | ||
425 | */ | ||||
396 | void slotAddPlanetTrail(); | 426 | void slotAddPlanetTrail(); | ||
397 | 427 | | |||
398 | /** @short Remove the PlanetTrail from ClickedObject. | 428 | /** | ||
399 | * @note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as | 429 | * @short Remove the PlanetTrail from ClickedObject. | ||
400 | * the trail is empty, no new points will be automatically appended. | 430 | * @note The Trail is removed by simply calling KSPlanetBase::clearTrail(). As long as | ||
401 | * @see KSPlanetBase::clearTrail() | 431 | * the trail is empty, no new points will be automatically appended. | ||
402 | */ | 432 | * @see KSPlanetBase::clearTrail() | ||
433 | */ | ||||
403 | void slotRemovePlanetTrail(); | 434 | void slotRemovePlanetTrail(); | ||
404 | 435 | | |||
405 | /** Checks whether the timestep exceeds a threshold value. If so, sets | 436 | /** | ||
406 | * ClockSlewing=true and sets the SimClock to ManualMode. | 437 | * Checks whether the timestep exceeds a threshold value. If so, sets | ||
407 | */ | 438 | * ClockSlewing=true and sets the SimClock to ManualMode. | ||
439 | */ | ||||
408 | void slotClockSlewing(); | 440 | void slotClockSlewing(); | ||
409 | 441 | | |||
410 | /** Enables the angular distance measuring mode. It saves the first | 442 | /** | ||
411 | * position of the ruler in a SkyPoint. It makes difference between | 443 | * Enables the angular distance measuring mode. It saves the first | ||
412 | * having clicked on the skymap and not having done so | 444 | * position of the ruler in a SkyPoint. It makes difference between | ||
413 | * \note This method is draw-backend independent. | 445 | * having clicked on the skymap and not having done so | ||
414 | */ | 446 | * \note This method is draw-backend independent. | ||
447 | */ | ||||
415 | void slotBeginAngularDistance(); | 448 | void slotBeginAngularDistance(); | ||
416 | 449 | | |||
417 | void slotBeginStarHop(); // TODO: Add docs | 450 | void slotBeginStarHop(); // TODO: Add docs | ||
418 | 451 | | |||
419 | /** Computes the angular distance, prints the result in the status | 452 | /** | ||
420 | * bar and disables the angular distance measuring mode | 453 | * Computes the angular distance, prints the result in the status | ||
421 | * If the user has clicked on the map the status bar shows the | 454 | * bar and disables the angular distance measuring mode | ||
422 | * name of the clicked object plus the angular distance. If | 455 | * If the user has clicked on the map the status bar shows the | ||
423 | * the user did not clicked on the map, just pressed ], only | 456 | * name of the clicked object plus the angular distance. If | ||
424 | * the angular distance is printed | 457 | * the user did not clicked on the map, just pressed ], only | ||
425 | * \note This method is draw-backend independent. | 458 | * the angular distance is printed | ||
426 | */ | 459 | * \note This method is draw-backend independent. | ||
460 | */ | ||||
427 | void slotEndRulerMode(); | 461 | void slotEndRulerMode(); | ||
428 | 462 | | |||
429 | /** Disables the angular distance measuring mode. Nothing is printed | 463 | /** | ||
430 | * in the status bar */ | 464 | * Disables the angular distance measuring mode. Nothing is printed | ||
465 | * in the status bar | ||||
466 | */ | ||||
431 | void slotCancelRulerMode(); | 467 | void slotCancelRulerMode(); | ||
432 | 468 | | |||
433 | /** @short Open Flag Manager window with clickedObject() RA and Dec entered. | 469 | /** @short Open Flag Manager window with clickedObject() RA and Dec entered. */ | ||
434 | */ | | |||
435 | void slotAddFlag(); | 470 | void slotAddFlag(); | ||
436 | 471 | | |||
437 | /** @short Open Flag Manager window with selected flag focused and ready to edit. | 472 | /** | ||
438 | *@param flagIdx index of flag to be edited. | 473 | * @short Open Flag Manager window with selected flag focused and ready to edit. | ||
439 | */ | 474 | * @param flagIdx index of flag to be edited. | ||
475 | */ | ||||
440 | void slotEditFlag(int flagIdx); | 476 | void slotEditFlag(int flagIdx); | ||
441 | 477 | | |||
442 | /** @short Delete selected flag. | 478 | /** | ||
443 | *@param flagIdx index of flag to be deleted. | 479 | * @short Delete selected flag. | ||
444 | */ | 480 | * @param flagIdx index of flag to be deleted. | ||
481 | */ | ||||
445 | void slotDeleteFlag(int flagIdx); | 482 | void slotDeleteFlag(int flagIdx); | ||
446 | 483 | | |||
447 | #ifdef HAVE_OPENGL | 484 | #ifdef HAVE_OPENGL | ||
Context not available. | |||||
476 | void slotCaptureFov(); | 513 | void slotCaptureFov(); | ||
477 | 514 | | |||
478 | signals: | 515 | signals: | ||
479 | /** Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination | 516 | /** | ||
480 | * point is changed, slewFocus() will iteratively step the Focus toward Destination | 517 | * Emitted by setDestination(), and connected to slewFocus(). Whenever the Destination | ||
481 | * until it is reached. | 518 | * point is changed, slewFocus() will iteratively step the Focus toward Destination | ||
482 | * @see SkyMap::setDestination() | 519 | * until it is reached. | ||
483 | * @see SkyMap::slewFocus() | 520 | * @see SkyMap::setDestination() | ||
484 | */ | 521 | * @see SkyMap::slewFocus() | ||
522 | */ | ||||
485 | void destinationChanged(); | 523 | void destinationChanged(); | ||
486 | 524 | | |||
487 | /** Emitted when zoom level is changed. */ | 525 | /** Emitted when zoom level is changed. */ | ||
Context not available. | |||||
503 | void objectClicked(SkyObject *); | 541 | void objectClicked(SkyObject *); | ||
504 | 542 | | |||
505 | protected: | 543 | protected: | ||
506 | /** Process keystrokes: | 544 | /** | ||
507 | * @li arrow keys Slew the map | 545 | * Process keystrokes: | ||
508 | * @li +/- keys Zoom in and out | 546 | * @li arrow keys Slew the map | ||
509 | * @li <i>Space</i> Toggle between Horizontal and Equatorial coordinate systems | 547 | * @li +/- keys Zoom in and out | ||
510 | * @li 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon) | 548 | * @li <i>Space</i> Toggle between Horizontal and Equatorial coordinate systems | ||
511 | * @li [ Place starting point for measuring an angular distance | 549 | * @li 0-9 Go to a major Solar System body (0=Sun; 1-9 are the major planets, except 3=Moon) | ||
512 | * @li ] End point for Angular Distance; display measurement. | 550 | * @li [ Place starting point for measuring an angular distance | ||
513 | * @li <i>Escape</i> Cancel Angular measurement | 551 | * @li ] End point for Angular Distance; display measurement. | ||
514 | * @li ,/< Step backward one time step | 552 | * @li <i>Escape</i> Cancel Angular measurement | ||
515 | * @li ./> Step forward one time step | 553 | * @li ,/< Step backward one time step | ||
516 | */ | 554 | * @li ./> Step forward one time step | ||
555 | */ | ||||
517 | void keyPressEvent(QKeyEvent *e) override; | 556 | void keyPressEvent(QKeyEvent *e) override; | ||
518 | 557 | | |||
519 | /** When keyRelease is triggered, just set the "slewing" flag to false, | 558 | /** | ||
520 | * and update the display (to draw objects that are hidden when slewing==true). */ | 559 | * When keyRelease is triggered, just set the "slewing" flag to false, | ||
560 | * and update the display (to draw objects that are hidden when slewing==true). | ||||
561 | */ | ||||
521 | void keyReleaseEvent(QKeyEvent *e) override; | 562 | void keyReleaseEvent(QKeyEvent *e) override; | ||
522 | 563 | | |||
523 | /** Determine RA, Dec coordinates of clicked location. Find the SkyObject | 564 | /** | ||
524 | * which is nearest to the clicked location. | 565 | * Determine RA, Dec coordinates of clicked location. Find the SkyObject | ||
525 | * | 566 | * which is nearest to the clicked location. | ||
526 | * If left-clicked: Set set mouseButtonDown==true, slewing==true; display | 567 | * | ||
527 | * nearest object name in status bar. | 568 | * If left-clicked: Set set mouseButtonDown==true, slewing==true; display | ||
528 | * If right-clicked: display popup menu appropriate for nearest object. | 569 | * nearest object name in status bar. | ||
529 | */ | 570 | * If right-clicked: display popup menu appropriate for nearest object. | ||
571 | */ | ||||
530 | void mousePressEvent(QMouseEvent *e) override; | 572 | void mousePressEvent(QMouseEvent *e) override; | ||
531 | 573 | | |||
532 | /** set mouseButtonDown==false, slewing==false */ | 574 | /** Set mouseButtonDown==false, slewing==false */ | ||
533 | void mouseReleaseEvent(QMouseEvent *e) override; | 575 | void mouseReleaseEvent(QMouseEvent *e) override; | ||
534 | 576 | | |||
535 | /** Center SkyMap at double-clicked location */ | 577 | /** Center SkyMap at double-clicked location */ | ||
536 | void mouseDoubleClickEvent(QMouseEvent *e) override; | 578 | void mouseDoubleClickEvent(QMouseEvent *e) override; | ||
537 | 579 | | |||
538 | /** This function does several different things depending on the state of the program: | 580 | /** | ||
539 | * @li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor, | 581 | * This function does several different things depending on the state of the program: | ||
540 | * and continue this function. | 582 | * @li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor, | ||
541 | * @li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen, | 583 | * and continue this function. | ||
542 | * and return. | 584 | * @li If we are defining a ZoomBox, update the ZoomBox rectangle, redraw the screen, | ||
543 | * @li If dragging the mouse in the map, update focus such that RA, Dec under the mouse | 585 | * and return. | ||
544 | * cursor remains constant. | 586 | * @li If dragging the mouse in the map, update focus such that RA, Dec under the mouse | ||
545 | * @li If just moving the mouse, simply update the curso coordinates in the status bar. | 587 | * cursor remains constant. | ||
546 | */ | 588 | * @li If just moving the mouse, simply update the curso coordinates in the status bar. | ||
589 | */ | ||||
547 | void mouseMoveEvent(QMouseEvent *e) override; | 590 | void mouseMoveEvent(QMouseEvent *e) override; | ||
548 | 591 | | |||
549 | /** Zoom in and out with the mouse wheel. */ | 592 | /** Zoom in and out with the mouse wheel. */ | ||
550 | void wheelEvent(QWheelEvent *e) override; | 593 | void wheelEvent(QWheelEvent *e) override; | ||
551 | 594 | | |||
552 | /** If the skymap will be resized, the sky must be new computed. So this | 595 | /** | ||
553 | * function calls explicitly new computing of the skymap. | 596 | * If the skymap will be resized, the sky must be new computed. So this | ||
554 | */ | 597 | * function calls explicitly new computing of the skymap. | ||
598 | */ | ||||
555 | void resizeEvent(QResizeEvent *) override; | 599 | void resizeEvent(QResizeEvent *) override; | ||
556 | 600 | | |||
557 | private slots: | 601 | private slots: | ||
558 | /** @short display tooltip for object under cursor. It's called by m_HoverTimer. | 602 | /** | ||
559 | * if mouse didn't moved for last HOVER_INTERVAL milliseconds. | 603 | * @short display tooltip for object under cursor. It's called by m_HoverTimer. | ||
560 | */ | 604 | * if mouse didn't moved for last HOVER_INTERVAL milliseconds. | ||
605 | */ | ||||
561 | void slotTransientLabel(); | 606 | void slotTransientLabel(); | ||
562 | 607 | | |||
563 | /** Set the shape of mouse cursor to a cross with 4 arrows. */ | 608 | /** Set the shape of mouse cursor to a cross with 4 arrows. */ | ||
Context not available. | |||||
570 | /** @short Sets the shape of the mouse cursor to a magnifying glass. */ | 615 | /** @short Sets the shape of the mouse cursor to a magnifying glass. */ | ||
571 | void setZoomMouseCursor(); | 616 | void setZoomMouseCursor(); | ||
572 | 617 | | |||
573 | /** Calculate the zoom factor for the given keyboard modifier | 618 | /** Calculate the zoom factor for the given keyboard modifier */ | ||
574 | */ | | |||
575 | double zoomFactor(const int modifier); | 619 | double zoomFactor(const int modifier); | ||
576 | 620 | | |||
577 | /** calculate the magnitude factor (1, .5, .2, or .1) for the given | 621 | /** | ||
578 | * keyboard modifier. | 622 | * Calculate the magnitude factor (1, .5, .2, or .1) for the given keyboard modifier. | ||
579 | */ | 623 | */ | ||
580 | double magFactor(const int modifier); | 624 | double magFactor(const int modifier); | ||
581 | 625 | | |||
582 | /** Decrease the magnitude limit by a step size determined by the | 626 | /** | ||
583 | * keyboard modifier. | 627 | * Decrease the magnitude limit by a step size determined by the keyboard modifier. | ||
584 | * @param modifier | 628 | * | ||
585 | */ | 629 | * @param modifier | ||
630 | */ | ||||
586 | void decMagLimit(const int modifier); | 631 | void decMagLimit(const int modifier); | ||
587 | 632 | | |||
588 | /** Increase the magnitude limit by a step size determined by the | 633 | /** | ||
589 | * keyboard modifier. | 634 | * Increase the magnitude limit by a step size determined by the keyboard modifier. | ||
590 | * @param modifier | 635 | * | ||
591 | */ | 636 | * @param modifier | ||
637 | */ | ||||
592 | void incMagLimit(const int modifier); | 638 | void incMagLimit(const int modifier); | ||
593 | 639 | | |||
594 | /** Convenience routine to either zoom in or incraase mag limit | 640 | /** | ||
595 | * depending on the Alt modifier. The Shift and Control modiifers | 641 | * Convenience routine to either zoom in or incraase mag limit | ||
596 | * will adjust the size of the zoom or the mag step. | 642 | * depending on the Alt modifier. The Shift and Control modiifers | ||
597 | * @param modifier | 643 | * will adjust the size of the zoom or the mag step. | ||
598 | */ | 644 | * @param modifier | ||
645 | */ | ||||
599 | void zoomInOrMagStep(const int modifier); | 646 | void zoomInOrMagStep(const int modifier); | ||
600 | 647 | | |||
601 | /** Convenience routine to either zoom out or decraase mag limit | 648 | /** | ||
602 | * depending on the Alt modifier. The Shift and Control modiifers | 649 | * Convenience routine to either zoom out or decraase mag limit | ||
603 | * will adjust the size of the zoom or the mag step. | 650 | * depending on the Alt modifier. The Shift and Control modiifers | ||
604 | * @param modifier | 651 | * will adjust the size of the zoom or the mag step. | ||
605 | */ | 652 | * @param modifier | ||
653 | */ | ||||
606 | void zoomOutOrMagStep(const int modifier); | 654 | void zoomOutOrMagStep(const int modifier); | ||
607 | 655 | | |||
608 | void beginRulerMode(bool starHopRuler); // TODO: Add docs | 656 | void beginRulerMode(bool starHopRuler); // TODO: Add docs | ||
Context not available. |