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

GeometryMol Class Reference

Base class for objects that make atomic measurements in a molecule. More...

#include <GeometryMol.h>

Inheritance diagram for GeometryMol:

Displayable Pickable GeometryAngle GeometryAtom GeometryBond GeometryDihedral GeometrySpring List of all members.

Public Methods

int items (void)
 number of items in this object. More...

int com_index (int i)
 direct access to the component ids. More...

int obj_index (int i)
 direct access to the object ids. More...

float value (void)
 most recent value. More...

int has_value (void)
 do we have a useful value to print? More...

virtual float calculate (void)
 recalculate the value of this geometry, and return it. More...

virtual void set_pick (void)
 if so, call this command to set the variable(s). More...

 GeometryMol (int, int *, int *, const int *cells, MoleculeList *mlist, CommandQueue *, Displayable *)
 constructor: # items, molecule list to use, command queue for events. More...

virtual ~GeometryMol (void)
const char * name (void)
 return the name of this geometry marker; by default, just blank. More...

const char * unique_name (void)
 return 'unique' name of the marker, which should be different than other names for different markers of this same type. More...

int ok (void)
 check whether the geometry value can still be calculated. More...

int calculate_all (ResizeArray< float > &)
 calculate a list of items, if this object can do so. Return success. More...

void update ()
 redraw the label due to molecule rotations or changes in coordinates. More...

void set_color (int c)
 set the color used to draw the label. More...

void set_text_size (float size)
 set the size used for text labels. More...

void set_text_thickness (float thick)
 set the line thickness used for text labels. More...

const float * text_offset () const
void set_text_offset (const float offset[2])
const char * text_format () const
 text format: the string to be printed for atom labels, with the following substitutions: R = resname r = resname in "camel case" (i.e. only first letter capitalized) d = resid a = atom name q = atom charge i = zero-based atom index. More...

void set_text_format (const char *aFormat)

Protected Methods

void geom_set_name (void)
 set the name of this item. More...

void sort_items (void)
 sort the elements in the list, so that the lowest atom index is first (but preserve the relative order, i.e. a-b-c or c-b-a). More...

Moleculecheck_mol (int m, int a)
 check whether the given molecule m & atom index a is OK if OK, return Molecule pointer; otherwise, return NULL. More...

Moleculetransformed_atom_coord (int ind, float *)
 for the given pick point, find the TRANSFORMED coords for the given atom. return Molecule pointer if successful, NULL otherwise. More...

Moleculenormal_atom_coord (int ind, float *)
 for the given Molecule, find the UNTRANSFORMED coords for the given atom. return Molecule pointer if successful, NULL otherwise. Also applies current periodic image for this coordinate. More...

void display_line (float *, float *, VMDDisplayList *)
 draws a line between the two given points. More...

void display_string (const char *, VMDDisplayList *)
 print given text at current valuePos position. More...

void atom_full_name (char *buf, Molecule *mol, int ind)
void atom_short_name (char *buf, Molecule *mol, int ind)
void atom_formatted_name (JString &str, Molecule *mol, int ind)
void set_pick_selection (int, int, int *)
 methods for setting Tcl variables. More...

void set_pick_selection ()
void set_pick_value (double)
virtual void create_cmd_list ()=0

Protected Attributes

MoleculeListmolList
CommandQueuecmdqueue
int numItems
 number of components used to calculate geometry value. More...

int * objIndex
 indices of objects containing the components. More...

int * comIndex
 indices of the components. More...

int * cellIndex
 unit cell IDs for the components. More...

float geomValue
 most recent value. More...

int hasValue
 do we have a useful value to print? More...

float valuePos [3]
 location where to print value in the scene. More...

char * gmName
 name of the molecule geometry monitor. More...

char * uniquegmName
 unique name of the geometry monitor. More...

ResizeArray< GeometryMonitor * > monitors
int my_color

Detailed Description

Base class for objects that make atomic measurements in a molecule.

Definition at line 41 of file GeometryMol.h.


Constructor & Destructor Documentation

GeometryMol::GeometryMol int   ,
int *   ,
int *   ,
const int *    cells,
MoleculeList   mlist,
CommandQueue  ,
Displayable  
 

constructor: # items, molecule list to use, command queue for events.

Definition at line 52 of file GeometryMol.C.

References ResizeArray< GeometryMonitor * >::append, cellIndex, cmdqueue, comIndex, geom_set_name, geomValue, gmName, hasValue, MoleculeList::mol_from_id, molList, monitors, my_color, n, NULL, numItems, objIndex, DrawMolecule::register_monitor, sort_items, and uniquegmName.

GeometryMol::~GeometryMol void    [virtual]
 

