Kstars

skyline.h
1 /*
2  SPDX-FileCopyrightText: 2006 Jason Harris <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "skypoint.h"
10 
11 class dms;
12 class KStarsData;
13 
14 /**
15  * @class SkyLine
16  *
17  * A series of connected line segments in the sky, composed of SkyPoints at
18  * its vertices. SkyLines are used for constellation lines and boundaries,
19  * the coordinate grid, and the equator, ecliptic and horizon.
20  *
21  * @note the SkyLine segments are always straight lines, they are not
22  * Great Circle segments joining the two endpoints. Therefore, line segments
23  * that need to follow great circles must be approximated with many short
24  * SkyLine segments.
25  */
26 class SkyLine
27 {
28  public:
29  SkyLine() = default;
30 
31  ~SkyLine();
32 
33  /**
34  * Append a segment to the list by adding a new endpoint.
35  *
36  * @param p the new endpoint to be added
37  */
38  void append(SkyPoint *p);
39 
40  /**
41  * @return a const pointer to a point in the SkyLine
42  * param i the index position of the point
43  */
44  inline SkyPoint *point(int i) const { return m_pList[i]; }
45 
46  inline QList<SkyPoint *> &points() { return m_pList; }
47 
48  /** Remove all points from list */
49  void clear();
50 
51  /**
52  * Set point i in the SkyLine
53  *
54  * @param i the index position of the point to modify
55  * @param p the new SkyPoint
56  */
57  void setPoint(int i, SkyPoint *p);
58 
59  /**
60  * @return the angle subtended by any line segment along the SkyLine.
61  * @param i the index of the line segment to be measured.
62  * If no argument is given, the first segment is assumed.
63  */
64  dms angularSize(int i = 0) const;
65 
66  void update(KStarsData *data, KSNumbers *num = nullptr);
67 
68  private:
69  QList<SkyPoint *> m_pList;
70 };
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
dms angularSize(int i=0) const
Definition: skyline.cpp:40
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
void clear()
Remove all points from list.
Definition: skyline.cpp:19
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:37
SkyPoint * point(int i) const
Definition: skyline.h:44
void setPoint(int i, SkyPoint *p)
Set point i in the SkyLine.
Definition: skyline.cpp:30
void append(SkyPoint *p)
Append a segment to the list by adding a new endpoint.
Definition: skyline.cpp:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:02:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.