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

Molecule Class Reference

Main Molecule objects, which contains all the capabilities necessary to store, draw, and manipulate a molecule. This adds to the functions of DrawMolecule and BaseMolecule by adding file I/O interfaces etc. More...

#include <Molecule.h>

Inheritance diagram for Molecule:

DrawMolecule BaseMolecule Displayable Pickable List of all members.

Public Methods

 Molecule (const char *, VMDApp *, Displayable *)
 constructor ... nothing much to do, just save the source, and pass on the other data. Pass the VMDApp and parent Displayable on to DrawMolecule. More...

virtual ~Molecule (void)
 destructor ... just clear out unread files. More...

int rename (const char *newname)
 rename the molecule, as shown in the GUI and as accessed by text commands. More...

int num_files () const
 Return the number of file components that make up the loaded molecule. More...

const char * get_type (int i) const
 Return the file type of the indexed molecule file component. More...

const char * get_file (int i) const
 Return the file name of the indexed molecule file component. More...

const char * get_file_specs (int i) const
 Return the file loading specs of the indexed molecule file component. More...

const char * get_database (int i) const
 Return the source database of the indexed molecule file component. More...

const char * get_accession (int i) const
 Return the database accession code of the indexed molecule file component. More...

const char * get_remarks (int i) const
 Return the text comments for the indexed molecule file component. More...

void record_file (const char *filename, const char *filetype, const char *filespecs)
 Record the file component's name, type, and loading specs in the molecule. More...

void record_database (const char *dbname, const char *dbcode)
 Record the file component's source database and accession code in the molecule. More...

void record_remarks (const char *remarks)
 Record the file component's text comments in the molecule. More...

void add_coor_file (CoorData *)
 add a CoorFile object to the file I/O queue. Molecule will read/write frames until the CoorFileData object says its finished. Then Molecule will delete it. More...

void close_coor_file (CoorData *)
 Complete/close a CoorFile object. Molecule will signal any necessary callbacks etc. More...

int get_new_frames ()
 Check for new trajectory frames in I/O queue and IMD. More...

int next_frame ()
 Read the next frame in the file I/O queue. Return true if any frames were read; otherwise return false. More...

int cancel ()
 cancel loading/saving of all coordinate files return number of files canceled. More...

int file_in_progress ()
 return true if file I/O is in progress. More...

virtual void prepare ()
 prepare for drawing ... do any updates needed right before draw. This possibly reads a new timestep, if requested. More...

void addForce (int theatom, const float *f)
 add a force "f" to atom index "theatom" for this display loop only. More...

void addPersistentForce (int theatom, const float *f)
 add a persistent force to the given atom; this will stay until cleared (by making the force zero). This force will be added to any other forces coming from addForce. More...


Detailed Description

Main Molecule objects, which contains all the capabilities necessary to store, draw, and manipulate a molecule. This adds to the functions of DrawMolecule and BaseMolecule by adding file I/O interfaces etc.

Definition at line 37 of file Molecule.h.


Constructor & Destructor Documentation

Molecule::Molecule const char *   ,
VMDApp  ,
Displayable  
 

constructor ... nothing much to do, just save the source, and pass on the other data. Pass the VMDApp and parent Displayable on to DrawMolecule.

Definition at line 39 of file Molecule.C.

References breakup_filename, BaseMolecule::moleculename, NULL, and stringdup.

Molecule::~Molecule void    [virtual]
 

destructor ... just clear out unread files.

Definition at line 53 of file Molecule.C.

References DrawMolecule::app, BaseMolecule::id, VMDApp::imd_disconnect, BaseMolecule::moleculename, ResizeArray< char * >::num, ResizeArray< CoorData * >::num, and ResizeArray< CoorData * >::remove.


Member Function Documentation

void Molecule::add_coor_file CoorData  
 

add a CoorFile object to the file I/O queue. Molecule will read/write frames until the CoorFileData object says its finished. Then Molecule will delete it.

Definition at line 95 of file Molecule.C.

References ResizeArray< CoorData * >::append, and data.

Referenced by VMDApp::molecule_load, and VMDApp::molecule_savetrajectory.

void Molecule::addForce int    theatom,
const float *    f
 

add a force "f" to atom index "theatom" for this display loop only.

Definition at line 250 of file Molecule.C.

References ResizeArray< int >::append, and ResizeArray< float >::append3.

Referenced by GeometrySpring::prepare, and Tool::tug.

void Molecule::addPersistentForce int    theatom,
const float *    f
 

add a persistent force to the given atom; this will stay until cleared (by making the force zero). This force will be added to any other forces coming from addForce.

Definition at line 255 of file Molecule.C.

References ResizeArray< int >::append, ResizeArray< float >::append3, ResizeArray< int >::find, ResizeArray< float >::remove, ResizeArray< int >::remove, and Displayable::reset_disp_list.

int Molecule::cancel  
 

cancel loading/saving of all coordinate files return number of files canceled.

Definition at line 113 of file Molecule.C.

References ResizeArray< CoorData * >::num, and ResizeArray< CoorData * >::remove.

