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

TclMolInfo.C File Reference

#include <stdlib.h>
#include "MoleculeList.h"
#include "tcl.h"
#include "Timestep.h"
#include "TclCommands.h"
#include "Molecule.h"
#include "MaterialList.h"
#include "VMDApp.h"
#include "Inform.h"
#include "QMData.h"

Go to the source code of this file.

Compounds

class  ctxt
 XXX old-style context structure; from when we used a SymbolTable instance to loop up functions for molinfo. More...


Defines

#define generic_molinfo_data(name, func)
#define generic_molinfo_simulation(name, term)
#define generic_molinfo_pbc(name, term)
#define generic_molinfo_wave_int(name, term)
#define generic_molinfo_qmts_int(name, term)
#define generic_molinfo_qmts_arr(type, name, term, n)
#define generic_molinfo_qmts_mat(type, name, term, n, m)
#define generic_molinfo_qm(type, name, term)
#define generic_molinfo_qm_string(name, term)
#define generic_molinfo_qm_arr(type, name, term, n)
#define generic_molinfo_qm_mat(type, name, term, n)
#define generic_molinfo_set_data(name, func1, func2)
#define generic_molinfo_simulation_set(name, type)
#define generic_molinfo_pbc_set(name, type)

Functions

void write_matrix (Tcl_Interp *interp, const float *mat)
int read_matrix (Tcl_Interp *interp, const char *s, float *mat)
int molinfo_get (ctxt context, int molid, int argc, const char *argv[], Tcl_Interp *interp, int frame_num)
int molinfo_set (ctxt context, int molid, int argc, const char *argv[], const char *data[], Tcl_Interp *interp, int frame_num)
int molecule_tcl (ClientData data, Tcl_Interp *interp, int argc, const char *argv[])


Define Documentation

#define generic_molinfo_data name,
func   
 

Value:

} else if (!strcmp(arg, name)) { \
char buf[20]; sprintf(buf, "%d", func); Tcl_AppendElement(interp, buf);

Definition at line 81 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_pbc name,
term   
 

Value:

} else if (!strcmp(arg, name)) { \
Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
if (!ts) Tcl_AppendElement(interp, "0"); \
else { char buf[20]; sprintf(buf, "%f", ts->term); Tcl_AppendElement(interp, buf); }

Definition at line 91 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_pbc_set name,
type   
 

Value:

} else if (!strcmp(argv[term], name)) { \
Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
if (ts) { ts->type = (float) atof(data[term]); mol->change_pbc(); }

Definition at line 843 of file TclMolInfo.C.

Referenced by molinfo_set.

#define generic_molinfo_qm type,
name,
term   
 

Value:

} else if (!strcmp(arg, name)) {  \
  if (!mol->qm_data) \
    Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), \
                             Tcl_NewIntObj(0)); \
  else {  \
    char buf[QMDATA_BUFSIZ]; sprintf(buf, type, mol->qm_data->term);  \
    Tcl_AppendElement(interp, buf);  \
  }

Definition at line 156 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_qm_arr type,
name,
term,
 
 

Value:

} else if (!strcmp(arg, name)) {  \
  Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);  \
  if (mol->qm_data && mol->qm_data->get_##term()) { \
    char buf[20]; \
    unsigned int i; \
    for (i=0; i<(unsigned int)n; i++) {  \
      sprintf(buf, type, mol->qm_data->get_##term()[i]); \
      Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(buf, -1)); \
    }  \
  } \
  Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), tcl_result);

Definition at line 175 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_qm_mat type,
name,
term,
 
 

