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

DrawMolecule Class Reference

Subclass of BaseMolecule and Displayable for drawing a molecule. More...

#include <DrawMolecule.h>

Inheritance diagram for DrawMolecule:

BaseMolecule Displayable Pickable Molecule List of all members.

Public Methods

 DrawMolecule (VMDApp *, Displayable *)
 constructor ... pass in a VMDApp * and a parent displayable. More...

virtual ~DrawMolecule ()
wkf_threadpool_tcuda_devpool (void)
 Query CUDA device pool pointer. More...

int atom_displayed (int)
 return whether the Nth atom is displayed. This is true if ANY representation is displaying the given atom. More...

int components (void)
 total number of components. More...

DrawMolItemcomponent (int)
 return Nth component ... change to proper return type. More...

DrawMolItemcomponent_from_pickable (const Pickable *)
 return the component that matches the given Pickable, or NULL if no match. More...

int get_component_by_name (const char *)
 retrieve the index of the component with the given name. Returns -1 on failure. More...

const char * get_component_name (int)
 Get the name of the given component. Names are initially "repN", where N starts at 0 and increases each time a rep is created. Return NULL if the index is invalid. More...

int del_rep (int)
 delete the Nth representation ... return success. More...

void add_rep (AtomColor *, AtomRep *, AtomSel *, const Material *)
 Add a new representation (component). This always succeeds, since all parameters must have already been verified as valid. The rep takes over ownership of the parameter objects (except Material). More...

int change_rep (int, AtomColor *, AtomRep *, const char *sel)
 change the Nth representation ... return success. if any object is NULL, that characteristic is not changed. More...

int show_rep (int repid, int onoff)
 turn the Nth representation on or off. Return success. More...

void force_recalc (int)
 force a recalc of all representations For MOL_REGEN, this also invalidates the value of cov and scale_factor,. More...

void change_pbc ()
 Tell reps that the periodic image parameters have been changed. More...

void change_ts ()
 Tell reps that the currently displayed timestep has changed. More...

int highlighted_rep () const
 Return the highlighted rep for this molecule. Returns -1 if there is no such rep. More...

int numframes () const
 number of frames in the files associatd with the molecule. More...

int frame () const
 index of current frame. More...

void override_current_frame (int frame)
 change current frame without firing callbacks. More...

Timestepcurrent ()
 get the current frame. More...

Timestepget_frame (int n)
 get the specifed frame. More...

Timestepget_last_frame ()
 get the last frame. More...

void delete_frame (int n)
 delete the nth frame. More...

void append_frame (Timestep *)
 append the given frame. More...

void duplicate_frame (const Timestep *)
 duplicate the given frame passing NULL adds a 'null' frame (i.e. all zeros). More...

float scale_factor ()
 scaling factor required to make the molecule fit within (-1 ... 1). More...

int cov (float &, float &, float &)
 center of volume of this molecule. Return success. Fails if there aren't any coordinates, graphics, or volumetric data sets to compute the cov from. More...

int recalc_bonds (void)
 recalculate bonds via distance bond search based on current timestep. More...

int need_secondary_structure (int)
 request ss calculation. Return success. More...

void invalidate_ss ()
 invalidate current secondary structure when structure is changed. More...

int recalc_ss ()
 recalculate the secondary structure using current coordinates Return success. More...

MoleculeGraphicsmoleculeGraphics () const
virtual void prepare ()
 specific preparations, called by draw_prepare, supplied by derived class. More...

void register_monitor (DrawMoleculeMonitor *)
 register monitors. More...

void unregister_monitor (DrawMoleculeMonitor *)
 unregister monitors. More...

void notify ()

Public Attributes

int active
 is this molecule active? Used by MoleculeList. More...

QuickSurf qsurf
 QuickSurf object shared by all reps in the same molecule. We may have to do further refactoring of the code that manages the QuickSurf GPU resources since having multiple instances can still put excessive pressure on available GPU memory. One solution would be to have a VMDApp method to access GPU memory buffers that are only needed for very short-term fast-running calculations but that must be completely pre-allocated to support fast trajectory playback, etc. More...


Protected Attributes

VMDAppapp

Detailed Description

Subclass of BaseMolecule and Displayable for drawing a molecule.

Definition at line 52 of file DrawMolecule.h.


Constructor & Destructor Documentation

DrawMolecule::DrawMolecule VMDApp  ,
Displayable  
 

constructor ... pass in a VMDApp * and a parent displayable.

Definition at line 48 of file DrawMolecule.C.