Definition at line 108 of file GeometryMol.C.

References cellIndex, comIndex, gmName, MoleculeList::mol_from_id, GeometryMonitor::molid, molList, monitors, ResizeArray< GeometryMonitor * >::num, objIndex, uniquegmName, and DrawMolecule::unregister_monitor.


Member Function Documentation

void GeometryMol::atom_formatted_name JString   str,
Molecule   mol,
int    ind
[protected]
 

Definition at line 140 of file GeometryMol.C.

References MolAtom::altlocindex, BaseMolecule::altlocNames, BaseMolecule::atom, MolAtom::atomicnumber, BaseMolecule::atomNames, BaseMolecule::atomTypes, BaseMolecule::beta, MolAtom::chainindex, BaseMolecule::chainNames, BaseMolecule::charge, DrawMolecule::current, Timestep::force, DrawMolecule::frame, get_pte_label, JString::gsub, BaseMolecule::id, BaseMolecule::mass, BaseMolecule::molname, NameList< int >::name, MolAtom::nameindex, NULL, BaseMolecule::occupancy, Timestep::physical_time, Timestep::pos, MolAtom::resid, MolAtom::resnameindex, BaseMolecule::resNames, MolAtom::segnameindex, BaseMolecule::segNames, JString::to_camel, and MolAtom::typeindex.

Referenced by GeometryAtom::create_cmd_list.

void GeometryMol::atom_full_name char *    buf,
Molecule   mol,
int    ind
[protected]
 

Definition at line 128 of file GeometryMol.C.

References BaseMolecule::id.

Referenced by geom_set_name.

void GeometryMol::atom_short_name char *    buf,
Molecule   mol,
int    ind
[protected]
 

Definition at line 132 of file GeometryMol.C.

References BaseMolecule::atom, BaseMolecule::atomNames, NameList< int >::name, MolAtom::nameindex, MolAtom::resid, MolAtom::resnameindex, and BaseMolecule::resNames.

Referenced by geom_set_name.

virtual float GeometryMol::calculate void    [inline, virtual]
 

recalculate the value of this geometry, and return it.

Reimplemented in GeometryAngle.

Definition at line 63 of file GeometryMol.h.

Referenced by GeometryList::add_geometry, calculate_all, geom2dict, GeometryMonitor::notify, and text_cmd_label.

int GeometryMol::calculate_all ResizeArray< float > &   
 

calculate a list of items, if this object can do so. Return success.

Definition at line 426 of file GeometryMol.C.

References ResizeArray::append, calculate, DrawMolecule::frame, has_value, items, MoleculeList::mol_from_id, molList, n, DrawMolecule::numframes, objIndex, and DrawMolecule::override_current_frame.

Referenced by getvalues, and text_cmd_label.

Molecule * GeometryMol::check_mol int    m,
int    a
[protected]
 

check whether the given molecule m & atom index a is OK if OK, return Molecule pointer; otherwise, return NULL.

Definition at line 322 of file GeometryMol.C.

References MoleculeList::mol_from_id, molList, BaseMolecule::nAtoms, and NULL.

Referenced by geom_set_name, normal_atom_coord, and ok.

int GeometryMol::com_index int    i [inline]
 

direct access to the component ids.

Definition at line 47 of file GeometryMol.h.

References comIndex.

Referenced by dict2geom, and geom2dict.

virtual void GeometryMol::create_cmd_list   [protected, pure virtual]
 

Implemented in GeometryAngle.

Referenced by update.

void GeometryMol::display_line float *   ,
float *   ,
VMDDisplayList  
[protected]
 

draws a line between the two given points.

Definition at line 382 of file GeometryMol.C.

References DispCmdLine::putdata.

Referenced by GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, and GeometryAngle::create_cmd_list.

void GeometryMol::display_string const char *   ,
VMDDisplayList  
[protected]
 

print given text at current valuePos position.

Definition at line 389 of file GeometryMol.C.

References DispCmdText::putdata, and valuePos.

Referenced by GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, and GeometryAngle::create_cmd_list.

void GeometryMol::geom_set_name void    [protected]
 

set the name of this item.

Definition at line 250 of file GeometryMol.C.

References atom_full_name, atom_short_name, cellIndex, check_mol, comIndex, gmName, items, objIndex, stringdup, and uniquegmName.

Referenced by GeometryMol.

int GeometryMol::has_value void    [inline]
 

do we have a useful value to print?

Definition at line 60 of file GeometryMol.h.

References hasValue.

Referenced by GeometryList::add_geometry, calculate_all, getvalues, and text_cmd_label.

int GeometryMol::items void    [inline]
 

number of items in this object.