Value:

} else if (!strcmp(arg, name)) {  \
  if (mol->qm_data) {  \
    if (mol->qm_data->get_##term()) {  \
      char buf[20];  \
      unsigned int i, j;  \
      Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);  \
      for (i=0; i<(unsigned int)n; i++) {  \
        Tcl_Obj *rowListObj = Tcl_NewListObj(0, NULL);  \
        for (j=0; j<(unsigned int)n; j++) {  \
          sprintf(buf, type, mol->qm_data->get_##term()[i*n+j]);  \
          Tcl_ListObjAppendElement(interp, rowListObj, Tcl_NewStringObj(buf, -1)); \
        }  \
        Tcl_ListObjAppendElement(interp, tcl_result, rowListObj);  \
      }  \
      Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), tcl_result); \
    }  \
  }

Definition at line 188 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_qm_string name,
term   
 

Value:

} else if (!strcmp(arg, name)) {  \
  if (mol->qm_data) {  \
    char buf[QMDATA_BUFSIZ]; sprintf(buf, QMDATA_BUFSTRFMT, mol->qm_data->term);  \
    Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), Tcl_NewStringObj(buf, -1)); \
  } else { \
    Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), Tcl_NewListObj(0, NULL)); \
  }

Definition at line 166 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_qmts_arr type,
name,
term,
 
 

Value:

} else if (!strcmp(arg, name)) { \
  Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);  \
  Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
  if (ts && ts->qm_timestep && ts->qm_timestep->get_##term()) { \
    char buf[20]; \
    unsigned int i; \
    for (i=0; i<(unsigned int)n; i++) { \
      sprintf(buf, type, ts->qm_timestep->get_##term()[i]); \
      Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(buf, -1)); \
    } \
  } \
  Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), tcl_result);

Definition at line 123 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_qmts_int name,
term   
 

Value:

} else if (!strcmp(arg, name)) { \
  Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
  if (!ts || !ts->qm_timestep) \
    Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), \
                             Tcl_NewIntObj(0)); \
  else { \
    char buf[20]; sprintf(buf, "%i", ts->qm_timestep->get_##term()); \
    Tcl_AppendElement(interp, buf); \
  }

Definition at line 112 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_qmts_mat type,
name,
term,
n,
 
 

Value:

} else if (!strcmp(arg, name)) { \
  Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);  \
  Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
  if (ts && ts->qm_timestep && ts->qm_timestep->term) {             \
    char buf[20];  \
    unsigned int i, j;  \
    for (i=0; i<(unsigned int)n; i++) {  \
      Tcl_Obj *rowListObj = Tcl_NewListObj(0, NULL);  \
      for (j=0; j<(unsigned int)m; j++) {  \
        sprintf(buf, type, ts->qm_timestep->term[i*n+j]);  \
        Tcl_ListObjAppendElement(interp, rowListObj, Tcl_NewStringObj(buf, -1)); \
      }  \
      Tcl_ListObjAppendElement(interp, tcl_result, rowListObj);  \
    }  \
  } \
  Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), tcl_result);

Definition at line 137 of file TclMolInfo.C.

#define generic_molinfo_set_data name,
func1,
func2   
 

Value:

} else if (!strcmp(argv[term], name)) { \
int onoff; \
if (Tcl_GetBoolean(interp, data[term], &onoff) != TCL_OK) return TCL_ERROR; \
if (onoff) { func1 ; } else { func2 ; }

Definition at line 832 of file TclMolInfo.C.

Referenced by molinfo_set.

#define generic_molinfo_simulation name,
term   
 

Value:

} else if (!strcmp(arg, name)) { \
Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
if (!ts) Tcl_AppendElement(interp, "0"); \
else { char buf[20]; sprintf(buf, "%f", ts->energy[term]); Tcl_AppendElement(interp, buf); }

Definition at line 85 of file TclMolInfo.C.

Referenced by molinfo_get.

#define generic_molinfo_simulation_set name,
type   
 

Value:

} else if (!strcmp(argv[term], name)) { \
Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
if (ts) ts->energy[type] = (float) atof(data[term]);

Definition at line 838 of file TclMolInfo.C.

Referenced by molinfo_set.

#define generic_molinfo_wave_int name,
term   
 

Value:

} else if (!strcmp(arg, name)) { \
  Tcl_Obj *tcl_result = Tcl_NewListObj(0, NULL);  \
  Timestep *ts = mol->get_frame(context.molinfo_frame_number); \
  if (ts && ts->qm_timestep) { \
    int i; \
    char buf[32]; \
    for (i=0; i<ts->qm_timestep->get_num_wavef(); i++) { \
      sprintf(buf, "%d", ts->qm_timestep->get_##term(i)); \
      Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(buf, -1)); \
    } \
  } \
  Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp), tcl_result);