Referenced by VMDApp::molecule_cancel_io.

void Molecule::close_coor_file CoorData  
 

Complete/close a CoorFile object. Molecule will signal any necessary callbacks etc.

Definition at line 99 of file Molecule.C.

References DrawMolecule::app, CommandQueue::append, VMDApp::commandQueue, data, BaseMolecule::id, and CoorData::name.

Referenced by VMDApp::molecule_savetrajectory, and next_frame.

int Molecule::file_in_progress   [inline]
 

return true if file I/O is in progress.

Definition at line 139 of file Molecule.h.

References ResizeArray< CoorData * >::num.

Referenced by DrawMolItem::prepare.

const char* Molecule::get_accession int    i const [inline]
 

Return the database accession code of the indexed molecule file component.

Definition at line 88 of file Molecule.h.

References NULL, and ResizeArray::num.

Referenced by molinfo_get, and py_get_accessions.

const char* Molecule::get_database int    i const [inline]
 

Return the source database of the indexed molecule file component.

Definition at line 82 of file Molecule.h.

References NULL, and ResizeArray::num.

Referenced by molinfo_get, and py_get_databases.

const char* Molecule::get_file int    i const [inline]
 

Return the file name of the indexed molecule file component.

Definition at line 70 of file Molecule.h.

References NULL, and ResizeArray::num.

Referenced by molinfo_get, and py_get_filenames.

const char* Molecule::get_file_specs int    i const [inline]
 

Return the file loading specs of the indexed molecule file component.

Definition at line 76 of file Molecule.h.

References NULL, and ResizeArray::num.

Referenced by molinfo_get.

int Molecule::get_new_frames  
 

Check for new trajectory frames in I/O queue and IMD.

Definition at line 125 of file Molecule.C.

References DrawMolecule::app, ResizeArray::append, ResizeArray::append3, ResizeArray< float >::appendlist, ResizeArray< int >::appendlist, VMDApp::background_processing_set, ResizeArray< float >::clear, ResizeArray< int >::clear, DrawMolecule::current, Timestep::force, BaseMolecule::id, VMDApp::imd_connected, VMDApp::imd_sendforces, BaseMolecule::nAtoms, next_frame, ResizeArray::num, ResizeArray< float >::num, and ResizeArray< int >::num.

Referenced by prepare, and VMDApp::VMDupdate.

const char* Molecule::get_remarks int    i const [inline]
 

Return the text comments for the indexed molecule file component.

Definition at line 94 of file Molecule.h.

References NULL, and ResizeArray::num.

Referenced by molinfo_get, and py_get_remarks.

const char* Molecule::get_type int    i const [inline]
 

Return the file type of the indexed molecule file component.

Definition at line 64 of file Molecule.h.

References NULL, and ResizeArray::num.

Referenced by molinfo_get, and py_get_filetypes.

int Molecule::next_frame  
 

Read the next frame in the file I/O queue. Return true if any frames were read; otherwise return false.

Definition at line 221 of file Molecule.C.

References close_coor_file, CoorData::CoorDataState, CoorData::DONE, CoorData::NOTDONE, ResizeArray< CoorData * >::num, ResizeArray< CoorData * >::remove, and state.

Referenced by get_new_frames, and VMDApp::molecule_load.

int Molecule::num_files   const [inline]
 

Return the number of file components that make up the loaded molecule.

Definition at line 61 of file Molecule.h.

References ResizeArray::num.

Referenced by molinfo_get, py_get_accessions, py_get_databases, py_get_filenames, py_get_filetypes, and py_get_remarks.

void Molecule::prepare   [virtual]
 

prepare for drawing ... do any updates needed right before draw. This possibly reads a new timestep, if requested.

Reimplemented from DrawMolecule.

Definition at line 245 of file Molecule.C.

References get_new_frames, and DrawMolecule::prepare.

void Molecule::record_database const char *    dbname,
const char *    dbcode
[inline]
 

Record the file component's source database and accession code in the molecule.

Definition at line 108 of file Molecule.h.

References ResizeArray::append, and stringdup.

Referenced by VMDApp::molecule_load, and MolFilePlugin::read_metadata.

void Molecule::record_file const char *    filename,
const char *    filetype,
const char *    filespecs
[inline]
 

Record the file component's name, type, and loading specs in the molecule.

Definition at line 100 of file Molecule.h.

References ResizeArray::append, and stringdup.

Referenced by VMDApp::molecule_load.

void Molecule::record_remarks const char *    remarks [inline]
 

Record the file component's text comments in the molecule.

Definition at line 114 of file Molecule.h.

References ResizeArray::append, and stringdup.

Referenced by VMDApp::molecule_load, and MolFilePlugin::read_metadata.

int Molecule::rename const char *    newname
 

rename the molecule, as shown in the GUI and as accessed by text commands.

Definition at line 89 of file Molecule.C.

References BaseMolecule::moleculename, and stringdup.

Referenced by VMDApp::molecule_from_selection_list, VMDApp::molecule_new, and VMDApp::molecule_rename.


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