Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 26, 2008, 1:23:48 PM (16 years ago)
Author:
rgrieder
Message:

added documentation to OverlayGroup
ready for merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/OverlayGroup.cc

    r1616 r1623  
    2727 */
    2828
     29/**
     30@file
     31@brief Definition of the OverlayGroup class.
     32*/
     33
    2934#include "OrxonoxStableHeaders.h"
    3035#include "OverlayGroup.h"
     
    4550
    4651    OverlayGroup::OverlayGroup()
    47         : scale_(1.0, 1.0)
    4852    {
    4953        RegisterObject(OverlayGroup);
    5054    }
    5155
    52     OverlayGroup::~OverlayGroup()
    53     {
    54     }
    55 
     56    /**
     57    @brief
     58        Loads the group and all its children OrxonoxOverlays.
     59    @copydoc
     60        BaseObject::XMLPort()
     61    */
    5662    void OverlayGroup::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    5763    {
    5864        BaseObject::XMLPort(xmlElement, mode);
    5965
     66        if (mode == XMLPort::LoadObject)
     67        {
     68            // set default values
     69            this->scale_  = Vector2(1.0, 1.0);
     70            this->scroll_ = Vector2(0.0, 0.0);
     71        }
     72
    6073        XMLPortParam(OverlayGroup, "scale", setScale, getScale, xmlElement, mode);
    6174        XMLPortParam(OverlayGroup, "scroll", setScroll, getScroll, xmlElement, mode);
     75        // loads all the child elements
    6276        XMLPortObject(OverlayGroup, OrxonoxOverlay, "", addElement, getElement, xmlElement, mode, false, true);
    6377    }
    6478
     79    //! Scales every element in the map.
    6580    void OverlayGroup::setScale(const Vector2& scale)
    6681    {
     
    7085    }
    7186
     87    //! Scrolls every element in the map.
    7288    void OverlayGroup::setScroll(const Vector2& scroll)
    7389    {
     
    7793    }
    7894
     95    /**
     96    @brief
     97        Adds an element to the map (used when loading with XMLPort).
     98    @remarks
     99        The names of the OrxonoxOverlays have to be unique!
     100    */
    79101    void OverlayGroup::addElement(OrxonoxOverlay* element)
    80102    {
     
    87109    }
    88110
     111    //! Returns a different element as long as index < hudElements_.size().
    89112    OrxonoxOverlay* OverlayGroup::getElement(unsigned int index)
    90113    {
     
    101124
    102125
     126    //########### Console commands ############
     127
     128    /**
     129    @brief
     130        Hides/shows an overlay group by its name.
     131    @param name
     132        The name of the group defined BaseObject::setName() (usually done with the "name"
     133        attribute in the xml file).
     134    */
    103135    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
    104136    {
     
    110142    }
    111143
     144    /**
     145    @brief
     146        Scales an overlay group by its name.
     147    @param name
     148        The name of the group defined BaseObject::setName() (usually done with the "name"
     149        attribute in the xml file).
     150    */
    112151    /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
    113152    {
     
    119158    }
    120159
     160    /**
     161    @brief
     162        Scrolls an overlay group by its name.
     163    @param name
     164        The name of the group defined BaseObject::setName() (usually done with the "name"
     165        attribute in the xml file).
     166    */
    121167    /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
    122168    {
Note: See TracChangeset for help on using the changeset viewer.