Definition at line 98 of file TclMolInfo.C.

Referenced by molinfo_get.


Function Documentation

int molecule_tcl ClientData    data,
Tcl_Interp *    interp,
int    argc,
const char *    argv[]
 

Definition at line 1109 of file TclMolInfo.C.

References ctxt::app, data, AtomSel::get_frame_value, BaseMolecule::id, VMDApp::materialList, ctxt::matlist, ctxt::mlist, MoleculeList::molecule, VMDApp::moleculeList, molinfo_get, molinfo_set, NULL, num, MoleculeList::num, result, MoleculeList::top, and AtomSel::TS_NOW.

int molinfo_get ctxt    context,
int    molid,
int    argc,
const char *    argv[],
Tcl_Interp *    interp,
int    frame_num
[static]
 

Definition at line 209 of file TclMolInfo.C.

References DrawMolecule::active, BaseMolecule::angles, BaseMolecule::angleTypeNames, BaseMolecule::angleTypes, DrawMolItem::atomColor, DrawMolItem::atomRep, DrawMolItem::atomSel, Displayable::centt, AtomColor::cmdStr, AtomSel::cmdStr, AtomRep::cmdStr, prim_t::coeff, DrawMolecule::component, DrawMolecule::components, QMData::compute_overlap_integrals, BaseMolecule::cterms, Displayable::curr_material, BaseMolecule::dihedrals, BaseMolecule::dihedralTypeNames, BaseMolecule::dihedralTypes, Displayable::displayed, QMData::expand_basis_array, prim_t::expon, Displayable::fixed, DrawMolecule::frame, generic_molinfo_data, generic_molinfo_pbc, generic_molinfo_qm, generic_molinfo_qm_arr, generic_molinfo_qm_mat, generic_molinfo_qm_string, generic_molinfo_qmts_arr, generic_molinfo_qmts_int, generic_molinfo_simulation, generic_molinfo_wave_int, Molecule::get_accession, BaseMolecule::get_angletype, QMData::get_angular_momentum_str, QMData::get_basis, QMTimestep::get_charge_set, QMTimestep::get_charge_type_str, Molecule::get_database, BaseMolecule::get_dihedraltype, QMTimestep::get_excitation, Molecule::get_file, Molecule::get_file_specs, DrawMolecule::get_frame, QMTimestep::get_homo, BaseMolecule::get_impropertype, QMData::get_max_avail_orbitals, QMTimestep::get_num_charge_sets, QMTimestep::get_num_coeffs, QMData::get_num_imag, QMData::get_num_intcoords, QMTimestep::get_num_orbitals, QMTimestep::get_num_scfiter, QMData::get_num_shells, QMTimestep::get_num_wavef, QMTimestep::get_occupancies, QMTimestep::get_orbitalenergy, Molecule::get_remarks, QMData::get_shell_type_str, QMTimestep::get_spin, Molecule::get_type, QMTimestep::get_wave_energy, QMData::get_wave_offset, QMTimestep::get_wavecoeffs, QMTimestep::get_wavef_typestr, Displayable::globt, BaseMolecule::impropers, BaseMolecule::improperTypeNames, BaseMolecule::improperTypes, MoleculeList::is_top, Matrix4::mat, MaterialList::material_name, ctxt::matlist, ctxt::mlist, MoleculeList::mol_index_from_id, MoleculeList::molecule, ctxt::molinfo_frame_number, ctxt::molinfo_get_id, ctxt::molinfo_get_index, ctxt::molinfo_get_string, BaseMolecule::molname, NameList< int >::name, BaseMolecule::nAtoms, NULL, ResizeArray< int >::num, BaseMolecule::num_angles, shell_t::num_cart_func, BaseMolecule::num_cterms, BaseMolecule::num_dihedrals, Molecule::num_files, BaseMolecule::num_impropers, BaseMolecule::num_volume_data, QMData::num_wave_f, QMData::num_wavef_signa, DrawMolecule::numframes, shell_t::numprims, basis_atom_t::numshells, shell_t::prim, BaseMolecule::qm_data, Timestep::qm_timestep, Displayable::rotm, Displayable::scale, Matrix4::scale, Timestep::timesteps, Displayable::tm, Matrix4::translate, AtomSel::TS_LAST, AtomSel::TS_NOW, TSE_ANGLE, TSE_BOND, TSE_COUL, TSE_DIHE, TSE_EFIELD, TSE_HBOND, TSE_IMPR, TSE_KE, TSE_PE, TSE_PRESSURE, TSE_RESTRAINT, TSE_TEMP, TSE_TOTAL, TSE_UREY_BRADLEY, TSE_VDW, TSE_VOLUME, and write_matrix.

