kstars
#include <starblock.h>
Public Member Functions | |
StarBlock (int nstars=100) | |
~StarBlock () | |
StarObject * | addStar (const starData &data) |
StarObject * | addStar (const deepStarData &data) |
float | getBrightMag () |
float | getFaintMag () |
int | getStarCount () |
bool | isFull () |
void | reset () |
int | size () |
StarObject * | star (int i) |
Public Attributes | |
float | brightMag |
quint32 | drawID |
float | faintMag |
StarBlock * | next |
StarBlockList * | parent |
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 38 of file starblock.h.
Constructor & Destructor Documentation
|
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 27 of file starblock.cpp.
StarBlock::~StarBlock | ( | ) |
Destructor Deletes all stored stars.
Definition at line 49 of file starblock.cpp.
Member Function Documentation
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. NULL if block is full.
Definition at line 55 of file starblock.cpp.
StarObject * StarBlock::addStar | ( | const deepStarData & | data | ) |
Definition at line 69 of file starblock.cpp.
|
inline |
Return the magnitude of the brightest star in this StarBlock.
- Returns
- Magnitude of the brightest star
Definition at line 97 of file starblock.h.
|
inline |
Return the magnitude of the faintest star in this StarBlock.
- Returns
- Magnitude of the faintest star
Definition at line 104 of file starblock.h.
|
inline |
Return the number of stars currently filled in this StarBlock.
- Returns
- Number of stars filled in this StarBlock
Definition at line 110 of file starblock.h.
|
inline |
Returns true if the StarBlock is full.
- Returns
- true if full, false if not full
Definition at line 70 of file starblock.h.
void StarBlock::reset | ( | void | ) |
Reset this StarBlock's data, for reuse of the StarBl.
Definition at line 39 of file starblock.cpp.
|
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 81 of file starblock.h.
|
inline |
Return the i-th star in this StarBlock.
- Parameters
-
Index of StarBlock to return
- Returns
- A pointer to the i-th StarObject
Definition at line 89 of file starblock.h.
Member Data Documentation
float StarBlock::brightMag |
Definition at line 118 of file starblock.h.
quint32 StarBlock::drawID |
Definition at line 122 of file starblock.h.
float StarBlock::faintMag |
Definition at line 117 of file starblock.h.
StarBlock* StarBlock::next |
Definition at line 121 of file starblock.h.
StarBlockList* StarBlock::parent |
Definition at line 119 of file starblock.h.
StarBlock* StarBlock::prev |
Definition at line 120 of file starblock.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.