Ignore:
Timestamp:
Jul 23, 2012 11:51:04 AM (12 years ago)
Author:
ldelgass
Message:

Add protocol to change atom/bond radius scale factor for VTK molecules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/RpVtkRendererGraphicsObjs.cpp

    r3095 r3110  
    10831083
    10841084/**
    1085  * \brief Set radius standard for scaling atoms
    1086  */
    1087 void Renderer::setMoleculeAtomScaling(const DataSetId& id, Molecule::AtomScaling scaling)
     1085 * \brief Set radius scale factor for atoms
     1086 */
     1087void Renderer::setMoleculeAtomRadiusScale(const DataSetId& id, double scale)
    10881088{
    10891089    MoleculeHashmap::iterator itr;
     
    11031103
    11041104    do {
     1105        itr->second->setAtomRadiusScale(scale);
     1106    } while (doAll && ++itr != _molecules.end());
     1107
     1108    _needsRedraw = true;
     1109}
     1110
     1111/**
     1112 * \brief Set radius standard for scaling atoms
     1113 */
     1114void Renderer::setMoleculeAtomScaling(const DataSetId& id, Molecule::AtomScaling scaling)
     1115{
     1116    MoleculeHashmap::iterator itr;
     1117
     1118    bool doAll = false;
     1119
     1120    if (id.compare("all") == 0) {
     1121        itr = _molecules.begin();
     1122        doAll = true;
     1123    } else {
     1124        itr = _molecules.find(id);
     1125    }
     1126    if (itr == _molecules.end()) {
     1127        ERROR("Molecule not found: %s", id.c_str());
     1128        return;
     1129    }
     1130
     1131    do {
    11051132        itr->second->setAtomScaling(scaling);
    11061133    } while (doAll && ++itr != _molecules.end());
     
    11311158    do {
    11321159        itr->second->setAtomVisibility(state);
     1160    } while (doAll && ++itr != _molecules.end());
     1161
     1162    _needsRedraw = true;
     1163}
     1164
     1165/**
     1166 * \brief Set radius scale factor for atoms
     1167 */
     1168void Renderer::setMoleculeBondRadiusScale(const DataSetId& id, double scale)
     1169{
     1170    MoleculeHashmap::iterator itr;
     1171
     1172    bool doAll = false;
     1173
     1174    if (id.compare("all") == 0) {
     1175        itr = _molecules.begin();
     1176        doAll = true;
     1177    } else {
     1178        itr = _molecules.find(id);
     1179    }
     1180    if (itr == _molecules.end()) {
     1181        ERROR("Molecule not found: %s", id.c_str());
     1182        return;
     1183    }
     1184
     1185    do {
     1186        itr->second->setBondRadiusScale(scale);
    11331187    } while (doAll && ++itr != _molecules.end());
    11341188
Note: See TracChangeset for help on using the changeset viewer.