Definition at line 44 of file GeometryMol.h.

References numItems.

Referenced by calculate_all, dict2geom, geom2dict, geom_set_name, sort_items, and text_cmd_label.

const char * GeometryMol::name void   
 

return the name of this geometry marker; by default, just blank.

Definition at line 398 of file GeometryMol.C.

References gmName.

Referenced by GeometryList::add_geometry, and unique_name.

Molecule * GeometryMol::normal_atom_coord int    ind,
float *   
[protected]
 

for the given Molecule, find the UNTRANSFORMED coords for the given atom. return Molecule pointer if successful, NULL otherwise. Also applies current periodic image for this coordinate.

Definition at line 356 of file GeometryMol.C.

References cellIndex, check_mol, comIndex, DrawMolecule::current, Timestep::get_transform_from_cell, mat, Matrix4::multpoint3d, NULL, objIndex, and Timestep::pos.

Referenced by GeometrySpring::calculate, GeometryDihedral::calculate, GeometryBond::calculate, GeometryAngle::calculate, and transformed_atom_coord.

int GeometryMol::obj_index int    i [inline]
 

direct access to the object ids.

Definition at line 52 of file GeometryMol.h.

References objIndex.

Referenced by dict2geom, and geom2dict.

int GeometryMol::ok void   
 

check whether the geometry value can still be calculated.

Definition at line 411 of file GeometryMol.C.

References check_mol, comIndex, numItems, and objIndex.

Referenced by GeometryList::add_geometry, geom2dict, GeometryList::prepare, and text_cmd_label.

void GeometryMol::set_color int    c [inline]
 

set the color used to draw the label.

Definition at line 145 of file GeometryMol.h.

References my_color, and update.

Referenced by GeometryList::add_geometry.

virtual void GeometryMol::set_pick void    [inline, virtual]
 

if so, call this command to set the variable(s).

Reimplemented in GeometryAngle.

Definition at line 66 of file GeometryMol.h.

Referenced by GeometryList::add_geometry.

void GeometryMol::set_pick_selection   [protected]
 

Definition at line 480 of file GeometryMol.C.

References cmdqueue, and CommandQueue::runcommand.

Referenced by GeometrySpring::set_pick, GeometryDihedral::set_pick, GeometryBond::set_pick, GeometryAtom::set_pick, and GeometryAngle::set_pick.

void GeometryMol::set_pick_selection int   ,
int   ,
int *   
[protected]
 

methods for setting Tcl variables.

Definition at line 476 of file GeometryMol.C.

References atoms, cmdqueue, num, and CommandQueue::runcommand.

void GeometryMol::set_pick_value double    [protected]
 

Definition at line 484 of file GeometryMol.C.

References cmdqueue, and CommandQueue::runcommand.

Referenced by GeometrySpring::set_pick, GeometryDihedral::set_pick, GeometryBond::set_pick, and GeometryAngle::set_pick.

void GeometryMol::set_text_format const char *    aFormat [inline]
 

Definition at line 171 of file GeometryMol.h.

References update.

Referenced by GeometryList::setTextFormat.

void GeometryMol::set_text_offset const float    offset[2] [inline]
 

Definition at line 155 of file GeometryMol.h.

References update.

Referenced by GeometryList::setTextOffset.

void GeometryMol::set_text_size float    size [inline]
 

set the size used for text labels.

Definition at line 148 of file GeometryMol.h.

References size, and update.

Referenced by GeometryList::add_geometry, and GeometryList::setTextSize.

void GeometryMol::set_text_thickness float    thick [inline]
 

set the line thickness used for text labels.

Definition at line 151 of file GeometryMol.h.

References update.

Referenced by GeometryList::add_geometry, and GeometryList::setTextThickness.

void GeometryMol::sort_items void    [protected]
 

sort the elements in the list, so that the lowest atom index is first (but preserve the relative order, i.e. a-b-c or c-b-a).

Definition at line 297 of file GeometryMol.C.

References cellIndex, comIndex, items, and objIndex.

Referenced by GeometryMol.

const char* GeometryMol::text_format   const [inline]
 

text format: the string to be printed for atom labels, with the following substitutions: R = resname r = resname in "camel case" (i.e. only first letter capitalized) d = resid a = atom name q = atom charge i = zero-based atom index.

Definition at line 170 of file GeometryMol.h.

Referenced by GeometryList::getTextFormat.

const float* GeometryMol::text_offset   const [inline]
 

Definition at line 153 of file GeometryMol.h.

Referenced by GeometryList::getTextOffset.

Molecule * GeometryMol::transformed_atom_coord int    ind,
float *   
[protected]
 

