Changeset d2be22 for src/Actions


Ignore:
Timestamp:
Dec 19, 2025, 11:29:38 PM (7 weeks ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.1, stable
Children:
25aa214
Parents:
29ba9a
git-author:
Frederik Heber <frederik.heber@…> (11/16/25 11:12:52)
git-committer:
Frederik Heber <frederik.heber@…> (12/19/25 23:29:38)
Message:

Actions relying on BondGraph fail if not bond table is loaded.

  • this is to ensure to not stumble over missing optimal bond lengths from the table, like with StretchBondAction.
  • TESTFIX: All regression tests that use these actions need to load the bond-table now.
Location:
src/Actions
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/BondifyAction.cpp

    r29ba9a rd2be22  
    214214  // ensure we have one selected atom
    215215  World &world = World::getInstance();
    216   const BondGraph &BG = *world.getBondGraph();
     216  const BondGraph &BG = *world.getBondGraph(); 
    217217
    218218  // check precondition
     219  if (!BG.IsBondLengthTableLoaded()) {
     220    STATUS("BondLength table has not been loaded.");
     221    return Action::failure;
     222  }
    219223  const std::vector<atom *> atoms = world.getSelectedAtoms();
    220224  if (atoms.size() != 1) {
  • src/Actions/GraphAction/CreateAdjacencyAction.cpp

    r29ba9a rd2be22  
    6666  BondGraph *BG = World::getInstance().getBondGraph();
    6767  ASSERT(BG != NULL, "GraphCreateAdjacencyAction: BondGraph is NULL.");
     68
     69  if (!BG->IsBondLengthTableLoaded()) {
     70    STATUS("BondLength table has not been loaded.");
     71    return Action::failure;
     72  }
    6873
    6974  // count all present bonds
  • src/Actions/GraphAction/UpdateMoleculesAction.cpp

    r29ba9a rd2be22  
    4343#include "CodePatterns/Log.hpp"
    4444#include "CodePatterns/Verbose.hpp"
    45 #include "Graph/BondGraph.hpp"
    4645#include "Graph/DepthFirstSearchAnalysis.hpp"
    4746#include "molecule.hpp"
  • src/Actions/MoleculeAction/StretchBondAction.cpp

    r29ba9a rd2be22  
    4747#include "Bond/bond.hpp"
    4848#include "Bond/StretchBond.hpp"
     49#include "Graph/BondGraph.hpp"
    4950#include "Graph/BoostGraphHelpers.hpp"
    5051#include "World.hpp"
     
    6061ActionState::ptr MoleculeStretchBondAction::performCall()
    6162{
     63  BondGraph *BG = World::getInstance().getBondGraph();
     64  if (!BG->IsBondLengthTableLoaded()) {
     65    STATUS("BondLength table has not been loaded.");
     66    return Action::failure;
     67  }
     68
    6269  const std::vector< atom *> atoms = World::getInstance().getSelectedAtoms();
    6370  StretchBondUtil stretcher(atoms);
Note: See TracChangeset for help on using the changeset viewer.