References active, PickList::add_pickable, BaseMolecule::need_find_bonds, and VMDApp::pickList.

DrawMolecule::~DrawMolecule   [virtual]
 

Definition at line 67 of file DrawMolecule.C.

References app, component, components, ResizeArray< Timestep * >::num, VMDApp::pickList, ResizeArray< Timestep * >::remove, and PickList::remove_pickable.


Member Function Documentation

void DrawMolecule::add_rep AtomColor  ,
AtomRep  ,
AtomSel  ,
const Material  
 

Add a new representation (component). This always succeeds, since all parameters must have already been verified as valid. The rep takes over ownership of the parameter objects (except Material).

Definition at line 138 of file DrawMolecule.C.

References PickList::add_pickable, app, ResizeArray< DrawMolItem * >::append, Displayable::change_material, and VMDApp::pickList.

Referenced by MoleculeList::add_rep.

void DrawMolecule::append_frame Timestep  
 

append the given frame.

Definition at line 278 of file DrawMolecule.C.

References app, ResizeArray< Timestep * >::append, change_ts, VMDApp::commandQueue, BaseMolecule::need_find_bonds, NULL, ResizeArray< Timestep * >::num, override_current_frame, CommandQueue::runcommand, VMDApp::scene_resetview_newmoldata, and vmd_bond_search.

Referenced by IMDMgr::check_event, cmd_rawtimestep, duplicate_frame, and CoorPluginData::next.

int DrawMolecule::atom_displayed int   
 

return whether the Nth atom is displayed. This is true if ANY representation is displaying the given atom.

Definition at line 113 of file DrawMolecule.C.

References components, Displayable::displayed, and BaseMolecule::nAtoms.

Referenced by GeometryMol::transformed_atom_coord.

void DrawMolecule::change_pbc  
 

Tell reps that the periodic image parameters have been changed.

Definition at line 197 of file DrawMolecule.C.

References DrawMolItem::change_pbc, component, components, and notify.

int DrawMolecule::change_rep int   ,
AtomColor  ,
AtomRep  ,
const char *    sel
 

change the Nth representation ... return success. if any object is NULL, that characteristic is not changed.

Definition at line 163 of file DrawMolecule.C.

References DrawMolItem::change_color, DrawMolItem::change_rep, DrawMolItem::change_sel, and component.

Referenced by MoleculeList::change_rep, MoleculeList::change_repcolor, MoleculeList::change_repmethod, and MoleculeList::change_repsel.

void DrawMolecule::change_ts  
 

Tell reps that the currently displayed timestep has changed.

Definition at line 209 of file DrawMolecule.C.

References app, DrawMolItem::change_ts, VMDApp::commandQueue, component, components, BaseMolecule::id, notify, DrawForce::prepare, MoleculeGraphics::prepare, and CommandQueue::runcommand.

Referenced by append_frame, delete_frame, Animation::goto_frame, molinfo_set, and set_frame.

DrawMolItem * DrawMolecule::component int   
 

return Nth component ... change to proper return type.

Definition at line 90 of file DrawMolecule.C.

References components, and NULL.

Referenced by GraphicsFltkMenu::act_on_command, Tool::assign_rep, change_pbc, change_rep, MoleculeList::change_repmat, change_ts, MoleculeList::check_pickable, del_rep, force_recalc, get_component_name, molinfo_get, VMDApp::molrep_get_clipplane, VMDApp::molrep_get_color, VMDApp::molrep_get_colorupdate, VMDApp::molrep_get_drawframes, VMDApp::molrep_get_material, VMDApp::molrep_get_pbc, VMDApp::molrep_get_pbc_images, VMDApp::molrep_get_scaleminmax, VMDApp::molrep_get_selection, VMDApp::molrep_get_selupdate, VMDApp::molrep_get_smoothing, VMDApp::molrep_get_style, VMDApp::molrep_is_shown, VMDApp::molrep_numselected, VMDApp::molrep_reset_scaleminmax, VMDApp::molrep_set_clipcenter, VMDApp::molrep_set_clipcolor, VMDApp::molrep_set_clipnormal, VMDApp::molrep_set_clipstatus, VMDApp::molrep_set_colorupdate, VMDApp::molrep_set_drawframes, VMDApp::molrep_set_pbc, VMDApp::molrep_set_pbc_images, VMDApp::molrep_set_scaleminmax, VMDApp::molrep_set_selupdate, VMDApp::molrep_set_smoothing, recalc_ss, DrawMolItem::representation_index, PickModeMoveRep::rotate, show_rep, Tool::target, PickModeMoveRep::translate, Tool::tug, GraphicsFltkMenu::update_pbc, GraphicsFltkMenu::update_rep, GraphicsFltkMenu::update_repbrowser, and ~DrawMolecule.

