#include <ArticulatedHierarchyController.h>


Debugging methods. | |
| enum | MouseMode { None = 0, BtLeft, BtRight, BtMiddle, Wheel } |
| Current MouseMode buffered. More... | |
| MouseMode | mouseMode |
| double | signFactor |
| bool | propagationChain |
| ArtCenterVec | m_artCenterVec |
| List of ArticulationCenters controlled by the controller. | |
| void | dumpActiveArticulations (void) const |
| void | dumpArticulationsAndBindingKeys (void) const |
| void | resetControler (void) |
| Set the controller in its initial state. | |
Public Types | |
| typedef std::vector < ArticulatedHierarchyContainer::ArticulationCenter * > | ArtCenterVec |
| typedef ArtCenterVec::iterator | ArtCenterVecIt |
| typedef std::vector < ArticulatedHierarchyContainer::ArticulationCenter::Articulation * > | ArtVec |
| typedef ArtVec::iterator | ArtVecIt |
Public Member Functions | |
| ArticulatedHierarchyController () | |
| Default Constructor. | |
| virtual | ~ArticulatedHierarchyController () |
| Default Destructor. | |
| virtual void | init () |
| Init method called during the scene graph initialization. | |
| virtual void | applyController (void) |
| Apply the controller current modifications to its controled component. | |
Controller Interface | |
| void | onMouseEvent (core::objectmodel::MouseEvent *) |
| Mouse event callback. | |
| void | onKeyPressedEvent (core::objectmodel::KeypressedEvent *) |
| Key press event callback. | |
| void | onBeginAnimationStep (void) |
| begin animation callback. | |
Protected Member Functions | |
| void | buildPropagationArticulationsChain (void) |
| Build the articulations list related to each controlled articulation. | |
| void | buildArray (std::vector< int > &, ArticulatedHierarchyContainer::ArticulationCenter::Articulation *, ArticulatedHierarchyContainer::ArticulationCenter *) |
| Build the articulations indices list according to an Articulation and its ArticulationCenter. | |
| void | updateActiveArticulationsIndices (const char) |
| Set the active articulation from a Key Input. | |
Protected Attributes | |
| Data< sofa::helper::vector< int > > | articulationsIndices |
| Stores controlled articulations indices. | |
| Data< sofa::helper::vector < char > > | bindingKeys |
| Stores controlled articulations keyboard keys. | |
| Data< double > | angleDelta |
| Angle step added at each event reception. | |
| Data< bool > | propagateUserInteraction |
| Says wether or not to apportion the articulation modification to its children in the hierarchy. | |
| sofa::helper::vector< bool > | activeArticulations |
| Stores activated articulations information. | |
| std::map< int, sofa::helper::vector< int > > | articulationsPropagationChains |
Implements an user interaction handler that controls the values of the articulations of an articulated hierarchy container. Mouse Buttons and Wheel are controlling the value. Keyboard is used to select the controlled articulation.
Definition at line 67 of file ArticulatedHierarchyController.h.
| typedef std::vector< ArticulatedHierarchyContainer::ArticulationCenter * > sofa::component::controller::ArticulatedHierarchyController::ArtCenterVec |
Definition at line 70 of file ArticulatedHierarchyController.h.
| typedef ArtCenterVec::iterator sofa::component::controller::ArticulatedHierarchyController::ArtCenterVecIt |
Definition at line 71 of file ArticulatedHierarchyController.h.
| typedef std::vector< ArticulatedHierarchyContainer::ArticulationCenter::Articulation * > sofa::component::controller::ArticulatedHierarchyController::ArtVec |
Definition at line 72 of file ArticulatedHierarchyController.h.
| typedef ArtVec::iterator sofa::component::controller::ArticulatedHierarchyController::ArtVecIt |
Definition at line 73 of file ArticulatedHierarchyController.h.
| sofa::component::controller::ArticulatedHierarchyController::ArticulatedHierarchyController | ( | ) |
Default Constructor.
Definition at line 66 of file ArticulatedHierarchyController.cpp.
References m_artCenterVec.
| virtual sofa::component::controller::ArticulatedHierarchyController::~ArticulatedHierarchyController | ( | ) | [inline, virtual] |
| void sofa::component::controller::ArticulatedHierarchyController::applyController | ( | void | ) | [virtual] |
Apply the controller current modifications to its controled component.
Reimplemented in sofa::component::controller::ArticulatedHierarchyBVHController.
Definition at line 328 of file ArticulatedHierarchyController.cpp.
References activeArticulations, angleDelta, articulationsIndices, articulationsPropagationChains, buildPropagationArticulationsChain(), sofa::core::objectmodel::BaseObject::getContext(), sofa::simulation::Node::getTreeObjects(), sofa::core::objectmodel::Data< T >::getValue(), m_artCenterVec, mouseMode, None, propagateUserInteraction, propagationChain, signFactor, and Wheel.
Referenced by onBeginAnimationStep().
| void sofa::component::controller::ArticulatedHierarchyController::buildArray | ( | std::vector< int > & | artIndices, | |
| ArticulatedHierarchyContainer::ArticulationCenter::Articulation * | artRef, | |||
| ArticulatedHierarchyContainer::ArticulationCenter * | artCenterParent | |||
| ) | [protected] |
Build the articulations indices list according to an Articulation and its ArticulationCenter.
Definition at line 144 of file ArticulatedHierarchyController.cpp.
References m_artCenterVec.
Referenced by buildPropagationArticulationsChain().
| void sofa::component::controller::ArticulatedHierarchyController::buildPropagationArticulationsChain | ( | void | ) | [protected] |
Build the articulations list related to each controlled articulation.
Definition at line 93 of file ArticulatedHierarchyController.cpp.
References articulationsIndices, articulationsPropagationChains, buildArray(), sofa::core::objectmodel::Data< T >::getValue(), and m_artCenterVec.
Referenced by applyController().
| void sofa::component::controller::ArticulatedHierarchyController::dumpActiveArticulations | ( | void | ) | const [protected] |
Definition at line 179 of file ArticulatedHierarchyController.cpp.
References activeArticulations, articulationsIndices, and sofa::core::objectmodel::Data< T >::getValue().
Referenced by updateActiveArticulationsIndices().
| void sofa::component::controller::ArticulatedHierarchyController::dumpArticulationsAndBindingKeys | ( | void | ) | const [protected] |
Definition at line 198 of file ArticulatedHierarchyController.cpp.
References articulationsIndices, bindingKeys, and sofa::core::objectmodel::Data< T >::getValue().
Referenced by init().
| void sofa::component::controller::ArticulatedHierarchyController::init | ( | void | ) | [virtual] |
Init method called during the scene graph initialization.
Reimplemented from sofa::core::objectmodel::BaseObject.
Reimplemented in sofa::component::controller::ArticulatedHierarchyBVHController.
Definition at line 77 of file ArticulatedHierarchyController.cpp.
References activeArticulations, bindingKeys, dumpArticulationsAndBindingKeys(), sofa::core::objectmodel::BaseObject::getContext(), sofa::simulation::Node::getTreeObjects(), sofa::core::objectmodel::Data< T >::getValue(), m_artCenterVec, propagationChain, and resetControler().
| void sofa::component::controller::ArticulatedHierarchyController::onBeginAnimationStep | ( | void | ) | [virtual] |
begin animation callback.
Called at the beginning of each time step.
Reimplemented from sofa::component::controller::Controller.
Definition at line 306 of file ArticulatedHierarchyController.cpp.
References applyController().
| void sofa::component::controller::ArticulatedHierarchyController::onKeyPressedEvent | ( | core::objectmodel::KeypressedEvent * | kev | ) | [virtual] |
Key press event callback.
Reimplemented from sofa::component::controller::Controller.
Definition at line 261 of file ArticulatedHierarchyController.cpp.
References sofa::core::objectmodel::KeypressedEvent::getKey(), and updateActiveArticulationsIndices().
| void sofa::component::controller::ArticulatedHierarchyController::onMouseEvent | ( | core::objectmodel::MouseEvent * | mev | ) | [virtual] |
Mouse event callback.
Reimplemented from sofa::component::controller::Controller.
Definition at line 268 of file ArticulatedHierarchyController.cpp.
References BtLeft, BtRight, sofa::core::objectmodel::MouseEvent::getState(), sofa::core::objectmodel::MouseEvent::getWheelDelta(), sofa::core::objectmodel::MouseEvent::LeftPressed, sofa::core::objectmodel::MouseEvent::LeftReleased, mouseMode, None, sofa::core::objectmodel::MouseEvent::Reset, resetControler(), sofa::core::objectmodel::MouseEvent::RightPressed, sofa::core::objectmodel::MouseEvent::RightReleased, signFactor, Wheel, and sofa::core::objectmodel::MouseEvent::Wheel.
| void sofa::component::controller::ArticulatedHierarchyController::resetControler | ( | void | ) | [protected] |
Set the controller in its initial state.
Definition at line 313 of file ArticulatedHierarchyController.cpp.
References activeArticulations, mouseMode, and None.
Referenced by init(), and onMouseEvent().
| void sofa::component::controller::ArticulatedHierarchyController::updateActiveArticulationsIndices | ( | const char | keyChar | ) | [protected] |
Set the active articulation from a Key Input.
Definition at line 220 of file ArticulatedHierarchyController.cpp.
References activeArticulations, articulationsIndices, bindingKeys, dumpActiveArticulations(), and sofa::core::objectmodel::Data< T >::getValue().
Referenced by onKeyPressedEvent().
sofa::helper::vector< bool > sofa::component::controller::ArticulatedHierarchyController::activeArticulations [protected] |
Stores activated articulations information.
Definition at line 122 of file ArticulatedHierarchyController.h.
Referenced by applyController(), dumpActiveArticulations(), init(), resetControler(), and updateActiveArticulationsIndices().
Data< double > sofa::component::controller::ArticulatedHierarchyController::angleDelta [protected] |
Angle step added at each event reception.
Definition at line 119 of file ArticulatedHierarchyController.h.
Referenced by applyController().
Data<sofa::helper::vector< int > > sofa::component::controller::ArticulatedHierarchyController::articulationsIndices [protected] |
Stores controlled articulations indices.
Definition at line 117 of file ArticulatedHierarchyController.h.
Referenced by applyController(), buildPropagationArticulationsChain(), dumpActiveArticulations(), dumpArticulationsAndBindingKeys(), and updateActiveArticulationsIndices().
std::map<int, sofa::helper::vector< int > > sofa::component::controller::ArticulatedHierarchyController::articulationsPropagationChains [protected] |
Definition at line 123 of file ArticulatedHierarchyController.h.
Referenced by applyController(), and buildPropagationArticulationsChain().
Data<sofa::helper::vector< char > > sofa::component::controller::ArticulatedHierarchyController::bindingKeys [protected] |
Stores controlled articulations keyboard keys.
Definition at line 118 of file ArticulatedHierarchyController.h.
Referenced by dumpArticulationsAndBindingKeys(), init(), and updateActiveArticulationsIndices().
ArtCenterVec sofa::component::controller::ArticulatedHierarchyController::m_artCenterVec [protected] |
List of ArticulationCenters controlled by the controller.
Reimplemented in sofa::component::controller::ArticulatedHierarchyBVHController.
Definition at line 163 of file ArticulatedHierarchyController.h.
Referenced by applyController(), ArticulatedHierarchyController(), buildArray(), buildPropagationArticulationsChain(), and init().
Definition at line 158 of file ArticulatedHierarchyController.h.
Referenced by applyController(), onMouseEvent(), and resetControler().
Data< bool > sofa::component::controller::ArticulatedHierarchyController::propagateUserInteraction [protected] |
Says wether or not to apportion the articulation modification to its children in the hierarchy.
Definition at line 120 of file ArticulatedHierarchyController.h.
Referenced by applyController().
Definition at line 161 of file ArticulatedHierarchyController.h.
Referenced by applyController(), and init().
double sofa::component::controller::ArticulatedHierarchyController::signFactor [protected] |
Definition at line 160 of file ArticulatedHierarchyController.h.
Referenced by applyController(), and onMouseEvent().
1.5.7.1