Kstars

listcomponent.h
1/*
2 SPDX-FileCopyrightText: 2005 Jason Harris <kstars@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "skycomponent.h"
10
11#include <QList>
12
13class SkyComposite;
14class SkyMap;
15
16/**
17 * @class ListComponent
18 * An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
19 *
20 * @author Jason Harris
21 * @version 0.1
22 */
24{
25 public:
27
28 ~ListComponent() override;
29
30 /**
31 * @short Update the sky positions of this component.
32 *
33 * This function usually just updates the Horizontal (Azimuth/Altitude)
34 * coordinates of the objects in this component. If the KSNumbers*
35 * argument is not nullptr, this function also recomputes precession and
36 * nutation for the date in KSNumbers.
37 * @p num Pointer to the KSNumbers object
38 * @note By default, the num parameter is nullptr, indicating that
39 * Precession/Nutation computation should be skipped; this computation
40 * is only occasionally required.
41 */
42 void update(KSNumbers *num = nullptr) override;
43
44 SkyObject *findByName(const QString &name, bool exact = true) override;
45 SkyObject *objectNearest(SkyPoint *p, double &maxrad) override;
46
47 void clear();
48
49 const QList<SkyObject *> &objectList() const
50 {
51 return m_ObjectList;
52 }
53
54 /**
55 * @short Add an object to the Object list.
56 *
57 * This method is a handy wrapper, which automatically appends the given
58 * SkyObject to m_ObjectList and inserts references with all common names (name,
59 * name2, longname) into the m_ObjectHash QHash to enable a faster findbyname.
60 */
61 void appendListObject(SkyObject * object);
62
63 protected:
64 QList<SkyObject *> m_ObjectList;
65 QHash<QString, SkyObject *> m_ObjectHash;
66};
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
void appendListObject(SkyObject *object)
Add an object to the Object list.
SkyObject * findByName(const QString &name, bool exact=true) override
Search the children of this SkyComponent for a SkyObject whose name matches the argument name the nam...
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
void update(KSNumbers *num=nullptr) override
Update the sky positions of this component.
SkyComponent represents an object on the sky map.
SkyComposite * parent()
SkyComposite is a kind of container class for SkyComponent objects.
This is the canvas on which the sky is painted.
Definition skymap.h:54
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.