#include <InteractiveButton.h>
Inheritance diagram for InteractiveButton:
Public Member Functions | |
InteractiveButton () | |
virtual std::string | getKind () const |
virtual void | computeValue (bool &value, int portId) |
virtual void | addToLists (std::vector< Sensorport * > &sensorportList, std::vector< Actuatorport * > &actuatorportList, std::vector< Actuator * > &actuatorList) |
virtual void | addToDescriptions (std::vector< ObjectDescription > &objectDescriptionTree, int depth) |
virtual SimObject * | clone () const |
virtual bool | isMovableOrClickable (std::string &nameOfObject, bool testClickable) const |
void | setSnapIn (bool snapIn) |
void | hasBeenClicked () |
void | hasBeenReleased () |
Protected Attributes | |
bool | value |
bool | snapIn |
Definition at line 21 of file InteractiveButton.h.
InteractiveButton::InteractiveButton | ( | ) |
void InteractiveButton::addToDescriptions | ( | std::vector< ObjectDescription > & | objectDescriptionTree, | |
int | depth | |||
) | [virtual] |
Adds descriptions of the object and its children to a list
objectDescriptionTree | The list of descriptions | |
The | depth of the object in the object tree |
Reimplemented from SimObject.
Definition at line 28 of file InteractiveButton.cpp.
References SimObject::addToDescriptions(), ObjectDescription::depth, SimObject::fullName, ObjectDescription::fullName, ObjectDescription::name, OBJECT_TYPE_SENSORPORT, and ObjectDescription::type.
void InteractiveButton::addToLists | ( | std::vector< Sensorport * > & | sensorportList, | |
std::vector< Actuatorport * > & | actuatorportList, | |||
std::vector< Actuator * > & | actuatorList | |||
) | [virtual] |
Adds the object to some internal lists
sensorportList | A list of all sensor ports in the scene | |
actuatorportList | A list of all actuator ports in the scene | |
actuatorList | A list of all actuators in the scene |
Reimplemented from SimObject.
Definition at line 19 of file InteractiveButton.cpp.
References boolSensor.
SimObject * InteractiveButton::clone | ( | ) | const [virtual] |
Clones the object and its child nodes
Reimplemented from SimObject.
Definition at line 65 of file InteractiveButton.cpp.
References SimObject::addChildNode(), SimObject::childNodes, SimObject::deactivatedChildNode, SimObject::deactivatedChildNodeSuccessor, SimObject::fullName, InteractiveButton(), SimObject::intersectionSphereRadius, SimObject::name, SimObject::parentNode, SimObject::position, SimObject::rotation, SimObject::setFullName(), SimObject::setName(), SimObject::setPosition(), and snapIn.
void InteractiveButton::computeValue | ( | bool & | value, | |
int | portId | |||
) | [virtual] |
Returns the current value of the button
value | The value | |
portId | The id of the sensorport |
Reimplemented from Sensor.
Definition at line 40 of file InteractiveButton.cpp.
virtual std::string InteractiveButton::getKind | ( | ) | const [inline, virtual] |
Returns a string describing the kind of object
Reimplemented from Sensor.
Definition at line 36 of file InteractiveButton.h.
void InteractiveButton::hasBeenClicked | ( | ) | [virtual] |
Informs the button about being clicked
Reimplemented from SimObject.
Definition at line 45 of file InteractiveButton.cpp.
void InteractiveButton::hasBeenReleased | ( | ) | [virtual] |
Informs the button about being released
Reimplemented from SimObject.
Definition at line 57 of file InteractiveButton.cpp.
bool InteractiveButton::isMovableOrClickable | ( | std::string & | nameOfObject, | |
bool | testClickable | |||
) | const [virtual] |
Returns true, since this object is clickable
nameOfObject | The name of this object will be copied to this variable | |
testClickable | Flag: Also test for interactive buttons, if true |
Reimplemented from SimObject.
Definition at line 87 of file InteractiveButton.cpp.
References SimObject::fullName, and SimObject::isMovableOrClickable().
void InteractiveButton::setSnapIn | ( | bool | snapIn | ) | [inline] |
Sets the value of the snapIn flag
snapIn | The new value of snapIn |
Definition at line 76 of file InteractiveButton.h.
Referenced by SAX2Handler::parseInteractiveButtonAttributes().
bool InteractiveButton::snapIn [protected] |
Flag: Button keeps activated after click, if true
Definition at line 27 of file InteractiveButton.h.
Referenced by clone(), hasBeenClicked(), hasBeenReleased(), and InteractiveButton().
bool InteractiveButton::value [protected] |
The current value of the button (true/false)
Definition at line 25 of file InteractiveButton.h.
Referenced by hasBeenClicked(), hasBeenReleased(), and InteractiveButton().