Stellarium  25.4
Public Member Functions | Data Fields | Static Public Attributes
scm::ScmConstellation Class Reference

Public Member Functions

 ScmConstellation (const QString &id, const std::vector< ConstellationLine > &lines, const bool isDarkConstellation)
 
QString getId () const
 Gets the id of the constellation. More...
 
void setEnglishName (const QString &name)
 Sets the english name of the constellation. More...
 
QString getEnglishName () const
 Gets the english name of the constellation. More...
 
void setNativeName (const std::optional< QString > &name)
 Sets the native name of the constellation. More...
 
std::optional< QString > getNativeName () const
 Gets the native name of the constellation. More...
 
void setPronounce (const std::optional< QString > &pronounce)
 Sets the pronounciation of the constellation. More...
 
std::optional< QString > getPronounce () const
 Gets the pronounciation of the constellation. More...
 
void setIPA (const std::optional< QString > &ipa)
 Sets the IPA. More...
 
std::optional< QString > getIPA () const
 Gets the IPA. More...
 
void setDescription (const QString &description)
 Sets the description of the constellation. More...
 
QString getDescription () const
 Gets the description of the constellation. More...
 
void setArtwork (const ScmConstellationArtwork &artwork)
 Sets the artwork. More...
 
const ScmConstellationArtworkgetArtwork () const
 Gets the artwork. More...
 
void setLines (const std::vector< ConstellationLine > &lines)
 Sets the lines of the constellation. More...
 
const std::vector< ConstellationLine > & getLines () const
 Gets the lines of the constellation. More...
 
void draw (StelCore *core) const
 Draws the constellation lines, name and artwork using default colors. More...
 
void drawLines (StelPainter &sPainter, const Vec3f &lineColor) const
 Draws the constellation lines. More...
 
void drawName (StelCore *core, StelPainter &painter, const Vec3f &labelColor) const
 Draws the label of the constellation. More...
 
void drawArtwork (StelCore *core, StelPainter &painter) const
 Draws the artwork of the constellation. More...
 
QJsonObject toJson (const QString &skyCultureId, const bool mergeLines) const
 Returns the constellation data as a JSON object. More...
 
bool saveArtwork (const QString &directory)
 Saves the artwork of this constellation, if art is attached, to the give filepath. More...
 
bool getIsDarkConstellation () const
 Returns whether the constellation is a dark constellation. More...
 

Data Fields

bool isHidden = false
 Whether the constellation should be drawn or not.
 

Static Public Attributes

static const StelCore::FrameType drawFrame = StelCore::FrameJ2000
 The frame that is used for calculation and is drawn on.
 

Member Function Documentation

◆ draw()

void scm::ScmConstellation::draw ( StelCore core) const

Draws the constellation lines, name and artwork using default colors.

Parameters
coreThe core used for drawing.

◆ drawArtwork()

void scm::ScmConstellation::drawArtwork ( StelCore core,
StelPainter painter 
) const

Draws the artwork of the constellation.

Parameters
coreThe core used for drawing.
painterThe painter used for drawing.

◆ drawLines()

void scm::ScmConstellation::drawLines ( StelPainter sPainter,
const Vec3f lineColor 
) const

Draws the constellation lines.

Parameters
sPainterThe painter used for drawing.
lineColorThe color of the lines.

◆ drawName()

void scm::ScmConstellation::drawName ( StelCore core,
StelPainter painter,
const Vec3f labelColor 
) const

Draws the label of the constellation.

Parameters
coreThe core used for drawing.
painterThe painter used for drawing.
labelColorThe color of the label.

◆ getArtwork()

const ScmConstellationArtwork& scm::ScmConstellation::getArtwork ( ) const

Gets the artwork.

Returns
The artwork.

◆ getDescription()

QString scm::ScmConstellation::getDescription ( ) const
inline

Gets the description of the constellation.

Returns
The description.

◆ getEnglishName()

QString scm::ScmConstellation::getEnglishName ( ) const

Gets the english name of the constellation.

Returns
The english name

◆ getId()

QString scm::ScmConstellation::getId ( ) const

Gets the id of the constellation.

Returns
id

◆ getIPA()

std::optional<QString> scm::ScmConstellation::getIPA ( ) const

Gets the IPA.

Returns
The optional ipa

◆ getIsDarkConstellation()

bool scm::ScmConstellation::getIsDarkConstellation ( ) const
inline

Returns whether the constellation is a dark constellation.

Returns
true If the constellation is a dark constellation, false otherwise.

◆ getLines()

const std::vector<ConstellationLine>& scm::ScmConstellation::getLines ( ) const

Gets the lines of the constellation.

Returns
The lines of the constellation.

◆ getNativeName()

std::optional<QString> scm::ScmConstellation::getNativeName ( ) const

Gets the native name of the constellation.

Returns
The native name

◆ getPronounce()

std::optional<QString> scm::ScmConstellation::getPronounce ( ) const

Gets the pronounciation of the constellation.

Returns
The pronounciation

◆ saveArtwork()

bool scm::ScmConstellation::saveArtwork ( const QString &  directory)

Saves the artwork of this constellation, if art is attached, to the give filepath.

Parameters
directoryThe directory to the illustrations.
Returns
true Successful saved.
false Failed to save.

◆ setArtwork()

void scm::ScmConstellation::setArtwork ( const ScmConstellationArtwork artwork)

Sets the artwork.

Parameters
artworkThe artwork.

◆ setDescription()

void scm::ScmConstellation::setDescription ( const QString &  description)
inline

Sets the description of the constellation.

Parameters
descriptionThe description.

◆ setEnglishName()

void scm::ScmConstellation::setEnglishName ( const QString &  name)

Sets the english name of the constellation.

Parameters
nameThe english name

◆ setIPA()

void scm::ScmConstellation::setIPA ( const std::optional< QString > &  ipa)

Sets the IPA.

Parameters
ipaThe optional ipa

◆ setLines()

void scm::ScmConstellation::setLines ( const std::vector< ConstellationLine > &  lines)

Sets the lines of the constellation.

Parameters
linesThe lines of the constellation.

◆ setNativeName()

void scm::ScmConstellation::setNativeName ( const std::optional< QString > &  name)

Sets the native name of the constellation.

Parameters
nameThe native name

◆ setPronounce()

void scm::ScmConstellation::setPronounce ( const std::optional< QString > &  pronounce)

Sets the pronounciation of the constellation.

Parameters
pronounceThe pronounciation

◆ toJson()

QJsonObject scm::ScmConstellation::toJson ( const QString &  skyCultureId,
const bool  mergeLines 
) const

Returns the constellation data as a JSON object.

Parameters
skyCultureIdThe ID of the sky culture to which this constellation belongs.
mergeLinesWhether to merge lines into polylines where possible.
Returns
QJsonObject