Modified to allow more than one catalog number (from different catalogs) for a star.
This commit is contained in:
parent
a6f990bd3a
commit
ed830bbe1b
|
@ -142,7 +142,12 @@ float Star::getRotationPeriod() const
|
|||
|
||||
void Star::setCatalogNumber(uint32 n)
|
||||
{
|
||||
catalogNumber = n;
|
||||
catalogNumbers[0] = n;
|
||||
}
|
||||
|
||||
void Star::setCatalogNumber(unsigned int which, uint32 n)
|
||||
{
|
||||
catalogNumbers[which] = n;
|
||||
}
|
||||
|
||||
void Star::setPosition(float x, float y, float z)
|
||||
|
|
24
src/star.h
24
src/star.h
|
@ -22,6 +22,7 @@ public:
|
|||
inline Star();
|
||||
|
||||
inline uint32 getCatalogNumber() const;
|
||||
inline uint32 getCatalogNumber(unsigned int) const;
|
||||
inline StellarClass getStellarClass() const;
|
||||
inline Point3f getPosition() const;
|
||||
inline float getAbsoluteMagnitude() const;
|
||||
|
@ -32,6 +33,7 @@ public:
|
|||
float getRotationPeriod() const;
|
||||
|
||||
void setCatalogNumber(uint32);
|
||||
void setCatalogNumber(unsigned int, uint32);
|
||||
void setPosition(float, float, float);
|
||||
void setPosition(Point3f);
|
||||
void setStellarClass(StellarClass);
|
||||
|
@ -39,27 +41,39 @@ public:
|
|||
void setLuminosity(float);
|
||||
|
||||
enum {
|
||||
InvalidStar = 0xffffffff
|
||||
InvalidCatalogNumber = 0xffffffff
|
||||
};
|
||||
|
||||
enum {
|
||||
HIPCatalog = 0,
|
||||
HDCatalog = 1,
|
||||
CatalogCount = 2,
|
||||
};
|
||||
|
||||
private:
|
||||
uint32 catalogNumber;
|
||||
uint32 catalogNumbers[CatalogCount];
|
||||
Point3f position;
|
||||
float absMag;
|
||||
StellarClass stellarClass;
|
||||
};
|
||||
|
||||
|
||||
Star::Star() : catalogNumber(0),
|
||||
position(0, 0, 0),
|
||||
Star::Star() : position(0, 0, 0),
|
||||
absMag(4.83f),
|
||||
stellarClass()
|
||||
{
|
||||
for (int i = 0; i < CatalogCount; i++)
|
||||
catalogNumbers[i] = InvalidCatalogNumber;
|
||||
}
|
||||
|
||||
uint32 Star::getCatalogNumber() const
|
||||
{
|
||||
return catalogNumber;
|
||||
return catalogNumbers[0];
|
||||
}
|
||||
|
||||
uint32 Star::getCatalogNumber(unsigned int which) const
|
||||
{
|
||||
return catalogNumbers[which];
|
||||
}
|
||||
|
||||
float Star::getAbsoluteMagnitude() const
|
||||
|
|
Loading…
Reference in a new issue