#include <P_Tool.h>
Inheritance diagram for Tool:
List of all members.
Definition at line 38 of file P_Tool.h.
Definition at line 66 of file P_Tool.C.
References dtool, forcescale, NULL, springscale, and wasgrabbing.
[virtual]
Definition at line 123 of file P_Tool.C.
References SensorConfig::getdevice, and Buttons::start.
Referenced by UIVR::set_buttons.
Definition at line 114 of file P_Tool.C.
References SensorConfig::getdevice, and Feedback::start.
Referenced by UIVR::set_feedback.
Add a device. Also starts the device. Add a NULL device to remove the item. Return success, defined as either successful removal or starting of the device.
Definition at line 105 of file P_Tool.C.
References SensorConfig::getdevice, and VMDTracker::start.
Referenced by UIVR::set_tracker.
[protected]
Definition at line 520 of file P_Tool.C.
References Feedback::addplaneconstraint, VMDTracker::get_offset, VMDTracker::get_scale, n, and springscale.
Referenced by RotateTool::do_event.
[inline]
True iff there is a valid sensor for this tool.
Definition at line 95 of file P_Tool.h.
Referenced by ToolFltkMenu::reset_tool_list, and ToolFltkMenu::select_tool.
Use the given rep as the targeted atoms, overriding picked atoms. Return success.
Definition at line 239 of file P_Tool.C.
References UIObject::app, DrawMolItem::atomSel, clear_rep, DrawMolecule::component, AtomSel::firstsel, AtomSel::lastsel, BaseMolecule::mass, MoleculeList::mol_from_id, VMDApp::moleculeList, DrawMolItem::name, AtomSel::on, PickList::pick_callback_clear, VMDApp::pickList, and stringdup.
Referenced by UIVR::act_on_command.
[virtual]
check for an event, and queue it if found. Return TRUE if an event was generated.
Reimplemented from UIObject.
Definition at line 205 of file P_Tool.C.
References do_event, dtool, Displayable::glob_trans_off, Displayable::glob_trans_on, orientation, position, Displayable::rot_off, Displayable::rot_on, Displayable::set_glob_trans, and Displayable::set_rot.
[inline]
Clear the selection and go back to picking atoms by hand.
Definition at line 153 of file P_Tool.h.
Referenced by UIVR::act_on_command, assign_rep, and target.
[protected]
Dimension of the tracker device in use.
Definition at line 502 of file P_Tool.C.
References VMDTracker::dimension, and dimension.
Referenced by dimension, RotateTool::do_event, and JoystickTool::do_event.
[inline, protected, virtual]
Subclasses should override this method to perform tool-specific actions every display loop.
Reimplemented in GrabTool.
Definition at line 168 of file P_Tool.h.
Referenced by check_event.
Definition at line 417 of file P_Tool.C.
References UIObject::app, Displayable::fix, Displayable::globt, BaseMolecule::id, id, Matrix4::inverse, Matrix4::mat, MoleculeList::mol_from_id, MoleculeList::molecule, VMDApp::molecule_fix, VMDApp::moleculeList, Matrix4::multmatrix, Matrix4::multpoint3d, NULL, MoleculeList::num, orientation, position, VMDApp::scene_rotate_by, VMDApp::scene_translate_by, Displayable::unfix, vec_add, and vec_sub.
[protected]
Stop applying force.
Definition at line 563 of file P_Tool.C.
References Feedback::forceoff.
Referenced by SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PinchTool::do_event, JoystickTool::do_event, and GrabTool::do_event.
[inline]
[inline]
[inline]
Get the molid of the currently selected rep; -1 if none.
Definition at line 147 of file P_Tool.h.
Referenced by ToolFltkMenu::update_toolrep_choosers.
[inline]
Get the name of the currently selected rep; NULL if none.
Definition at line 150 of file P_Tool.h.
Referenced by ToolFltkMenu::update_toolrep_choosers.
[protected]
See what was picked last without acquiring a new target.
Definition at line 265 of file P_Tool.C.
References NULL.
Referenced by SpringTool::do_event.
[inline]
Get the names of the devices used by this tool.
Definition at line 163 of file P_Tool.C.
References NULL.
Referenced by text_cmd_tool.
[inline]
The force scaling scales the _exported force, i.e. the force which is sent to UIVR and/or an external simulation. It is a spring constant, in .
Definition at line 78 of file P_Tool.h.
References forcescale.
Referenced by ToolFltkMenu::select_tool.
Get/set the position offset used by this tool's tracker.
Definition at line 234 of file P_Tool.C.
References VMDTracker::get_offset, and NULL.
Referenced by ToolFltkMenu::select_tool, and text_cmd_tool.
Get/set the coordinate scaling used by this tool's Tracker.
Definition at line 226 of file P_Tool.C.
References VMDTracker::get_scale.
Referenced by ToolFltkMenu::select_tool, and text_cmd_tool.
[inline]
The spring scaling controls the stiffness of the force feedback device. Its units should be real N/m.
Definition at line 72 of file P_Tool.h.
References springscale.
Referenced by ToolFltkMenu::select_tool.
[protected]
Returns the scale factor of the currently picked molecule.
Definition at line 495 of file P_Tool.C.
References UIObject::app, MoleculeList::mol_from_id, VMDApp::moleculeList, and Displayable::scale.
Referenced by SpringTool::do_event, and TugTool::do_event.
[inline]
return unqiue id.
Definition at line 44 of file P_Tool.h.
Referenced by PrintTool::do_event, dograb, and ungrab.
[inline, protected]
Test for picking.
Definition at line 180 of file P_Tool.h.
Referenced by SpringTool::do_event, and TugTool::do_event.
[virtual]
True iff the tool is grabbing something.
Reimplemented in PinchTool.
Definition at line 171 of file P_Tool.C.
References Buttons::state.
Referenced by RotateTool::do_event, JoystickTool::do_event, and GrabTool::do_event.
[inline]
[inline, protected]
Cease picking.
Definition at line 177 of file P_Tool.h.
Referenced by clear_rep, SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PinchTool::do_event, JoystickTool::do_event, and target.
[virtual]
return the orientation of this tool.
Reimplemented in RotateTool.
Definition at line 181 of file P_Tool.C.
References NULL.
Referenced by check_event, PrintTool::do_event, PinchTool::do_event, GrabTool::do_event, dograb, RotateTool::orientation, and text_cmd_tool.
[virtual]
return the position of this tool.
Reimplemented in JoystickTool.
Definition at line 176 of file P_Tool.C.
References NULL.
Referenced by check_event, SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PrintTool::do_event, PinchTool::do_event, JoystickTool::do_event, GrabTool::do_event, dograb, RotateTool::position, JoystickTool::position, sendforce, target, text_cmd_tool, and tool_location_update.
Remove the device with the given name. For backwards compatibility only.
Definition at line 133 of file P_Tool.C.
References NULL.
Referenced by UIVR::act_on_command.
[protected]
Deliver specified force to the feedback device. XXX Maybe this should be taken care of automatically in the update loop.
Definition at line 560 of file P_Tool.C.
References position, and Feedback::sendforce.
Referenced by RotateTool::do_event, PinchTool::do_event, JoystickTool::do_event, and GrabTool::do_event.
[protected]
Definition at line 532 of file P_Tool.C.
References Feedback::addconstraint, VMDTracker::get_offset, VMDTracker::get_scale, springscale, and Feedback::zeroforce.
Referenced by JoystickTool::do_event.
[protected]
Definition at line 545 of file P_Tool.C.
References Feedback::addforcefield, force, VMDTracker::get_scale, springscale, and Feedback::zeroforce.
Referenced by GrabTool::do_event.
[inline]
Definition at line 231 of file P_Tool.C.
References VMDTracker::set_offset.
Referenced by UIVR::act_on_command.
[protected]
Set force field parameters.
Definition at line 507 of file P_Tool.C.
References Feedback::addplaneconstraint, VMDTracker::get_offset, VMDTracker::get_scale, n, springscale, and Feedback::zeroforce.
Referenced by RotateTool::do_event, and PinchTool::do_event.
Definition at line 223 of file P_Tool.C.
References VMDTracker::set_scale.
Referenced by UIVR::set_position_scale.
[inline]
Reimplemented in PinchTool.
Definition at line 73 of file P_Tool.h.
References springscale.
Referenced by UIVR::set_spring_scale, SpringTool::setspringscale, TugTool::setspringscale, and PinchTool::setspringscale.
steal devices from another tool.
Definition at line 149 of file P_Tool.C.
References buttonDev, buttons, feedback, feedbackDev, forcescale, lost_sensor, springscale, tracker, and trackerDev.
Referenced by UIVR::change_type.
[protected]
See if we're currently picking anything, and if so, update the pick variables. Return true if anything was picked.
Definition at line 282 of file P_Tool.C.
References UIObject::app, DrawMolItem::atomSel, MoleculeList::check_pickable, clear_rep, DrawMolecule::component, DrawMolecule::current, VMDApp::display, AtomSel::firstsel, Displayable::globt, BaseMolecule::id, AtomSel::lastsel, let_go, BaseMolecule::mass, MoleculeList::mol_from_id, VMDApp::molecule_numframes, VMDApp::moleculeList, VMDApp::molrep_get_by_name, Matrix4::multpoint3d, NULL, AtomSel::on, PickList::pick_check, VMDApp::pickList, Timestep::pos, position, TARGET_GRAB, TARGET_TUG, Displayable::tm, Matrix4::translate, vec_copy, and vec_scale.
Referenced by SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PinchTool::do_event, JoystickTool::do_event, and GrabTool::do_event.
[protected]
Trigger callbacks based on current position.
Definition at line 273 of file P_Tool.C.
References UIObject::app, UIObject::make_callbacks, NULL, PickList::pick_check, VMDApp::pickList, and position.
Referenced by SpringTool::do_event, and TugTool::do_event.
[protected]
Apply the given force to the current target.
Definition at line 387 of file P_Tool.C.
References Molecule::addForce, UIObject::app, DrawMolItem::atomSel, DrawMolecule::component, AtomSel::firstsel, force, AtomSel::lastsel, BaseMolecule::mass, MoleculeList::mol_from_id, VMDApp::moleculeList, VMDApp::molrep_get_by_name, Matrix4::multpoint3d, AtomSel::on, Displayable::rotm, Matrix4::transpose, and vec_scale.
Referenced by PinchTool::do_event.
[pure virtual]
return the name of this tool. Must be unique to all Tool subclasses!
Implemented in GrabTool.
Referenced by ToolFltkMenu::reset_tool_list, ToolFltkMenu::select_tool, and text_cmd_tool.
Definition at line 478 of file P_Tool.C.
References UIObject::app, BaseMolecule::id, id, MoleculeList::molecule, VMDApp::molecule_fix, VMDApp::moleculeList, MoleculeList::num, and Displayable::unfix.
[protected]
The visual representation of this tool. It's not private because for some reason the TugTool needs access to some of its members.
Definition at line 164 of file P_Tool.h.
Referenced by check_event, SpringTool::do_event, TugTool::do_event, Tool, and ~Tool.
[protected]
scales force sent to the atoms.
Definition at line 106 of file P_Tool.h.
Referenced by SpringTool::do_event, TugTool::do_event, PinchTool::do_event, getforcescale, setforcescale, steal_sensor, and Tool.
[protected]
scales force sent to the feedback device.
Definition at line 107 of file P_Tool.h.
Referenced by addplaneconstraint, getspringscale, setconstraint, setforcefield, setplaneconstraint, setspringscale, steal_sensor, and Tool.
[protected]
XXX Should be private variable; gets set to isgrabbing() by RotateTool.
Definition at line 212 of file P_Tool.h.
Referenced by RotateTool::do_event, GrabTool::do_event, and Tool.