Search for usage in LXR

PlanetMoonsNode Class Reference

#include <planetmoonsnode.h>

Inheritance diagram for PlanetMoonsNode:

Public Member Functions

 PlanetMoonsNode (KSPlanetBase *planet, RootNode *parentNode)
void addMoons (PlanetMoons *planetMoons)
virtual void hide () override
virtual void update () override
void updateMoons ()
- Public Member Functions inherited from SkyNode
 SkyNode (SkyObject *skyObject)
void addChildNode (QSGNode *node)
virtual void changePos (QPointF pos)
int hideCount ()
SkyMapLitemap () const
const Projectorprojector ()
virtual void show ()
SkyObjectskyObject () const
void update (bool drawLabel)
bool visible ()
- Public Member Functions inherited from QSGTransformNode
const QMatrix4x4matrix () const const
void setMatrix (const QMatrix4x4 &matrix)
- Public Member Functions inherited from QSGNode
void appendChildNode (QSGNode *node)
QSGNodechildAtIndex (int i) const const
int childCount () const const
QSGNodefirstChild () const const
Flags flags () const const
void insertChildNodeAfter (QSGNode *node, QSGNode *after)
void insertChildNodeBefore (QSGNode *node, QSGNode *before)
virtual bool isSubtreeBlocked () const const
QSGNodelastChild () const const
void markDirty (DirtyState bits)
QSGNodenextSibling () const const
QSGNodeparent () const const
void prependChildNode (QSGNode *node)
virtual void preprocess ()
QSGNodepreviousSibling () const const
void removeAllChildNodes ()
void removeChildNode (QSGNode *node)
void setFlag (Flag f, bool enabled)
void setFlags (Flags f, bool enabled)
NodeType type () const const

Additional Inherited Members

- Public Types inherited from QSGNode
enum  DirtyStateBit
enum  Flag
enum  NodeType
- Public Attributes inherited from SkyNode
SkyOpacityNodem_opacity { nullptr }
- Public Attributes inherited from QSGNode
typedef DirtyState
typedef Flags
- Protected Attributes inherited from SkyNode
bool m_drawLabel { false }
int m_hideCount { 0 }
SkyObjectm_skyObject { nullptr }

Detailed Description

A SkyNode derived class used as a container for displaying a planet with its moons (if any).

Unlike PlanetMoons derived from SkyComponent PlanetMoonsNode represents both planet and moons. Ths PlanetNode shouldn't be instantiated outside of this class (exception is AsteroidsItem). Although all SkyNodes are "movable" objects (they change transform matrix to move across the SkyMapLite) this class is just a container that provides z-order for moons and planets that change their positions on their own.

A container for planets and moons that provides z-order.

Artem Fedoskin

Definition at line 30 of file planetmoonsnode.h.

Constructor & Destructor Documentation

◆ PlanetMoonsNode()

PlanetMoonsNode::PlanetMoonsNode ( KSPlanetBase * planet,
RootNode * parentNode )


planetpointer to planet object
parentNodepointer to the RootNode. It is needed for PointSourceNodes that use textures, which are cached in RootNode.

Definition at line 15 of file planetmoonsnode.cpp.

◆ ~PlanetMoonsNode()

PlanetMoonsNode::~PlanetMoonsNode ( )

Definition at line 23 of file planetmoonsnode.cpp.

Member Function Documentation

◆ addMoons()

void PlanetMoonsNode::addMoons ( PlanetMoons * planetMoons)

Add object of type PlanetMoons to this node.

planetMoonsPlanetMoons component

Definition at line 46 of file planetmoonsnode.h.

◆ hide()

void PlanetMoonsNode::hide ( )

Hides both planet and its moons.

Reimplemented from SkyNode.

Definition at line 37 of file planetmoonsnode.cpp.

◆ update()

void PlanetMoonsNode::update ( )

If planet has any moons first updateMoons() is called then the planet is updated.

Reimplemented from SkyNode.

Definition at line 31 of file planetmoonsnode.cpp.

◆ updateMoons()

void PlanetMoonsNode::updateMoons ( )

Update position of moons if planet has them.

To allow z-ordering we need to change the structure of node tree by removing all child nodes of this tree and adding them again so that moons that are behind the planet are before the m_planetNode in the hierarchy and all others are appended after m_planetNode.

Definition at line 48 of file planetmoonsnode.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.