DrawMolItem * DrawMolecule::component_from_pickable const Pickable  
 

return the component that matches the given Pickable, or NULL if no match.

Definition at line 99 of file DrawMolecule.C.

References components, and NULL.

int DrawMolecule::components void    [inline]
 

total number of components.

Definition at line 131 of file DrawMolecule.h.

References ResizeArray::num.

Referenced by atom_displayed, change_pbc, change_ts, MoleculeList::check_pickable, component, component_from_pickable, force_recalc, VMDApp::molecule_load, molinfo_get, VMDApp::num_molreps, recalc_ss, DrawMolItem::representation_index, PickModeMoveRep::rotate, PickModeMoveRep::translate, GraphicsFltkMenu::update_repbrowser, GraphicsFltkMenu::update_repindex, and ~DrawMolecule.

int DrawMolecule::cov float &   ,
float &   ,
float &   
 

center of volume of this molecule. Return success. Fails if there aren't any coordinates, graphics, or volumetric data sets to compute the cov from.

Definition at line 391 of file DrawMolecule.C.

References MoleculeGraphics::cov, data, ResizeArray< VolumetricData * >::num, MoleculeGraphics::num_elements, VolumetricData::origin, BaseMolecule::volumeList, VolumetricData::xaxis, VolumetricData::yaxis, and VolumetricData::zaxis.

Referenced by MoleculeList::center_from_top_molecule_reps, and AtomColor::find.

wkf_threadpool_t * DrawMolecule::cuda_devpool void   
 

Query CUDA device pool pointer.

Definition at line 107 of file DrawMolecule.C.

References app, VMDApp::cuda, CUDAAccel::get_cuda_devpool, and NULL.

Referenced by Orbital::calculate_mo.

Timestep* DrawMolecule::current   [inline]
 

get the current frame.

Definition at line 193 of file DrawMolecule.h.

References NULL, and ResizeArray::num.

Referenced by GeometryMol::atom_formatted_name, AtomColor::find, Molecule::get_new_frames, VMDApp::molecule_dupframe, need_secondary_structure, normal_atom_coord, GeometryMol::normal_atom_coord, parse_timestep, PickModeCenter::pick_molecule_end, PickModeMove::pick_molecule_move, PickModeForceFragment::pick_molecule_move, PickModeForceResidue::pick_molecule_move, PickModeForceAtom::pick_molecule_move, print_atom_info, recalc_bonds, PickModeMoveRep::rotate, PickModeMoveMolecule::rotate, PickModeMoveFragment::rotate, PickModeMoveResidue::rotate, selframe, Tool::target, AtomSel::timestep, PickModeMoveRep::translate, PickModeMoveMolecule::translate, PickModeMoveFragment::translate, PickModeMoveResidue::translate, PickModeMoveAtom::translate, vmd_volmap_ils, and write_stride_record.

int DrawMolecule::del_rep int   
 

delete the Nth representation ... return success.

Definition at line 125 of file DrawMolecule.C.

References app, component, NULL, VMDApp::pickList, ResizeArray< DrawMolItem * >::remove, and PickList::remove_pickable.

Referenced by MoleculeList::del_rep.

void DrawMolecule::delete_frame int    n
 

delete the nth frame.

Definition at line 332 of file DrawMolecule.C.

References app, change_ts, VMDApp::commandQueue, ResizeArray< Timestep * >::num, ResizeArray< Timestep * >::remove, and CommandQueue::runcommand.

Referenced by VMDApp::molecule_deleteframes.

void DrawMolecule::duplicate_frame const Timestep  
 

duplicate the given frame passing NULL adds a 'null' frame (i.e. all zeros).

Definition at line 319 of file DrawMolecule.C.

References append_frame, BaseMolecule::nAtoms, NULL, and Timestep::zero_values.

Referenced by VMDApp::molecule_dupframe, and vmd_volmap_ils.

void DrawMolecule::force_recalc int   
 

force a recalc of all representations For MOL_REGEN, this also invalidates the value of cov and scale_factor,.

Definition at line 179 of file DrawMolecule.C.

References app, VMDApp::commandQueue, component, components, DrawMolItem::force_recalc, DrawMolItem::MOL_REGEN, Displayable::need_matrix_recalc, CommandQueue::runcommand, and DrawMolItem::SEL_REGEN.

