Stellarium  0.21.3
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
SceneInfo Struct Reference

Contains all the metadata necessary for a Scenery3d scene, and can be loaded from special .ini files in a scene's folder.

#include <SceneInfo.hpp>

Public Member Functions

bool hasLocation () const
 Returns true if the location object is valid.
 
bool hasLookAtFOV () const
 Returns true if the lookat_fov is valid.
 
QString getLocalizedHTMLDescription () const
 Tries to find a description. More...
 

Static Public Member Functions

static bool loadByID (const QString &id, SceneInfo &info)
 Loads the scene metadata associated with this ID (directory) into the given object. Returns true on success.
 
static bool loadByName (const QString &name, SceneInfo &info)
 Convenience method that finds the ID for the given name and calls loadByID.
 
static QString getIDFromName (const QString &name)
 Returns the ID for the given scene name. More...
 
static QStringList getAllSceneIDs ()
 Returns all available scene IDs.
 
static QStringList getAllSceneNames ()
 Returns all available scene names.
 
static QMap< QString, QString > getNameToIDMap ()
 Builds a mapping of available scene names to the folders they are contained in, similar to the LandscapeMgr's method.
 

Data Fields

bool isValid
 If this is a valid sceneInfo object loaded from file.
 
QString id
 ID of the scene (relative directory)
 
QString fullPath
 The full path to the scene's folder. Other paths (model files) are to be seen relative to this path.
 
QString name
 Name of the scene.
 
QString author
 Author of the scene.
 
QString description
 A description, which can be displayed in the GUI - supporting HTML tags! Note that this description, as stored in the scenery3d.ini, is only meant as a fallback. More...
 
QString copyright
 Copyright string.
 
QString landscapeName
 The name of the landscape to switch to. The landscape's position is applied on loading.
 
QString modelScenery
 The file name of the scenery .obj model.
 
QString modelGround
 The file name of the optional seperate ground model (used as a heightmap for walking)
 
QString vertexOrder
 Optional string depicting vertex order of models (XYZ, ZXY, ...)
 
StelOBJ::VertexOrder vertexOrderEnum
 The vertex order of the corresponding OBJ file.
 
float camNearZ
 Distance to cam near clipping plane. Default 0.3.
 
float camFarZ
 Distance to cam far clipping plane. Default 10000.0.
 
float shadowFarZ
 An optional shadow far clipping plane, constraining the shadowmaps to a smaller region than is visible. More...
 
float shadowSplitWeight
 Weighting of the shadow frustum splits between uniform (at 0) and logarithmic (at 1) splits When -1, should be calculated from the scene using the old algorithm.
 
QSharedPointer< StelLocationlocation
 Optional more accurate location information, which will override the landscape's position.
 
Vec3f lookAt_fov
 Optional initial look-at vector (azimuth, elevation and FOV in degrees)
 
double eyeLevel
 The height at which the observer's eyes are placed. Default 1.65.
 
QString gridName
 The name of the grid space for displaying the world positon.
 
Vec3d modelWorldOffset
 Offset of the center of the model in a given grid space.
 
Vec3d startWorldOffset
 The world grid space offset where the observer is placed upon loading.
 
Vec3d relativeStartPosition
 Relative start position in model space, calculated from the world offset and start offset with Z rotation, etc.
 
bool altitudeFromModel
 If true, it indicates that the model file's bounding box is used for altitude calculation.
 
bool startPositionFromModel
 If true, it indicates that the model file's bounding box is used for starting position calculation.
 
bool groundNullHeightFromModel
 If true, it indicates that the model file's bounding box is used for starting height calculation.
 
Mat4d obj2gridMatrix
 If only a non-georeferenced OBJ can be provided, you can specify a matrix via .ini/[model]/obj_world_trafo. More...
 
Mat4d zRotateMatrix
 The vertical axis rotation that must be applied to the scene, for meridian convergence. More...
 
double groundNullHeight
 The height value outside the ground model's heightmap, or used if no ground model exists.
 
float transparencyThreshold
 Threshold for cutout transparency (no blending). Default is 0.5f.
 
bool sceneryGenerateNormals
 Recalculate normals of the scene from face normals? Default false.
 
bool groundGenerateNormals
 Recalculate normals of the ground from face normals? Default false.
 

Static Public Attributes

static const QString SCENES_PATH
 The folder for scenery is found here.
 

Member Function Documentation

◆ getIDFromName()

static QString SceneInfo::getIDFromName ( const QString &  name)
static

If multiple scenes exist with the same name, the first one found is returned. If no scene is found with this name, an empty string is returned.

◆ getLocalizedHTMLDescription()

QString SceneInfo::getLocalizedHTMLDescription ( ) const

<language>.utf8 file for this scene, and returns its contents. If no such file exists, the description.en.utf8 is checked. If this is also missing, a null QString is returned. Consider using the value of SceneInfo::description in this case.

Field Documentation

◆ description

QString SceneInfo::description

The better way would be to create description.<lang>.utf8 files in the scene's folder. This can then be retrieved using getLocalizedHTMLDescription.

◆ obj2gridMatrix

Mat4d SceneInfo::obj2gridMatrix

This will be applied to make sure that X=Grid-East, Y=Grid-North, Z=height.

◆ shadowFarZ

float SceneInfo::shadowFarZ

Must be smaller or equal to camFarZ. Default equals camFarZ.

◆ zRotateMatrix

Mat4d SceneInfo::zRotateMatrix

This is calculated from other fields in the file.