Referenced by molecule_tcl.

int molinfo_set ctxt    context,
int    molid,
int    argc,
const char *    argv[],
const char *    data[],
Tcl_Interp *    interp,
int    frame_num
[static]
 

Definition at line 849 of file TclMolInfo.C.

References BaseMolecule::add_angle, BaseMolecule::add_cterm, BaseMolecule::add_dihedral, BaseMolecule::add_improper, NameList< int >::add_name, BaseMolecule::ANGLES, BaseMolecule::angleTypeNames, ctxt::app, Displayable::change_center, DrawMolecule::change_ts, NameList< int >::clear, BaseMolecule::clear_angles, BaseMolecule::clear_cterms, BaseMolecule::clear_dihedrals, BaseMolecule::clear_impropers, BaseMolecule::CTERMS, data, BaseMolecule::dihedralTypeNames, generic_molinfo_pbc_set, generic_molinfo_set_data, generic_molinfo_simulation_set, DrawMolecule::get_frame, BaseMolecule::id, BaseMolecule::improperTypeNames, Matrix4::mat, mat, ctxt::mlist, MoleculeList::mol_index_from_id, MoleculeList::molecule, VMDApp::molecule_activate, VMDApp::molecule_display, VMDApp::molecule_fix, VMDApp::molecule_make_top, ctxt::molinfo_frame_number, ctxt::molinfo_get_id, ctxt::molinfo_get_index, ctxt::molinfo_get_string, NULL, DrawMolecule::override_current_frame, read_matrix, Displayable::set_cent_trans, BaseMolecule::set_dataset_flag, Displayable::set_glob_trans, Displayable::set_rot, Displayable::set_scale, Timestep::timesteps, AtomSel::TS_LAST, AtomSel::TS_NOW, TSE_ANGLE, TSE_BOND, TSE_COUL, TSE_DIHE, TSE_EFIELD, TSE_HBOND, TSE_IMPR, TSE_KE, TSE_PE, TSE_PRESSURE, TSE_RESTRAINT, TSE_TEMP, TSE_TOTAL, TSE_UREY_BRADLEY, TSE_VDW, TSE_VOLUME, and z.

Referenced by molecule_tcl.

int read_matrix Tcl_Interp *    interp,
const char *    s,
float *    mat
[static]
 

Definition at line 68 of file TclMolInfo.C.

References mat, and NULL.

Referenced by molinfo_set.

void write_matrix Tcl_Interp *    interp,
const float *    mat
[static]
 

Definition at line 58 of file TclMolInfo.C.

References mat.

Referenced by molinfo_get.


Generated on Fri Nov 8 02:46:12 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002