Referenced by access_tcl_atomsel, atomsel_set, atomselect_move, atomselect_moveby, IMDMgr::check_event, cmd_rawtimestep, VMDApp::molecule_load, VMDApp::molecule_reanalyze, PickModeAddBond::pick_molecule_end, PickModeMove::pick_molecule_move, py_align, py_move, py_moveby, MolFilePlugin::read_optional_structure, set, and setbonds.

int DrawMolecule::frame   const [inline]
 

index of current frame.

Definition at line 187 of file DrawMolecule.h.

Referenced by GeometryMol::atom_formatted_name, GeometryMol::calculate_all, cmd_rawtimestep, AtomColor::find, Animation::frame, measure_energy, measure_geom, measure_pbc2onc, measure_pbc_neighbors, VMDApp::molecule_frame, molinfo_get, and py_write.

int DrawMolecule::get_component_by_name const char *   
 

retrieve the index of the component with the given name. Returns -1 on failure.

Definition at line 233 of file DrawMolecule.C.

References ResizeArray< DrawMolItem * >::num.

Referenced by VMDApp::molrep_get_by_name.

const char * DrawMolecule::get_component_name int   
 

Get the name of the given component. Names are initially "repN", where N starts at 0 and increases each time a rep is created. Return NULL if the index is invalid.

Definition at line 245 of file DrawMolecule.C.

References component, and DrawMolItem::name.

Referenced by VMDApp::molrep_get_name.

Timestep* DrawMolecule::get_frame int    n [inline]
 

get the specifed frame.

Definition at line 200 of file DrawMolecule.h.

References NULL, and ResizeArray::num.

Referenced by cmd_gettimestep, cmd_rawtimestep, compute_pbcminmax, find_cluster_thr, get_last_frame, measure_avpos, measure_gofr, measure_pbc2onc, measure_pbc_neighbors, measure_rdf, measure_rmsf, minmax, VMDApp::molecule_dupframe, VMDApp::molecule_orblocalize, molinfo_get, molinfo_set, MolFilePlugin::next, CoorPluginData::next, parse_timestep, py_rmsd, GraphicsFltkRepOrbital::regen_orbitallist, selframe, AtomSel::timestep, and vmd_volmap_ils.

Timestep* DrawMolecule::get_last_frame   [inline]
 

get the last frame.

Definition at line 208 of file DrawMolecule.h.

References get_frame, and ResizeArray::num.

Referenced by IMDMgr::check_event, parse_timestep, selframe, and AtomSel::timestep.

int DrawMolecule::highlighted_rep   const
 

Return the highlighted rep for this molecule. Returns -1 if there is no such rep.

Definition at line 225 of file DrawMolecule.C.

References app, VMDApp::highlighted_molid, VMDApp::highlighted_rep, and BaseMolecule::id.

Referenced by PickModeMoveRep::rotate, and PickModeMoveRep::translate.

void DrawMolecule::invalidate_ss  
 

invalidate current secondary structure when structure is changed.

Definition at line 451 of file DrawMolecule.C.

Referenced by VMDApp::molecule_reanalyze, and MolFilePlugin::read_optional_structure.

MoleculeGraphics* DrawMolecule::moleculeGraphics   const [inline]
 

Definition at line 245 of file DrawMolecule.h.

Referenced by MoleculeList::check_pickable, mol_from_id, MolFilePlugin::read_rawgraphics, and tcl_graphics.

int DrawMolecule::need_secondary_structure int   
 

request ss calculation. Return success.

Definition at line 433 of file DrawMolecule.C.

References app, current, VMDApp::show_stride_message, and ss_from_stride.

Referenced by AtomColor::find, and recalc_ss.

void DrawMolecule::notify  
 

Definition at line 269 of file DrawMolecule.C.

References BaseMolecule::id, and ResizeArray< DrawMoleculeMonitor * >::num.

Referenced by change_pbc, DrawMolItem::change_sel, change_ts, prepare, DrawMolItem::set_pbc, and DrawMolItem::set_pbc_images.

int DrawMolecule::numframes   const [inline]
 

number of frames in the files associatd with the molecule.

Definition at line 184 of file DrawMolecule.h.

References ResizeArray::num.

