Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

vrvis::ToggleAction Class Reference

Small Action that toggles a boolean value between its two states. More...

#include <ToggleAction.hpp>

Inheritance diagram for vrvis::ToggleAction:

vrvis::DigitalAction vrvis::Action List of all members.

Public Member Functions

 ToggleAction (bool &rToggleVar)
 Constructor that takes a reference to the value to be toggled.
 ~ToggleAction (void)
virtual void execute (const gadget::Digital::State cButtonState)
 Toggle the toggle value.

Detailed Description

Example of a very basic Action that changes a boolean value that it given to it to the opposite on button release. This is one of the most used Actions though, e.g. to switch lights on and off, etc..

Constructor & Destructor Documentation

ToggleAction::ToggleAction bool &  rToggleVar  ) 

Constructs a ToggleAction for a given boolean value.

[in] rToggleVar Reference to the boolean value to be toggled by this Action.

ToggleAction::~ToggleAction void   ) 


Member Function Documentation

void ToggleAction::execute const gadget::Digital::State  cButtonState  )  [virtual]

On release of the assigned button, the boolean value that this Action references, is toggled.

[in] cButtonState The state of the digital device connected to this Action.

Implements vrvis::DigitalAction.

The documentation for this class was generated from the following files:
Generated on Tue Sep 21 07:31:11 2004 for VRVis by doxygen 1.3.8