Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

PickList Class Reference

Maintains a list of Pickable objects, find and deal with items picked by a pointer device. More...

#include <PickList.h>

List of all members.

Public Methods

 PickList (VMDApp *)
 constructor: no information needed. More...

void add_pickable (Pickable *)
 adds a Pickable to the current list, if it is not already in the list. More...

void remove_pickable (Pickable *)
 remove the given pickable from the list. More...

Pickablepick_check (int, const float *, int &, int *cell, float window_size, char *callback_client=NULL)
 using the given display, this checks to see if any object is under the given pointer position. This does not set any internal picking flags, it just checks to see if something has been picked. Returns a pointer to the Pickable object selected if successful, or NULL if nothing is picked. If successful, returns 'tag' of item in final argument. arguments: display device, dim, position, returned tag window_size tells pick how close picked items must be The optional argument "callback_client" instructs pick to send a TCL callback for the client with that name. If no callback client is registered, this does a normal PickEvent instead. Pass in a non-NULL argument for cell to get the unit cell information about the picked point. More...

int pick_start (int btn, int dim, const float *)
 called when a pick is begun: button, dim, pos. returns 'tag' of closest object, or (-1) if nothing is picked. When a pick is started, the internal flags for this object are set, and no other item can be picked until pick_end is called. For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer. More...

int pick_move (const float *)
 called when a pick moves, passing current pointer position Returns TRUE if a pick is currently active, FALSE otherwise. For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer. More...

int pick_end ()
 called when a pick ends. Returns TRUE if a pick is currently active, FALSE otherwise. For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer. More...

void pick_callback_clear (char *callback_client)
 this notifies TCL that the pick is over - it is equivalent to performing a pick_check on a region not near any atoms. More...


Detailed Description

Maintains a list of Pickable objects, find and deal with items picked by a pointer device.

Definition at line 82 of file PickList.h.


Constructor & Destructor Documentation

PickList::PickList VMDApp  
 

constructor: no information needed.

Definition at line 62 of file PickList.C.

References NULL, VMDApp::pickModeList, and PickModeList::set_pick_mode.


Member Function Documentation

void PickList::add_pickable Pickable  
 

adds a Pickable to the current list, if it is not already in the list.

Definition at line 74 of file PickList.C.

References ResizeArray< Pickable * >::append, and ResizeArray< Pickable * >::find.

Referenced by DrawMolecule::add_rep, DrawMolecule::DrawMolecule, and VMDApp::VMDinit.

void PickList::pick_callback_clear char *    callback_client
 

this notifies TCL that the pick is over - it is equivalent to performing a pick_check on a region not near any atoms.

Definition at line 108 of file PickList.C.

Referenced by Tool::assign_rep.

Pickable * PickList::pick_check int   ,
const float *   ,
int &   ,
int *    cell,
float    window_size,
char *    callback_client = NULL
 

using the given display, this checks to see if any object is under the given pointer position. This does not set any internal picking flags, it just checks to see if something has been picked. Returns a pointer to the Pickable object selected if successful, or NULL if nothing is picked. If successful, returns 'tag' of item in final argument. arguments: display device, dim, position, returned tag window_size tells pick how close picked items must be The optional argument "callback_client" instructs pick to send a TCL callback for the client with that name. If no callback client is registered, this does a normal PickEvent instead. Pass in a non-NULL argument for cell to get the unit cell information about the picked point.

Definition at line 112 of file PickList.C.

References MoleculeList::check_pickable, VMDApp::commandQueue, VMDApp::display, BaseMolecule::id, DisplayDevice::left, VMDApp::moleculeList, NULL, DisplayDevice::pick, Pickable::pick_cmd_list, Pickable::pickable_on, print_atom_info, CommandQueue::runcommand, and DisplayDevice::update.

Referenced by get_nearby_atom, pick_start, Tool::target, and Tool::tool_location_update.

int PickList::pick_end  
 

called when a pick ends. Returns TRUE if a pick is currently active, FALSE otherwise. For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer.

Definition at line 250 of file PickList.C.

References PickModeList::current_pick_mode, VMDApp::display, DisplayDevice::left, NULL, Pickable::pick_end, VMDApp::pickModeList, and DisplayDevice::update.

int PickList::pick_move const float *   
 

called when a pick moves, passing current pointer position Returns TRUE if a pick is currently active, FALSE otherwise. For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer.

Definition at line 228 of file PickList.C.

References PickModeList::current_pick_mode, VMDApp::display, DisplayDevice::left, Pickable::pick_move, VMDApp::pickModeList, and DisplayDevice::update.

int PickList::pick_start int    btn,
int    dim,
const float *   
 

called when a pick is begun: button, dim, pos. returns 'tag' of closest object, or (-1) if nothing is picked. When a pick is started, the internal flags for this object are set, and no other item can be picked until pick_end is called. For 2D version: x & y are 0 ... 1, represent 'relative, scaled' coords. For 3D version: x,y,z are transformed position of pointer.

Definition at line 188 of file PickList.C.

References PickModeList::current_pick_mode, VMDApp::display, DisplayDevice::left, NULL, pick_check, Pickable::pick_start, VMDApp::pickModeList, and DisplayDevice::update.

void PickList::remove_pickable Pickable  
 

remove the given pickable from the list.

Definition at line 87 of file PickList.C.

References ResizeArray< Pickable * >::find, NULL, and ResizeArray< Pickable * >::remove.

Referenced by DrawMolecule::del_rep, and DrawMolecule::~DrawMolecule.


The documentation for this class was generated from the following files:
Generated on Fri Apr 19 02:47:06 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002