for the given pick point, find the TRANSFORMED coords for the given atom. return Molecule pointer if successful, NULL otherwise.

Definition at line 335 of file GeometryMol.C.

References DrawMolecule::atom_displayed, comIndex, normal_atom_coord, NULL, and Displayable::tm.

Referenced by GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, and GeometryAngle::create_cmd_list.

const char * GeometryMol::unique_name void   
 

return 'unique' name of the marker, which should be different than other names for different markers of this same type.

Definition at line 405 of file GeometryMol.C.

References name, and uniquegmName.

Referenced by GeometryList::add_geometry.

void GeometryMol::update   [inline]
 

redraw the label due to molecule rotations or changes in coordinates.

Definition at line 142 of file GeometryMol.h.

References create_cmd_list.

Referenced by GeometryMonitor::notify, set_color, set_text_format, set_text_offset, set_text_size, and set_text_thickness.

float GeometryMol::value void    [inline]
 

most recent value.

Definition at line 57 of file GeometryMol.h.

References geomValue.


Member Data Documentation

int* GeometryMol::cellIndex [protected]
 

unit cell IDs for the components.

Definition at line 75 of file GeometryMol.h.

Referenced by geom_set_name, GeometryMol, normal_atom_coord, sort_items, and ~GeometryMol.

CommandQueue* GeometryMol::cmdqueue [protected]
 

Definition at line 70 of file GeometryMol.h.

Referenced by GeometryMol, set_pick_selection, and set_pick_value.

int* GeometryMol::comIndex [protected]
 

indices of the components.

Definition at line 74 of file GeometryMol.h.

Referenced by com_index, GeometryAtom::create_cmd_list, geom_set_name, GeometryMol, normal_atom_coord, ok, GeometrySpring::prepare, GeometrySpring::set_pick, GeometryDihedral::set_pick, GeometryBond::set_pick, GeometryAtom::set_pick, GeometryAngle::set_pick, sort_items, transformed_atom_coord, and ~GeometryMol.

float GeometryMol::geomValue [protected]
 

most recent value.

Definition at line 76 of file GeometryMol.h.

Referenced by GeometrySpring::calculate, GeometryDihedral::calculate, GeometryBond::calculate, GeometryAngle::calculate, GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAngle::create_cmd_list, GeometryMol, GeometrySpring::set_pick, GeometryDihedral::set_pick, GeometryBond::set_pick, GeometryAngle::set_pick, and value.

char* GeometryMol::gmName [protected]
 

name of the molecule geometry monitor.

Definition at line 79 of file GeometryMol.h.

Referenced by geom_set_name, GeometryMol, name, and ~GeometryMol.

int GeometryMol::hasValue [protected]
 

do we have a useful value to print?

Definition at line 77 of file GeometryMol.h.

Referenced by GeometryAtom::GeometryAtom, GeometryMol, and has_value.

MoleculeList* GeometryMol::molList [protected]
 

Definition at line 69 of file GeometryMol.h.

Referenced by calculate_all, check_mol, GeometryMol, GeometrySpring::prepare, and ~GeometryMol.

ResizeArray<GeometryMonitor *> GeometryMol::monitors [protected]
 

Definition at line 178 of file GeometryMol.h.

Referenced by GeometryMol, and ~GeometryMol.

int GeometryMol::my_color [protected]
 

Definition at line 179 of file GeometryMol.h.

Referenced by GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, GeometryAngle::create_cmd_list, GeometryMol, and set_color.

int GeometryMol::numItems [protected]
 

number of components used to calculate geometry value.

Definition at line 72 of file GeometryMol.h.

Referenced by GeometryMol, items, and ok.

int* GeometryMol::objIndex [protected]
 

indices of objects containing the components.

Definition at line 73 of file GeometryMol.h.

Referenced by calculate_all, geom_set_name, GeometryMol, normal_atom_coord, obj_index, ok, GeometrySpring::prepare, GeometrySpring::set_pick, GeometryDihedral::set_pick, GeometryBond::set_pick, GeometryAtom::set_pick, GeometryAngle::set_pick, sort_items, and ~GeometryMol.

char* GeometryMol::uniquegmName [protected]
 

unique name of the geometry monitor.

Definition at line 80 of file GeometryMol.h.

Referenced by geom_set_name, GeometryMol, unique_name, and ~GeometryMol.

float GeometryMol::valuePos[3] [protected]
 

location where to print value in the scene.

Definition at line 78 of file GeometryMol.h.

Referenced by GeometrySpring::create_cmd_list, GeometryDihedral::create_cmd_list, GeometryBond::create_cmd_list, GeometryAtom::create_cmd_list, GeometryAngle::create_cmd_list, and display_string.


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