Kstars

constellationboundarylines.h
1 /*
2  SPDX-FileCopyrightText: 2005 Jason Harris <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "noprecessindex.h"
10 
11 #include <QHash>
12 #include <QPolygonF>
13 
14 class PolyList;
16 class KSFileReader;
17 
20 
21 /**
22  * @class ConstellationBoundary
23  * Collection of lines comprising the borders between constellations
24  *
25  * @author Jason Harris
26  * @version 0.1
27  */
28 class ConstellationBoundaryLines : public NoPrecessIndex
29 {
30  public:
31  /**
32  * @short Constructor
33  * Simply adds all of the coordinate grid circles (meridians and parallels)
34  * @p parent Pointer to the parent SkyComposite object
35  *
36  * Reads the constellation boundary data from cbounds.dat. The boundary data is defined by
37  * a series of RA,Dec coordinate pairs defining the "nodes" of the boundaries. The nodes are
38  * organized into "segments", such that each segment represents a continuous series
39  * of boundary-line intervals that divide two particular constellations.
40  */
41  explicit ConstellationBoundaryLines(SkyComposite *parent);
42  virtual ~ConstellationBoundaryLines() override = default;
43 
44  QString constellationName(const SkyPoint *p) const;
45 
46  bool selected() override;
47 
48  void preDraw(SkyPainter *skyp) override;
49 
50  private:
51  void appendPoly(const std::shared_ptr<PolyList> &polyList, int debug = 0);
52 
53  /**
54  * @short reads the indices from the KSFileReader instead of using
55  * the SkyMesh to create them. If the file pointer is null or if
56  * debug == -1 then we fall back to using the index.
57  */
58  void appendPoly(std::shared_ptr<PolyList> &polyList, KSFileReader *file, int debug);
59 
60  PolyList *ContainingPoly(const SkyPoint *p) const;
61 
62  SkyMesh *m_skyMesh { nullptr };
63  PolyIndex m_polyIndex;
64  int m_polyIndexCnt { 0 };
65 };
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
virtual bool selected()
Definition: skycomponent.h:131
Draws things on the sky, without regard to backend.
Definition: skypainter.h:37
virtual void preDraw(SkyPainter *skyp)
Gives the subclasses access to the top of the draw() method.
void appendPoly(const std::shared_ptr< LineList > &lineList)
Typically called from within a subclasses constructors.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:13:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.