Kstars

highpmstarlist.h
1/*
2 SPDX-FileCopyrightText: 2007 James B. Bowlin <bowlin@mindspring.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ksnumbers.h"
10#include "typedef.h"
11
12struct HighPMStar;
13class SkyMesh;
14
15/** @class HighPMStarList
16 * Holds a list of stars with high proper motion along with the trixel each star
17 * is currently located in. The purpose of this class is to save some time by
18 * only re-indexing the stars with high proper motion instead of the entire
19 * collection of stars (which takes about 4 seconds on a AMD64 3600).
20 *
21 * Multiple HighPMStarList's can be used so we re-index a smaller number of
22 * stars more frequently and a larger number of stars less frequently.
23 *
24 *
25 * @author James B. Bowlin @version 0.1
26*/
27
29{
30 public:
31 /** @short Constructor */
32 explicit HighPMStarList(double threshold);
34
35 /**
36 * @short adds the star located at trixel to the list if the pm is
37 * greater than the threshold. We also use the pm to determine the
38 * update interval. Returns true if the star was appended and false
39 * otherwise.
40 */
41 bool append(Trixel trixel, StarObject *star, double pm);
42
43 /** @short returns the threshold. */
44 double threshold() const { return m_threshold; }
45
46 /** @short returns the number of stars in the list. */
47 int size() const { return m_stars.size(); }
48
49 /**
50 * @short sets the time this list was last indexed to. Normally this
51 * is done automatically in the reindex() routine but this is useful
52 * if the entire starIndex gets re-indexed.
53 */
54 void setIndexTime(KSNumbers *num);
55
56 /**
57 * @short if the date in num differs from the last time we indexed by
58 * more than our update interval then we re-index all the stars in our
59 * list that have actually changed trixels.
60 */
62
63 /** @short prints out some brief statistics. */
64 void stats();
65
66 private:
68
69 KSNumbers m_reindexNum;
70 double m_reindexInterval { 0 };
71 double m_threshold { 0 };
72 double m_maxPM { 0 };
73
74 SkyMesh *m_skyMesh { nullptr };
75};
Holds a list of stars with high proper motion along with the trixel each star is currently located in...
void setIndexTime(KSNumbers *num)
sets the time this list was last indexed to.
void stats()
prints out some brief statistics.
int size() const
returns the number of stars in the list.
HighPMStarList(double threshold)
Constructor.
bool append(Trixel trixel, StarObject *star, double pm)
adds the star located at trixel to the list if the pm is greater than the threshold.
double threshold() const
returns the threshold.
bool reindex(KSNumbers *num, StarIndex *starIndex)
if the date in num differs from the last time we indexed by more than our update interval then we re-...
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
Provides an interface to the Hierarchical Triangular Mesh (HTM) library written by A.
Definition skymesh.h:74
This is a subclass of SkyObject.
Definition starobject.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:04 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.