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

utilities.h File Reference

#include <stdlib.h>

Go to the source code of this file.

Defines

#define FALSE   0
#define TRUE   1
#define NULL   0
#define ABS(A)   ((A)>0?(A):-(A))
#define VMD_PI   3.14159265358979323846
#define VMD_TWOPI   (2.0 * VMD_PI)
#define VMD_1_PI   0.31830988618379067154
#define VMD_ANGS_TO_BOHR   1.88972612478289694072
#define DEGTORAD(a)   (a*VMD_PI/180.0)
#define RADTODEG(a)   (a*180.0/VMD_PI)
#define VMD_RAND_MAX   2147483647L

Functions

char * combine_arguments (int, const char **, int)
 given an argc, argv pair, take all the arguments from the Nth one on and combine them into a single string with spaces separating words. This allocates space for the string, which must be freed by the user. More...

char * stringdup (const char *)
 make a copy of a string using c++ new routine for memory alloc. More...

char * stringtoupper (char *)
 convert the given string to upper case. More...

void stripslashes (char *str)
 strip trailing '/' characters from a string. More...

int strupcmp (const char *, const char *)
 do case-insensitive string comparisons. More...

int strupncmp (const char *, const char *, int)
 do case-insensitive string comparisons. More...

void breakup_filename (const char *, char **, char **)
 break a file name up into path + name, returning both in the specified character pointers. This creates storage for the new strings by allocating space for them. More...

char * str_tokenize (const char *, int *, char **)
 tokenize a given string; return char ptr if ok, NULL if error. More...