Referenced by GeometryMol::calculate_all, IMDMgr::check_event, cmd_gettimestep, cmd_rawtimestep, CoorPluginData::CoorPluginData, AtomColor::find, Animation::goto_frame, measure_avpos, measure_cluster, measure_energy, measure_geom, measure_gofr, measure_pbc2onc, measure_pbc_neighbors, measure_rdf, measure_rmsf, VMDApp::molecule_deleteframes, VMDApp::molecule_dupframe, VMDApp::molecule_numframes, VMDApp::molecule_orblocalize, VMDApp::molecule_savetrajectory, molinfo_get, MolFilePlugin::next, CoorPluginData::next, Animation::num, py_write, setframe, and MolBrowser::update.

void DrawMolecule::override_current_frame int    frame
 

change current frame without firing callbacks.

Definition at line 258 of file DrawMolecule.C.

References ResizeArray< Timestep * >::num, and num.

Referenced by append_frame, GeometryMol::calculate_all, Animation::goto_frame, measure_energy, measure_geom, molinfo_set, and set_frame.

void DrawMolecule::prepare   [virtual]
 

specific preparations, called by draw_prepare, supplied by derived class.

Reimplemented from Displayable.

Reimplemented in Molecule.

Definition at line 252 of file DrawMolecule.C.

References Displayable::needUpdate, and notify.

Referenced by Molecule::prepare.

int DrawMolecule::recalc_bonds void   
 

recalculate bonds via distance bond search based on current timestep.

Definition at line 419 of file DrawMolecule.C.

References BaseMolecule::clear_bonds, BaseMolecule::count_bonds, current, and vmd_bond_search.

Referenced by VMDApp::molecule_bondsrecalc.

int DrawMolecule::recalc_ss  
 

recalculate the secondary structure using current coordinates Return success.

Definition at line 455 of file DrawMolecule.C.

References DrawMolItem::change_ss, component, components, and need_secondary_structure.

Referenced by VMDApp::molecule_ssrecalc.

void DrawMolecule::register_monitor DrawMoleculeMonitor  
 

register monitors.

Definition at line 464 of file DrawMolecule.C.

References ResizeArray< DrawMoleculeMonitor * >::append.

Referenced by GeometryMol::GeometryMol.

float DrawMolecule::scale_factor  
 

scaling factor required to make the molecule fit within (-1 ... 1).

Definition at line 367 of file DrawMolecule.C.

References data, dnorm, ResizeArray< VolumetricData * >::num, MoleculeGraphics::num_elements, scale_factor, MoleculeGraphics::scale_factor, BaseMolecule::volumeList, VolumetricData::xaxis, VolumetricData::yaxis, and VolumetricData::zaxis.

Referenced by MoleculeList::center_from_top_molecule_reps, and scale_factor.

int DrawMolecule::show_rep int    repid,
int    onoff
 

turn the Nth representation on or off. Return success.

Definition at line 150 of file DrawMolecule.C.

References component, Displayable::off, and Displayable::on.

Referenced by VMDApp::molrep_show.

void DrawMolecule::unregister_monitor DrawMoleculeMonitor  
 

unregister monitors.

Definition at line 467 of file DrawMolecule.C.

References ResizeArray< DrawMoleculeMonitor * >::find, and ResizeArray< DrawMoleculeMonitor * >::remove.

Referenced by GeometryMol::~GeometryMol.


Member Data Documentation

int DrawMolecule::active
 

is this molecule active? Used by MoleculeList.

Definition at line 54 of file DrawMolecule.h.

Referenced by MoleculeList::activate, MoleculeList::active, DrawMolecule, Animation::goto_frame, MoleculeList::inactivate, is_active, molinfo_get, and PickModeCenter::pick_molecule_end.

VMDApp* DrawMolecule::app [protected]
 

Definition at line 68 of file DrawMolecule.h.

Referenced by add_rep, append_frame, change_ts, Molecule::close_coor_file, cuda_devpool, del_rep, delete_frame, force_recalc, Molecule::get_new_frames, highlighted_rep, need_secondary_structure, ~DrawMolecule, and Molecule::~Molecule.

QuickSurf DrawMolecule::qsurf
 

QuickSurf object shared by all reps in the same molecule. We may have to do further refactoring of the code that manages the QuickSurf GPU resources since having multiple instances can still put excessive pressure on available GPU memory. One solution would be to have a VMDApp method to access GPU memory buffers that are only needed for very short-term fast-running calculations but that must be completely pre-allocated to support fast trajectory playback, etc.

Definition at line 56 of file DrawMolecule.h.


The documentation for this class was generated from the following files:
Generated on Sat May 26 01:49:12 2012 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002