/** *************************************************************************
                          planetsitem.h  -  K Desktop Planetarium
                             -------------------
    begin                : 02/05/2016
    copyright            : (C) 2016 by Artem Fedoskin
    email                : afedoskin3@gmail.com
 ***************************************************************************/
/** *************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#pragma once

#include "skyitem.h"

class RootNode;
class SkyObject;
class SolarSystemSingleComponent;

/**
 * @class PlanetsItem
 * This class handles planets and their moons in SkyMapLite
 *
 * @author Artem Fedoskin
 * @version 1.0
 */
class PlanetsItem : public SkyItem
{
  public:
    /**
     * @short Constructor. Takes lists of pointers to planets(SolarSystemSingleComponent) and their
     * moons (PlanetMoonsComponent) to instantiate PlanetMoonsNodes for each of the planet.
     *
     * @param planets list of pointers to planets
     * @param moons list of pointers to moons
     * @param rootNode parent RootNode that instantiates this object
     */
    explicit PlanetsItem(QList<SolarSystemSingleComponent *> planets,
                /*QList<PlanetMoonsComponent *> moons,*/ RootNode *rootNode = nullptr);

    /**
     * @short returns SolarSystemSingleComponent that corresponds to the planet. Used to determine
     * whether the planet has to be drawn according to its selected() function
     * @param planet
     * @return corresponding SolarSystemSingleComponent
     */
    SolarSystemSingleComponent *getParentComponent(SkyObject *planet);

    /**
     * @short calls update() of all child PlanetMoonsNodes
     * @note see PlanetMoonsNodes::update()
     */
    void update() override;

    /**
     * @short shows this item and labels for all moons (currently only Jupiter moons. Add here labels
     * for moons that are needed to be shown)
     */
    virtual void show() override;

    /**
     * @short hides this item and labels for all moons (currently only Jupiter moons. Add here labels
     * for moons that are needed to be hidden)
     */
    virtual void hide() override;

  private:
    QList<SolarSystemSingleComponent *> m_planetComponents;
    //    QList<PlanetMoonsComponent *> m_moonsComponents;
};
