StarBlock
#include <starblock.h>
Public Types | |
typedef StarObject | StarBlockEntry |
Public Member Functions | |
StarBlock (int nstars=100) | |
StarBlockEntry * | addStar (const DeepStarData &data) |
StarBlockEntry * | addStar (const StarData &data) |
QVector< StarBlockEntry > & | contents () |
float | getBrightMag () const |
float | getFaintMag () const |
int | getStarCount () const |
bool | isFull () const |
void | reset () |
int | size () const |
StarBlockEntry * | star (int i) |
Public Attributes | |
float | brightMag { 0 } |
quint32 | drawID { 0 } |
float | faintMag { 0 } |
std::shared_ptr< StarBlock > | next |
StarBlockList * | parent |
std::shared_ptr< StarBlock > | prev |
Detailed Description
Holds a block of stars and various peripheral variables to mark its place in data structures
- Version
- 1.0
Definition at line 42 of file starblock.h.
Constructor & Destructor Documentation
◆ StarBlock()
|
explicit |
Constructor.
Initializes values of various parameters and creates nstars number of stars
- Parameters
-
nstars Number of stars to hold in this StarBlock
Definition at line 33 of file starblock.cpp.
Member Function Documentation
◆ addStar()
StarObject * StarBlock::addStar | ( | const StarData & | data | ) |
Initialize another star with data.
FIXME: StarObject::init doesn't reset object name(s). It shouldn't be issue since stars which are swapped in/out do not have names.
- Parameters
-
data data to initialize star with.
- Returns
- pointer to star initialized with data. nullptr if block is full.
Definition at line 85 of file starblock.cpp.
◆ contents()
|
inline |
- Returns
- a reference to the internal container of this
- Note
- This is bad – is there a way of providing non-const access to the list's elements without allowing altering of the list alone?
Definition at line 108 of file starblock.h.
◆ getBrightMag()
|
inline |
Return the magnitude of the brightest star in this StarBlock.
- Returns
- Magnitude of the brightest star
Definition at line 116 of file starblock.h.
◆ getFaintMag()
|
inline |
Return the magnitude of the faintest star in this StarBlock.
- Returns
- Magnitude of the faintest star
Definition at line 123 of file starblock.h.
◆ getStarCount()
|
inline |
Return the number of stars currently filled in this StarBlock.
- Returns
- Number of stars filled in this StarBlock
Definition at line 130 of file starblock.h.
◆ isFull()
|
inline |
Returns true if the StarBlock is full.
- Returns
- true if full, false if not full
Definition at line 81 of file starblock.h.
◆ reset()
void StarBlock::reset | ( | ) |
Reset this StarBlock's data, for reuse of the StarBlock.
Definition at line 43 of file starblock.cpp.
◆ size()
|
inline |
Return the capacity of this StarBlock.
This is different from nStars. While nStars indicates the number of stars that this StarBlock actually holds, this method returns the number of stars for which we have allocated memory. Thus, this method should return a number >= nStars.
- Returns
- The number of stars that this StarBlock can hold
Definition at line 92 of file starblock.h.
◆ star()
|
inline |
Return the i-th star in this StarBlock.
- Parameters
-
i Index of StarBlock to return
- Returns
- A pointer to the i-th StarObject
Definition at line 100 of file starblock.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Jun 9 2023 04:02:30 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.