double time_of_day (void)
 get the time of day from the system clock, and return it (in seconds) (This is supposedly accurate to within about 1 millisecond. More...

int vmd_check_stdin (void)
 check for input on stdin. More...

char * vmd_username (void)
 return the username of the currently logged-on user. More...

int vmd_getuid (void)
 return the uid of the currently logged-on user. More...

int clamp_int (int val, int min, int max)
 clamp an integer value to the range min->max. More...

float * cross_prod (float *x1, const float *x2, const float *x3)
 compute the cross product, assumes that x1 memory is _different_ than both x2 and x3, and returns the pointer to x1. More...

float dot_prod (const float *v1, const float *v2)
 compute the inner dot product. More...

double dot_prod (const double *v1, const double *v2)
void vec_copy (float *v1, const float *v2)
 copy the first 3 elements from v2 to v1. More...

float * vec_normalize (float *)
 normalizes the 3-vector to length one and returns the pointer note that this changes the vector. More...

void vec_sub (float *a, const float *b, const float *c)
 subtract 3rd vector from 2nd and put into 1st in other words, a = b - c. More...

void vec_add (float *a, const float *b, const float *c)
 add 2nd and 3rd elements, put into 1st. More...

void vec_incr (float *a, const float *b)
 increment 1st vector by 2nd vector. More...

void vec_scale (float *a, float b, const float *c)
 a = b*c. More...

void vec_scale (float *a, float b, const double *c)
 a = b*c. More...

void vec_negate (float *a, const float *b)
 a = -b. More...

void vec_scaled_add (float *a, float b, const float *c)
 a += c*d. More...

void vec_triad (float *a, const float *b, float c, const float *d)
 a = b + c*d (name taken from STREAM benchmark routine). More...

void vec_lerp (float *a, const float *b, const float *c, float frac)
 perform linear interpolation between two vectors a = b + frac*(c-b). More...

void vec_zero (float *a)
void clamp_color (float *rgb)
void midpoint (float *a, const float *b, const float *c)
 compute the midpoint a between two vectors b & c (a = (b + c)/2). More...

void create_Bspline_basis (float array[4][4])
 define a cubic spline with a B-Spline basis. More...

void create_modified_CR_spline_basis (float array[4][4], float slope)
 define a cubic spline with a Catmull-Rom basis. More...

void make_spline_Q_matrix (float q[4][3], float basis[4][4], const float *pts)
 Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point. More...

void make_spline_Q_matrix_noncontig (float q[4][3], float basis[4][4], const float *pts1, const float *pts2, const float *pts3, const float *pts4)
 Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point. This one works with non-contiguous memory layouts. More...

void make_spline_interpolation (float out[3], float w, float q[4][3])
 Evaluate the spline to return a point on the curve specified by the w parameter, in the range 0 to 1. XXX an improved implementation might use forward differences to find the points on the curve rather than explicitly evaluating points one at a time. Forward differences should be much faster, since it can be done with 9 additions and no multiplies, whereas this code has to do 9 multiplies as well as 9 additions for each point. The forward difference method requires setup, and some extra storage for it's position/velocity/acceleration accumulators however, so it may be an even trade-off. More...

int tri_degenerate (const float *, const float *, const float *)
 determine if a triangle is degenerate or not. More...

float angle (const float *, const float *)
 compute the angle between two vectors a & b (0 to 180 deg). More...

float dihedral (const float *, const float *, const float *, const float *)
 Compute the dihedral angle for the given atoms, returning a value between -180 and 180. More...

float distance (const float *, const float *)
 compute the distance between two points a & b. More...

float distance2 (const float *a, const float *b)
 compute the squared distance between two points a & b. More...

float norm (const float *)
 find and return the norm of a 3-vector. More...

char * vmd_tempfile (const char *)
 VMD temp file (portable) given a string, return a new one with the temp dir name prepended. The returned string must be deleted. More...

int vmd_delete_file (const char *)
 VMD file deletion function (portable). More...

void vmd_sleep (int)
 VMD process sleep functions (portable). More...

void vmd_msleep (int)
int vmd_system (const char *cmd)
 a buffer function to system() call to be replaced by a different implementation in console-free Win32 applications. More...

void vmd_srandom (unsigned int)
 portable random number generation, NOT thread-safe however. More...

long vmd_random ()
 portable random number generation, NOT thread-safe however XXX we should replace these with our own thread-safe random number generator implementation at some point. More...

float vmd_random_gaussian ()
 Slow but accurate standard distribution random number generator (variance = 1). More...

long vmd_get_total_physmem_mb (void)
 return the number of MB of physical memory installed in the system. More...

long vmd_get_avail_physmem_mb (void)
 return the number of MB of physical memory "free" (no VM/swap counted...). More...

long vmd_get_avail_physmem_percent (void)
 return the percentage of physical memory available. More...


Define Documentation

#define ABS      ((A)>0?(A):-(A))
 

Definition at line 37 of file utilities.h.

#define DEGTORAD      (a*VMD_PI/180.0)
 

Definition at line 49 of file utilities.h.

Referenced by collinear, compute_angle_energy, compute_dihed_energy, compute_imprp_energy, dodecahedron, Timestep::get_transform_vectors, measure_surface_int, obj_transabout, Matrix4::rot, Quat::rotate, Symmetry::Symmetry, and vmd_volmap_ils.

#define FALSE   0
 

Definition at line 28 of file utilities.h.

#define NULL   0
 

Definition at line 33 of file utilities.h.

Referenced by access_tcl_atomsel, access_tcl_atomsel_obj, IMDMgr::act_on_command, ColorFltkMenu::act_on_command, activate, add, add_callback, SymbolTable::add_custom_singleword, add_link, VolMapCreateILS::add_map_to_molecule, MaterialList::add_material, addmenu, addrep, alos, BaseMolecule::analyze, anim_goto, VMDApp::animation_dir_name, VMDApp::animation_style_name, VMDDisplayList::append, QMData::assign_wavef_id, DrawMolItem::atom_displayed, BaseMolecule::atom_fragment, BaseMolecule::atom_residue, AtomColor::AtomColor, atomparser_node::atomparser_node, AtomSel::AtomSel, atomsel_AsAtomSel, atomsel_get, Atomsel_Init, atomsel_iter, atomsel_new, atomsel_set, atomselect, atomselect_move, atomselect_moveby, atomselection_subscript, atomSelParser_init, BaseMolecule::BaseMolecule, bondsearchthread, breakup_filename, OpenGLRenderer::build3Dmipmaps, button_cb, VolMapCreate::calculate_minmax, Orbital::calculate_mo, call_callbacks, MolFilePlugin::can_read_bonds, MolFilePlugin::can_read_graphics, MolFilePlugin::can_read_metadata, MolFilePlugin::can_read_structure, MolFilePlugin::can_read_timesteps, MolFilePlugin::can_read_volumetric, MolFilePlugin::can_write_bonds, MolFilePlugin::can_write_structure, MolFilePlugin::can_write_timesteps, categories, CaveScene::CaveScene, center, change, AtomSel::change, DrawMolItem::change_rep, MoleculeList::change_repcolor, MoleculeList::change_repmethod, MoleculeList::change_repsel, Win32Joystick::check_event, VMDCollab::check_event, Spaceball::check_event, UIVR::check_event, GeometryMol::check_mol, check_params, MoleculeList::check_pickable, myFl_Chart::clear, Tool::clear_rep, VMDDisplayList::clipplane, SnapshotDisplayDevice::close_file, LibTachyonDisplayDevice::close_file, FileRenderer::close_file, cmd_animate_usage, cmd_gettimestep, cmd_mol_list, cmd_mol_usage, cmd_rawtimestep, cmd_vmdbench_usage, CmdMaterialAdd::CmdMaterialAdd, CmdRender::CmdRender, VMDApp::color_get_restype, VMDApp::colorscale_method_name, combine_arguments, VolMapCreate::combo_begin, compile_branch, compile_regex, DrawMolecule::component, DrawMolecule::component_from_pickable, Surf::compute, VolMapCreate::compute_all, VolMapCreateCoulombPotentialMSM::compute_frame, VolMapCreateCoulombPotential::compute_frame, VolMapCreateDistance::compute_frame, VolMapCreateOccupancy::compute_frame, VolMapCreateInterp::compute_frame, VolMapCreateDensity::compute_frame, VolMapCreateMask::compute_frame, MSMSInterface::compute_from_socket, ComputeOccupancyMap_setup, VMDCollab::connect, contacts, symbol_data::convert, AtomSel::coordinates, CoorPluginData::CoorPluginData, copyatomstoconstbuf, create, CmdLabelDelete::create_text, ToolFltkMenu::create_tool, ctxt::ctxt, DrawMolecule::cuda_devpool, cuda_occupancy_thread, CUDAAccel::CUDAAccel, cudabusbw, cudabusbwthread, cudaenergythread, cudaglobmembwthread, cudamaddgflops, cudamaddthread, cudaorbitalthread, DisplayDevice::cue_mode_name, DrawMolecule::current, LibTachyonDisplayDevice::define_volume_texture, MoleculeList::del_all_molecules, del_callback, MoleculeList::del_molecule, MoleculeList::del_rep, DrawMolecule::del_rep, QMData::delete_basis_set, OpenGLCache::deleteUnused, delframe, delmacro, delrep, DepthSortObject::DepthSortObject, detach, IMDMgr::detach, CUDAAccel::device_name, dict2geom, VMDCollab::disconnect, Displayable::Displayable, SpringTool::do_event, RotateTool::do_event, VMDTkinterMenu::do_off, VMDTkMenu::do_on, VMDTkinterMenu::do_on, SaveTrajectoryFltkMenu::do_save, SpaceballTracker::do_start, CaveTracker::do_start, CaveButtons::do_start, TclTextInterp::doEvent, Tool::dograb, TclTextInterp::doInit, Displayable::draw_prepare, DrawMolItem::DrawMolItem, dupframe, DrawMolecule::duplicate_frame, energythread, escape_fltk_menustring, TclTextInterp::evalFile, VMDApp::filerender_default_filename, VMDApp::filerender_default_option, VMDApp::filerender_option, VMDApp::filerender_valid, FileRenderer::FileRenderer, FileRenderList::FileRenderList, FileSpec::FileSpec, FileRenderList::find, IdList::find, AtomColor::find, find_atom_from_name, OpenGLExtensions::find_extensions, find_menu_from_string, find_minmax, find_molecule, find_name_string_from_menuname, OpenGLExtensions::find_renderer, find_within, find_within_routine, fix, FltkOpenGLDisplayDevice::FltkOpenGLDisplayDevice, force_cb, FileRenderList::format, forward, FreeVRScene::FreeVRScene, generic_split, geom2dict, GeometryList::geom_list, GeometryMol::GeometryMol, GeometrySpring::GeometrySpring, get, Molecule::get_accession, get_accessions, QMData::get_angular_momentum_str, get_autoupdate, QMData::get_basis, Tool::get_buttons, get_center, QMTimestep::get_charge_set, get_color, get_colormap, get_colors, get_colorupdate, SymbolTable::get_custom_singleword, Molecule::get_database, get_databases, Tool::get_feedback, Molecule::get_file, Molecule::get_file_specs, get_filenames, get_filetypes, get_frame, DrawMolecule::get_frame, get_location, get_material, get_nearby_atom, QMTimestep::get_occupancies, QMTimestep::get_orbitalenergy, QMTimestep::get_orbitalids, get_periodic, get_physical_time, VMDApp::get_plugin, Symmetry::get_pointgroup, get_pte_idx, get_pte_idx_from_string, get_remarks, Molecule::get_remarks, get_repname, get_rotation, get_scale, get_scaleminmax, get_selection, get_smoothing, get_style, get_tachyon_run_string, Tool::get_targeted_atom, UIText::get_tcl_interp, get_top, Tool::get_tracker, get_trans, Molecule::get_type, get_visible, get_vmdapp, BaseMolecule::get_volume_data, QMTimestep::get_wavecoeffs, QMTimestep::get_wavefunction, BaseMolecule::getbondorder, getbonds, BaseMolecule::getbondtype, Tool::getdevices, getframe, SensorConfig::getnames, Tool::getoffset, DispCmdPickPointIndexArray::getpointers, UIVR::gettool, getvalues, grab_FreeVR_memory, TclTextInterp::graph_label_cb, graphics_color, graphics_cone, graphics_cylinder, graphics_delete, graphics_info, graphics_line, graphics_listall, graphics_material, graphics_materials, graphics_point, graphics_replace, graphics_sphere, graphics_text, graphics_triangle, graphics_trinorm, GraphicsFltkMenu::GraphicsFltkMenu, GraphLabelEvent::GraphLabelEvent, JString::gsub, Symmetry::guess, VMDApp::guess_filetype, MolBrowser::handle, myglwindow::handle, hash_delete, hash_destroy, hash_lookup, imdconnect, imdconnected, IMDMgr::IMDMgr, IMDSim::IMDSim, IMDSimBlocking::IMDSimBlocking, IMDSimThread::IMDSimThread, MoleculeGraphics::info_id, BaseMolecule::init_atoms, MolFilePlugin::init_read, MolFilePlugin::init_write, initvmd, interpolation, inthash_delete, inthash_destroy, inthash_lookup, intstack_compact, intstack_create, intstack_destroy, intstack_push, inverse, is_active, is_fixed, is_shown, is_startline, iter_next, JRegex::JRegex, keep, kill, IMDMgr::kill, label_add, label_delete, label_getvalues, label_hide, label_show, label_textsize, LibGelatoDisplayDevice::LibGelatoDisplayDevice, LibTachyonDisplayDevice::LibTachyonDisplayDevice, Scene::light_color, Scene::light_color_default, Scene::light_pos, Scene::light_pos_default, list_devices, listall, location, loop, macro, MainFltkMenu::MainFltkMenu, make_neighborlist, make_neighborlist_sym, make_tcl_atomsel, malloc_from_CAVE_memory, match, JRegex::match, matdelete, measure_fit, measure_gofr, measure_minmax, measure_sasa, measure_surface, minmax, modrep, mol_add_volumetric, mol_cancel, mol_delete, mol_exists, mol_from_id, mol_listall, mol_load, mol_name, mol_new, mol_num, mol_numatoms, mol_rename, mol_ssrecalc, MoleculeList::molecule, Molecule::Molecule, VMDApp::molecule_id, VMDApp::molecule_load, VMDApp::molecule_name, VMDApp::molecule_savetrajectory, molecule_tcl, VMDApp::molecule_valid_id, MoleculeList::MoleculeList, MolFilePlugin::MolFilePlugin, molinfo_get, molinfo_set, VMDApp::molrep_get_color, VMDApp::molrep_get_colorupdate, VMDApp::molrep_get_drawframes, VMDApp::molrep_get_material, VMDApp::molrep_get_name, VMDApp::molrep_get_selection, VMDApp::molrep_get_selupdate, VMDApp::molrep_get_style, molrep_num, VMDApp::molrep_numselected, VMDApp::molrep_set_colorupdate, VMDApp::molrep_set_selupdate, TclTextInterp::mouse_pos_cb, mouse_usage, mousemode, Wavefunction::movefrom, msmain, Msmpot_create, Msmpot_cuda_setup_latcut, Msmpot_cuda_setup_shortrng, Msmpot_lattice_setup, My_Fl_Positioner::My_Fl_Positioner, myCreateWindow, myFl_Chart::myFl_Chart, NameList< Material * >::name, FileRenderList::name, next, MolFilePlugin::next, CoorPluginData::next, nopkernel, GeometryMol::normal_atom_coord, numframes, obj_getdoublearray, obj_measure, obj_transabout, obj_transvec, obj_transvecinv, obj_vecadd, obj_vecmean, obj_vecscale, obj_vecstddev, obj_vecsub, obj_vecsum, obj_vectrans, obj_volmap, once, SnapshotDisplayDevice::open_file, FileRenderer::open_file, OpenGLDisplayDevice::open_window, openclenergythread, openclorbitalthread, OpenGLCache::OpenGLCache, OpenGLDisplayDevice::OpenGLDisplayDevice, OpenGLRenderer::OpenGLRenderer, OpenWin32Connection, JString::operator+=, Wavefunction::operator=, JString::operator=, Orbital::Orbital, orbitalthread, Tool::orientation, SymbolTable::parse, parse_frames, parse_timestep, parse_two_selections_return_weight, parse_weight, parseMaterialDefs, ParseTree::ParseTree, pause, DisplayDevice::pick, PickList::pick_check, PickList::pick_end, PickModeAddBond::pick_molecule_end, PickList::pick_start, PickList::PickList, PickSelectionEvent::PickSelectionEvent, Tool::position, position_cb, prev, print_arep_summary, print_mol_summary, DisplayDevice::projection_name, PSDisplayDevice::PSDisplayDevice, DispCmdPickPointIndexArray::putdata, DispCmdPickPointIndex::putdata, DispCmdPickPoint::putdata, DispCmdLineWidth::putdata, DispCmdLineType::putdata, DispCmdSphereType::putdata, DispCmdSphereRes::putdata, DispCmdVolumeTexture::putdata, DispCmdVolSlice::putdata, DispCmdTextSize::putdata, DispCmdComment::putdata, DispCmdText::putdata, DispCmdColorIndex::putdata, DispCmdCone::putdata, DispCmdCylinder::putdata, DispCmdWireMesh::putdata, DispCmdTriStrips::putdata, DispCmdTriMesh::putdata, DispCmdSquare::putdata, DispCmdPolyLineArray::putdata, DispCmdLineArray::putdata, DispCmdLine::putdata, DispCmdLitPointArray::putdata, DispCmdPointArray::putdata, DispCmdSphereArray::putdata, DispCmdSphereIndex::putdata, DispCmdSphere::putdata, DispCmdPoint::putdata, DispCmdDataBlock::putdata, py_align, py_evaltcl, py_fit, py_move, py_moveby, py_rmsd, py_update, py_vmdexit, py_write, QMData::QMData, QMTimestep::QMTimestep, OpenGLDisplayDevice::read_event, read_matrix, MolFilePlugin::read_metadata, MolFilePlugin::read_optional_structure, MolFilePlugin::read_rawgraphics, read_stride_record, MolFilePlugin::read_structure, MolFilePlugin::read_volumetric, IMDSimThread::reader, MolData::readFile, readorwrite, OpenGLDisplayDevice::readpixels, FltkOpenGLDisplayDevice::readpixels, DisplayDevice::readpixels, registermenu, Tool::remove_device, rename, render, PSDisplayDevice::render, OpenGLRenderer::render, repindex, VMDDisplayList::reset_and_free, reset_scaleminmax, resetview, reverse, rock, rotate, same_int, sasa, scale, scale_max, scale_method, scale_methods, scale_midpoint, scale_min, JRegex::search, sel_from_py, SelectionBuilder::SelectionBuilder, selframe, SensorConfig::SensorConfig, set, DispCmdTriangle::set_array, set_autoupdate, UIVR::set_buttons, set_center, set_colormap, set_colors, set_colorupdate, set_default, UIVR::set_feedback, set_frame, set_location, set_periodic, set_physical_time, set_rotation, set_scale, set_scaleminmax, set_smoothing, set_top, UIVR::set_tracker, set_trans, set_visible, set_vmdapp, BaseMolecule::setbondorder, setbonds, BaseMolecule::setbondtype, VolumeTexture::setGridData, settings, setup_gridcells, setup_hierarchy, OpenGLRenderer::setup_initial_opengl_state, setup_mapinterp, setup_mapinterp_1Dcoef, SetupOpenGL, show, skip, Spaceball::Spaceball, OpenGLDisplayDevice::spaceball, TclTextInterp::spaceball_cb, spaceball_decode_event, spaceball_enable, VMDApp::spaceball_get_tracker_status, spaceball_usage, SpaceballTracker::SpaceballTracker, speed, FileRenderer::sphere, split_tcl_atomsel_info, ss_from_stride, stereomodes, VMDCollab::stopserver, AtomGrid::store, AtomList::storeFile, str_tokenize, stream_bench, stringdup, stringtoupper, style, symbol_data::symbol_data, SymbolTableElement::SymbolTableElement, Symmetry::Symmetry, Tool::target, tcl_append_matrix, tcl_colorinfo, tcl_colorinfo_rgb, tcl_colorinfo_scale, tcl_commands_get_sel, tcl_get_matrix, tcl_get_weights, tcl_graphics, tcl_graphics_color, tcl_graphics_cone, tcl_graphics_cylinder, tcl_graphics_info, tcl_graphics_line, tcl_graphics_sphere, tcl_graphics_text, TclTextInterp::TclTextInterp, text_cmd_animate, text_cmd_axes, text_cmd_collab, text_cmd_color, text_cmd_display, text_cmd_gopython, text_cmd_imd, text_cmd_label, text_cmd_light, text_cmd_material, text_cmd_menu, text_cmd_mol, text_cmd_mouse, text_cmd_play, text_cmd_plugin, text_cmd_render, text_cmd_rock, text_cmd_rotate, text_cmd_scale, text_cmd_spaceball, text_cmd_stage, text_cmd_tkrender, text_cmd_tool, text_cmd_translate, text_cmd_user, text_cmd_vmdbench, text_cmd_wait, textinputcb, Timestep::Timestep, timestep, AtomSel::timestep, Tool::Tool, Tool::tool_location_update, transfer, GeometryMol::transformed_atom_coord, translate, UIText::UIText, SpaceballTracker::update, SpaceballButtons::update, update, TachyonDisplayDevice::update_exec_cmd, update_off, update_on, update_ui, Vec_Init, velocities, vmd_bond_search, vmd_bondsearch_thr, vmd_check_stdin, VMDApp::vmd_choose_file, vmd_cl_compile_kernel, vmd_cl_context_num_devices, vmd_cl_create_command_queue, vmd_cl_get_platform_index, vmd_cl_print_platform_info, vmd_closedir, vmd_cuda_bus_bw, vmd_cuda_devpool_clear_device_mem, vmd_cuda_devpool_latency, vmd_cuda_devpool_setdevice, vmd_cuda_evaluate_orbital_grid, vmd_cuda_globmem_bw, vmd_cuda_madd_gflops, vmd_cuda_num_devices, vmd_get_avail_physmem_mb, vmd_get_total_physmem_mb, vmd_get_visual, vmd_get_vmddir, vmd_gridsearch1, vmd_gridsearch2, vmd_gridsearch3, vmd_gridsearch_bonds, Vmd_Init, vmd_initialize_tcl, vmd_isatty, vmd_measure_angle, vmd_measure_avpos, vmd_measure_bond, vmd_measure_center, vmd_measure_contacts, vmd_measure_dihed, vmd_measure_dipole, vmd_measure_energy, vmd_measure_fit, vmd_measure_gofr, vmd_measure_hbonds, vmd_measure_inertia, vmd_measure_inverse, vmd_measure_minmax, vmd_measure_pbc2onc_transform, vmd_measure_pbc_neighbors, vmd_measure_rgyr, vmd_measure_rmsd, vmd_measure_rmsf, vmd_measure_sasa, vmd_measure_sumweights, vmd_measure_surface, vmd_measure_symmetry, vmd_measure_trans_overlap, vmd_msleep, vmd_opencl_compile_orbital_pgm, vmd_opencl_compile_volcpotential_pgm, vmd_opencl_vol_cpotential, vmd_opendir, vmd_readdir, vmd_resize_alloc, vmd_tempfile, vmd_username, vmd_volmap_compare, vmd_volmap_ils, vmd_volmap_new_fromtype, vmd_writebmp, vmd_writeppm, vmd_writergb, vmd_writetga, VMDApp::VMDApp, VMDCollab::VMDCollab, vmddevpoolcudatilelatencythread, vmddevpoollatencythread, vmddevpooltilelatencythread, VMDDisplayList::VMDDisplayList, VMDFltkMenu::VMDFltkMenu, VMDGetOptions, OpenGLExtensions::vmdGetProcAddress, vmdinfo_tcl, VMDApp::VMDinit, VMDinitialize, vmdpcre_compile, vmdpcre_exec, vmdpcre_info, OpenGLExtensions::vmdQueryExtension, OpenGLExtensions::vmdQueryGLVersion, VMDreadInit, VMDreadStartup, vmdsock_accept, vmdsock_connect, vmdsock_create, vmdsock_destroy, vmdsock_selread, vmdsock_selwrite, vmdsock_shutdown, VMDTkinterMenu::VMDTkinterMenu, VMDTkMenu::VMDTkMenu, VMDApp::VMDupdate, vmdWindowProc, VolMapCreate::VolMapCreate, VolMapCreateILS::VolMapCreateILS, VolumeTexture::VolumeTexture, VolumetricData::VolumetricData, Vrml2DisplayDevice::Vrml2DisplayDevice, VrmlDisplayDevice::VrmlDisplayDevice, VRPNButtons::VRPNButtons, VRPNFeedback::VRPNFeedback, VRPNTracker::VRPNTracker, Wavefunction::Wavefunction, VMDTkinterMenu::where, Win32Joystick::Win32Joystick, win32vmdstart, wkf_cond_init, wkf_cpu_affinitylist, wkf_msg_timer_create, wkf_thread_create, wkf_thread_numprocessors, wkf_thread_run_barrier, wkf_thread_run_barrier_init, wkf_threadlaunch, wkf_threadlaunch_getdata, wkf_threadlaunch_getid, wkf_threadpool_create, wkf_threadpool_destroy, wkf_threadpool_launch, wkf_threadpool_sched_dynamic, wkf_threadpool_wait, wkf_threadpool_worker_devscaletile, wkf_threadpool_worker_getdata, wkf_threadpool_worker_getdevid, wkf_threadpool_worker_getdevspeed, wkf_threadpool_worker_getid, wkf_tilestack_compact, wkf_tilestack_destroy, wkf_tilestack_init, wkf_tilestack_push, RayShadeDisplayDevice::write_header, MolFilePlugin::write_structure, MolFilePlugin::write_timestep, xinput_close, xinput_close_device, xinput_decode_event, xinput_enable, xinput_open_device, yyparse, AtomSel::~AtomSel, CoorPluginData::~CoorPluginData, OpenGLDisplayDevice::~OpenGLDisplayDevice, OpenGLRenderer::~OpenGLRenderer, ParseTree::~ParseTree, Spaceball::~Spaceball, SpaceballTracker::~SpaceballTracker, TclTextInterp::~TclTextInterp, VMDApp::~VMDApp, and Win32Joystick::~Win32Joystick.

#define RADTODEG      (a*180.0/VMD_PI)
 

Definition at line 50 of file utilities.h.

Referenced by dodecahedron, myfit3, Matrix4::rotate_axis, transvec, Matrix4::transvec, transvecinv, and Matrix4::transvecinv.

#define TRUE   1
 

Definition at line 29 of file utilities.h.

#define VMD_1_PI   0.31830988618379067154
 

Definition at line 43 of file utilities.h.

Referenced by RenderManDisplayDevice::write_header, LibGelatoDisplayDevice::write_header, and GelatoDisplayDevice::write_header.

#define VMD_ANGS_TO_BOHR   1.88972612478289694072
 

Definition at line 46 of file utilities.h.

#define VMD_PI   3.14159265358979323846
 

Definition at line 41 of file utilities.h.

Referenced by VolMapCreateDensity::compute_frame, RenderManDisplayDevice::cone, convert_endpoints_to_matrix, cremer_pople_params, RenderManDisplayDevice::cylinder, OpenGLRenderer::cylinder, GelatoDisplayDevice::cylinder, draw_letter_D, hill_reilly_ring_pucker, measure_gofr, measure_sasa, QMData::normalize_basis, obj_transabout, ring_axes, Symmetry::score_plane, Symmetry::score_rotary_reflection, and spherical_cap.

#define VMD_RAND_MAX   2147483647L
 

Definition at line 431 of file utilities.h.

Referenced by measure_sasa, and vmd_random_gaussian.

#define VMD_TWOPI   (2.0 * VMD_PI)
 

Definition at line 42 of file utilities.h.

Referenced by FileRenderer::cone, FileRenderer::cylinder, fullcirclearc, HSItoRGB, DispCmdCylinder::putdata, Symmetry::score_axis, and Symmetry::score_rotary_reflection.


Function Documentation

float angle const float *   ,
const float *   
 

compute the angle between two vectors a & b (0 to 180 deg).

Definition at line 395 of file utilities.C.

Referenced by GeometryAngle::calculate, calculate_angle, dodecahedron, signed_angle, and vmd_measure_hbonds.

void breakup_filename const char *   ,
char **   ,
char **   
 

break a file name up into path + name, returning both in the specified character pointers. This creates storage for the new strings by allocating space for them.

Definition at line 159 of file utilities.C.

Referenced by Molecule::Molecule.

void clamp_color float *    rgb [inline]
 

Definition at line 194 of file utilities.h.

Referenced by cremer_pople_ring_color, hotcold_gradient, hotcold_gradient_lerp, and scale_color.

int clamp_int int    val,
int    min,
int    max
[inline]
 

clamp an integer value to the range min->max.

Definition at line 95 of file utilities.h.

Referenced by VolumetricData::compute_volume_gradient.

char* combine_arguments int   ,
const char **   ,
int   
 

given an argc, argv pair, take all the arguments from the Nth one on and combine them into a single string with spaces separating words. This allocates space for the string, which must be freed by the user.

Definition at line 63 of file utilities.C.

Referenced by text_cmd_mol, and text_cmd_render.

void create_Bspline_basis float    array[4][4] [inline]
 

define a cubic spline with a B-Spline basis.

Definition at line 252 of file utilities.h.

void create_modified_CR_spline_basis float    array[4][4],
float    slope
[inline]
 

define a cubic spline with a Catmull-Rom basis.

Definition at line 272 of file utilities.h.

Referenced by DrawMolItem::DrawMolItem.

float* cross_prod float *    x1,
const float *    x2,
const float *    x3
 

compute the cross product, assumes that x1 memory is _different_ than both x2 and x3, and returns the pointer to x1.

Definition at line 317 of file utilities.C.

Referenced by align_plane_with_axis, angle, IsoSurface::compute, Vrml2DisplayDevice::cone, FileRenderer::cone, Vrml2DisplayDevice::cylinder, FileRenderer::cylinder, dihedral, dodecahedron, hill_reilly_ring_pucker, DispCmdCylinder::putdata, DispCmdSquare::putdata, DispCmdTriangle::putdata, ring_axes, signed_angle, and POV3DisplayDevice::tricolor.

float dihedral const float *   ,
const float *   ,
const float *   ,
const float *   
 

Compute the dihedral angle for the given atoms, returning a value between -180 and 180.

Definition at line 407 of file utilities.C.

Referenced by GeometryDihedral::calculate, and calculate_dihed.

float distance const float *   ,
const float *   
 

compute the distance between two points a & b.

Definition at line 426 of file utilities.C.

Referenced by VrmlDisplayDevice::cone, Vrml2DisplayDevice::cone, convert_endpoints_to_matrix, VrmlDisplayDevice::cylinder, Vrml2DisplayDevice::cylinder, RotateTool::do_event, and trans_overlap.

float distance2 const float *    a,
const float *    b
[inline]
 

compute the squared distance between two points a & b.

Definition at line 385 of file utilities.h.

Referenced by distance, measure_rgyr, measure_rmsd, measure_rmsf, trans_overlap, vmd_gridsearch1, vmd_gridsearch2, and vmd_gridsearch3.

double dot_prod const double *    v1,
const double *    v2
[inline]
 

Definition at line 108 of file utilities.h.

Referenced by angle, basis_change, behind_plane, VolumetricData::cell_lengths, collinear, IsoSurface::compute, compute_pbcminmax, Vrml2DisplayDevice::cone, Vrml2DisplayDevice::cylinder, dihedral, PinchTool::do_event, hill_reilly_ring_pucker, measure_pbc_neighbors, orthogonal, orthonormal_basis, DispCmdCylinder::putdata, ring_axes, VRPNFeedback::sendforce, VolMapCreateILS::set_probe_symmetry, signed_angle, TachyonDisplayDevice::start_clipgroup, POV3DisplayDevice::start_clipgroup, LibTachyonDisplayDevice::start_clipgroup, POV3DisplayDevice::tricolor, and vmd_volmap_ils.

float dot_prod const float *    v1,
const float *    v2
[inline]
 

compute the inner dot product.

Definition at line 104 of file utilities.h.

void make_spline_interpolation float    out[3],
float    w,
float    q[4][3]
[inline]
 

Evaluate the spline to return a point on the curve specified by the w parameter, in the range 0 to 1. XXX an improved implementation might use forward differences to find the points on the curve rather than explicitly evaluating points one at a time. Forward differences should be much faster, since it can be done with 9 additions and no multiplies, whereas this code has to do 9 multiplies as well as 9 additions for each point. The forward difference method requires setup, and some extra storage for it's position/velocity/acceleration accumulators however, so it may be an even trade-off.

Definition at line 364 of file utilities.h.

void make_spline_Q_matrix float    q[4][3],
float    basis[4][4],
const float *    pts
[inline]
 

Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point.

Definition at line 297 of file utilities.h.

void make_spline_Q_matrix_noncontig float    q[4][3],
float    basis[4][4],
const float *    pts1,
const float *    pts2,
const float *    pts3,
const float *    pts4
[inline]
 

Builds the spline matrix "Q" from the basis matrix "M" and the geometry matrix "G". The geometry matrix in this case is the pts parameter, which contains the previous, current, and next two points defining the curve. For Catmull-Rom splines the tangent at the current point is the same as the direction from the previous point to the next point. This one works with non-contiguous memory layouts.

Definition at line 321 of file utilities.h.

void midpoint float *    a,
const float *    b,
const float *    c
[inline]
 

compute the midpoint a between two vectors b & c (a = (b + c)/2).

Definition at line 214 of file utilities.h.

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

float norm const float *   
 

find and return the norm of a 3-vector.

Definition at line 343 of file utilities.C.

Referenced by GeometrySpring::calculate, GeometryBond::calculate, calculate_bond, AtomColor::find, icosahedron_geodesic, Symmetry::impose, VRPNFeedback::sendforce, VMDDisplayList::set_clip_normal, triangulate, and vmd_volmap_compare.

char* str_tokenize const char *   ,
int *   ,
char **   
 

tokenize a given string; return char ptr if ok, NULL if error.

Referenced by VMDGetOptions.

char* stringdup const char *   
 

make a copy of a string using c++ new routine for memory alloc.

Definition at line 90 of file utilities.C.

Referenced by MainFltkMenu::act_on_command, SymbolTable::add_custom_singleword, NameList< Material * >::add_name, MoleculeGraphics::add_text, Tool::assign_rep, breakup_filename, AtomSel::change, CmdAnimWriteFile::CmdAnimWriteFile, CmdColorChange::CmdColorChange, CmdColorItem::CmdColorItem, CmdColorName::CmdColorName, CmdColorScaleMethod::CmdColorScaleMethod, CmdDisplayAxes::CmdDisplayAxes, CmdDisplayCacheMode::CmdDisplayCacheMode, CmdDisplayCueMode::CmdDisplayCueMode, CmdDisplayProj::CmdDisplayProj, CmdDisplayRenderMode::CmdDisplayRenderMode, CmdDisplayStageLocation::CmdDisplayStageLocation, CmdDisplayStereo::CmdDisplayStereo, CmdIMDConnect::CmdIMDConnect, CmdLabelAdd::CmdLabelAdd, CmdLabelTextFormat::CmdLabelTextFormat, CmdLabelTextOffset::CmdLabelTextOffset, CmdMaterialAdd::CmdMaterialAdd, CmdMaterialChange::CmdMaterialChange, CmdMaterialDelete::CmdMaterialDelete, CmdMaterialRename::CmdMaterialRename, CmdMenuExtensionAdd::CmdMenuExtensionAdd, CmdMenuExtensionRemove::CmdMenuExtensionRemove, CmdMenuShow::CmdMenuShow, CmdRender::CmdRender, CmdRenderOption::CmdRenderOption, IMDMgr::connect, DisplayDevice::DisplayDevice, VMDTkMenu::do_on, SpaceballTracker::do_start, DrawMolItem::DrawMolItem, FileRenderer::FileRenderer, GeometryMol::geom_set_name, GraphLabelEvent::GraphLabelEvent, MolFilePlugin::init_read, MolFilePlugin::init_write, VMDApp::material_delete, VMDApp::material_rename, Molecule::Molecule, MoleculeList::MoleculeList, SnapshotDisplayDevice::open_file, LibTachyonDisplayDevice::open_file, FileRenderer::open_file, PickModeMolLabel::PickModeMolLabel, MolFilePlugin::read_volumetric, Molecule::record_database, Molecule::record_file, Molecule::record_remarks, VMDTkMenu::register_proc, Molecule::rename, DrawMolItem::set_drawframes, FileRenderer::set_exec_string, NameList< Material * >::set_name, MoleculeList::set_selection, SnapshotDisplayDevice::SnapshotDisplayDevice, str_tokenize, strupcmp, text_cmd_user, TrajectoryReadEvent::TrajectoryReadEvent, TachyonDisplayDevice::update_exec_cmd, VMDApp::vmd_choose_file, vmd_tempfile, vmd_username, VMDFltkMenu::VMDFltkMenu, VMDMenu::VMDMenu, VMDreadStartup, VMDTempFile::VMDTempFile, VMDTkMenu::VMDTkMenu, and VolumetricData::VolumetricData.

char* stringtoupper char *   
 

convert the given string to upper case.

Definition at line 104 of file utilities.C.

Referenced by strupcmp.

void stripslashes char *    str
 

strip trailing '/' characters from a string.

Definition at line 116 of file utilities.C.

Referenced by vmd_tempfile, and VMDreadStartup.

int strupcmp const char *   ,
const char *   
 

do case-insensitive string comparisons.

Definition at line 123 of file utilities.C.

Referenced by VMDApp::axes_set_location, UIText::change_interp, SpaceballTracker::do_start, DisplayDevice::set_cue_mode, DisplayDevice::set_projection, VMDApp::stage_set_location, text_cmd_material, text_cmd_rotate, text_cmd_scale, text_cmd_translate, VMDApp::vmd_choose_file, vmd_measure_angle, vmd_measure_bond, vmd_measure_dihed, vmd_measure_energy, vmd_measure_pbc2onc_transform, vmd_measure_pbc_neighbors, vmd_measure_symmetry, and VMDGetOptions.

int strupncmp const char *   ,
const char *   ,
int   
 

do case-insensitive string comparisons.

Definition at line 140 of file utilities.C.

Referenced by checkfileextension, VMDApp::colorscale_method_index, IdList::find, obj_measure, obj_volmap, text_cmd_animate, text_cmd_axes, text_cmd_collab, text_cmd_color, text_cmd_display, text_cmd_gopython, text_cmd_imd, text_cmd_label, text_cmd_light, text_cmd_material, text_cmd_menu, text_cmd_mol, text_cmd_mouse, text_cmd_plugin, text_cmd_render, text_cmd_rock, text_cmd_rotate, text_cmd_spaceball, text_cmd_stage, text_cmd_tool, text_cmd_user, text_cmd_vmdbench, vmd_measure_angle, vmd_measure_avpos, vmd_measure_bond, vmd_measure_dihed, vmd_measure_energy, vmd_measure_inertia, vmd_measure_pbc2onc_transform, vmd_measure_pbc_neighbors, vmd_measure_rmsf, vmd_measure_symmetry, vmd_measure_trans_overlap, and xinput_enable.

double time_of_day void   
 

get the time of day from the system clock, and return it (in seconds) (This is supposedly accurate to within about 1 millisecond.

Definition at line 232 of file utilities.C.

int tri_degenerate const float *   ,
const float *   ,
const float *   
 

determine if a triangle is degenerate or not.

Definition at line 349 of file utilities.C.

Referenced by Surf::compute.

void vec_add float *    a,
const float *    b,
const float *    c
[inline]
 

add 2nd and 3rd elements, put into 1st.

Definition at line 132 of file utilities.h.

Referenced by atomselect_moveby, GeometrySpring::calculate, FileRenderer::cone, FileRenderer::cylinder, SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PinchTool::do_event, dodecahedron, Tool::dograb, draw_letter_D, measure_pbc_neighbors, py_moveby, OpenGLRenderer::render, PickModeMoveRep::rotate, PickModeMoveMolecule::rotate, PickModeMoveFragment::rotate, PickModeMoveResidue::rotate, VRPNFeedback::sendforce, VolMapCreateILS::set_probe, PickModeMoveRep::translate, PickModeMoveMolecule::translate, PickModeMoveFragment::translate, PickModeMoveResidue::translate, PickModeMoveAtom::translate, and vec_lerp.

void vec_copy float *    v1,
const float *    v2
[inline]
 

copy the first 3 elements from v2 to v1.

Definition at line 113 of file utilities.h.

Referenced by MoleculeGraphics::add_cone, MoleculeGraphics::add_cylinder, MoleculeGraphics::add_line, MoleculeGraphics::add_pickpoint, MoleculeGraphics::add_point, MoleculeGraphics::add_sphere, MoleculeGraphics::add_text, MoleculeGraphics::add_triangle, MoleculeGraphics::add_tricolor, MoleculeGraphics::add_trinorm, assign_atoms, compute_pbcminmax, FileRenderer::cone, FileRenderer::cylinder, Displayable::Displayable, PrintTool::do_event, GrabTool::do_event, dodecahedron, DisplayDevice::get_eye_dir, DisplayDevice::get_eye_pos, DisplayDevice::get_eye_up, get_transform_to_orthonormal_cell, hotcold_gradient_lerp, icosahedron_geodesic, Symmetry::impose, FileRenderer::line, measure_pbc_neighbors, orthonormal_basis, PickModeMove::pick_molecule_move, FileRenderer::point, prepare_texture_coordinates, ribbon_spline, VRPNFeedback::sendforce, DisplayDevice::set_eye_dir, DisplayDevice::set_eye_pos, DisplayDevice::set_eye_up, VolMapCreateILS::set_pbc, VolMapCreateILS::set_probe_symmetry, signed_angle, FileRenderer::sphere, Tool::target, triangulate, vmd_measure_symmetry, and vmd_volmap_ils.

void vec_incr float *    a,
const float *    b
[inline]
 

increment 1st vector by 2nd vector.

Definition at line 139 of file utilities.h.

Referenced by ring_axes.

void vec_lerp float *    a,
const float *    b,
const float *    c,
float    frac
[inline]
 

perform linear interpolation between two vectors a = b + frac*(c-b).

Definition at line 181 of file utilities.h.

References vec_add, vec_scale, and vec_sub.

Referenced by lerp_color_range, and VolumetricData::voxel_gradient_interpolate.

void vec_negate float *    a,
const float *    b
[inline]
 

a = -b.

Definition at line 160 of file utilities.h.

Referenced by FileRenderer::cone, FileRenderer::cylinder, GrabTool::do_event, dodecahedron, get_transform_to_orthonormal_cell, hexahedron, icosahedron_geodesic, measure_pbc_neighbors, octahedron, TachyonDisplayDevice::start_clipgroup, POV3DisplayDevice::start_clipgroup, and LibTachyonDisplayDevice::start_clipgroup.

float* vec_normalize float *   
 

normalizes the 3-vector to length one and returns the pointer note that this changes the vector.

Definition at line 327 of file utilities.C.

Referenced by MoleculeGraphics::add_tricolor, MoleculeGraphics::add_trinorm, align_plane_with_axis, Vrml2DisplayDevice::cone, FileRenderer::cone, Vrml2DisplayDevice::cylinder, FileRenderer::cylinder, cylinder_full, OpenGLRenderer::do_define_light, RotateTool::do_event, dodecahedron, hill_reilly_ring_pucker, icosahedron_geodesic, Symmetry::impose, FileRenderer::line, measure_fit, IsoSurface::normalize, orthonormal_basis, prepare_texture_coordinates, DispCmdCylinder::putdata, DispCmdSquare::putdata, DispCmdTriangle::putdata, PSDisplayDevice::render, ring_axes, VolMapCreateILS::set_probe_symmetry, signed_angle, FileRenderer::sphere, triangulate, and OpenGLRenderer::update_shader_uniforms.

void vec_scale float *    a,
float    b,
const double *    c
[inline]
 

a = b*c.

Definition at line 153 of file utilities.h.

Referenced by GeometrySpring::calculate, DisplayDevice::DisplayDevice, SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PinchTool::do_event, measure_pbc_neighbors, GeometrySpring::prepare, OpenGLRenderer::render, VRPNFeedback::sendforce, DisplayDevice::set_eye_defaults, VolMapCreateILS::set_probe, Tool::target, Tool::tug, OpenGLRenderer::update_shader_uniforms, and vec_lerp.

void vec_scale float *    a,
float    b,
const float *    c
[inline]
 

a = b*c.

Definition at line 146 of file utilities.h.

void vec_scaled_add float *    a,
float    b,
const float *    c
[inline]
 

a += c*d.

Definition at line 167 of file utilities.h.

Referenced by compute_pbcminmax, get_transform_to_orthonormal_cell, icosahedron_geodesic, measure_pbc_neighbors, ribbon_spline, and triangulate.

void vec_sub float *    a,
const float *    b,
const float *    c
[inline]
 

subtract 3rd vector from 2nd and put into 1st in other words, a = b - c.

Definition at line 125 of file utilities.h.

Referenced by GeometrySpring::calculate, GeometryBond::calculate, GeometryAngle::calculate, calculate_angle, calculate_bond, Vrml2DisplayDevice::cone, convert_endpoints_to_matrix, Vrml2DisplayDevice::cylinder, dihedral, SpringTool::do_event, TugTool::do_event, RotateTool::do_event, PinchTool::do_event, Tool::dograb, draw_outsides, AtomColor::find, hill_reilly_ring_pucker, icosahedron_geodesic, FileRenderer::line, measure_pbc_neighbors, PickModeMove::pick_molecule_move, DispCmdCylinder::putdata, PickModeMoveRep::rotate, PickModeMoveMolecule::rotate, PickModeMoveFragment::rotate, PickModeMoveResidue::rotate, VRPNFeedback::sendforce, VolMapCreateILS::set_probe, triangulate, POV3DisplayDevice::tricolor, vec_lerp, vmd_gridsearch1, vmd_gridsearch2, vmd_gridsearch3, vmd_gridsearch_bonds, and vmd_measure_hbonds.

void vec_triad float *    a,
const float *    b,
float    c,
const float *    d
[inline]
 

a = b + c*d (name taken from STREAM benchmark routine).

Definition at line 174 of file utilities.h.

Referenced by orthonormal_basis.

void vec_zero float *    a [inline]
 

Definition at line 188 of file utilities.h.

Referenced by cremer_pople_ring_color, dodecahedron, Timestep::get_transform_vectors, hotcold_gradient, hotcold_gradient_lerp, measure_minmax, and VolMapCreateILS::set_probe.

int vmd_check_stdin void   
 

check for input on stdin.

Definition at line 250 of file utilities.C.

int vmd_delete_file const char *   
 

VMD file deletion function (portable).

Definition at line 474 of file utilities.C.

Referenced by Surf::compute, ss_from_stride, and VMDTempFile::~VMDTempFile.

long vmd_get_avail_physmem_mb void   
 

return the number of MB of physical memory "free" (no VM/swap counted...).

Definition at line 609 of file utilities.C.

long vmd_get_avail_physmem_percent void   
 

return the percentage of physical memory available.

Definition at line 681 of file utilities.C.

long vmd_get_total_physmem_mb void   
 

return the number of MB of physical memory installed in the system.

Definition at line 554 of file utilities.C.

int vmd_getuid void   
 

return the uid of the currently logged-on user.

Definition at line 306 of file utilities.C.

void vmd_msleep int   
 

Definition at line 493 of file utilities.C.

Referenced by VMDCollab::act_on_command, FreeVRScene::draw, CaveScene::draw, VMDTitle::prepare, IMDSimThread::reader, and VMDApp::VMDupdate.

long vmd_random  
 

portable random number generation, NOT thread-safe however XXX we should replace these with our own thread-safe random number generator implementation at some point.

Definition at line 512 of file utilities.C.

float vmd_random_gaussian  
 

Slow but accurate standard distribution random number generator (variance = 1).

Definition at line 530 of file utilities.C.

void vmd_sleep int   
 

VMD process sleep functions (portable).

Definition at line 485 of file utilities.C.

Referenced by MSMSInterface::compute_from_socket, VMDCollab::connect, text_cmd_sleep, VMDApp::VMDexit, and VMDinitialize.

void vmd_srandom unsigned    int
 

portable random number generation, NOT thread-safe however.

Definition at line 520 of file utilities.C.

Referenced by measure_sasa.

int vmd_system const char *    cmd
 

a buffer function to system() call to be replaced by a different implementation in console-free Win32 applications.

Definition at line 504 of file utilities.C.

Referenced by Surf::compute, MSMSInterface::compute_from_file, PlainTextInterp::evalString, FileRenderList::render, and ss_from_stride.

char* vmd_tempfile const char *   
 

VMD temp file (portable) given a string, return a new one with the temp dir name prepended. The returned string must be deleted.

Definition at line 430 of file utilities.C.

Referenced by Surf::compute, MSMSInterface::compute_from_file, and text_cmd_mol.

char* vmd_username void   
 

return the username of the currently logged-on user.

Definition at line 286 of file utilities.C.


Generated on Tue Nov 24 01:41:23 2009 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002