Changeset 129204 for src/Graph


Ignore:
Timestamp:
Mar 2, 2011, 9:53:08 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
111387
Parents:
766ba5
git-author:
Frederik Heber <heber@…> (02/25/11 19:58:54)
git-committer:
Frederik Heber <heber@…> (03/02/11 21:53:08)
Message:

Moved bond.* to Bond/, new class GraphEdge which contains graph parts of bond.

  • enums Shading and EdgeType are now part of GraphEdge, hence bigger change in the code where these are used.
Location:
src/Graph
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/BondGraph.cpp

    r766ba5 r129204  
    2323
    2424#include "atom.hpp"
    25 #include "bond.hpp"
     25#include "Bond/bond.hpp"
    2626#include "Graph/BondGraph.hpp"
    2727#include "Box.hpp"
  • src/Graph/BondGraph.hpp

    r766ba5 r129204  
    2121
    2222#include "AtomSet.hpp"
    23 #include "bond.hpp"
     23#include "Bond/bond.hpp"
    2424#include "CodePatterns/Assert.hpp"
    2525#include "CodePatterns/Log.hpp"
  • src/Graph/BreadthFirstSearchAdd.cpp

    r766ba5 r129204  
    2323
    2424#include "atom.hpp"
    25 #include "bond.hpp"
     25#include "Bond/bond.hpp"
    2626#include "CodePatterns/Assert.hpp"
    2727#include "CodePatterns/Info.hpp"
     
    5757  ShortestPathList[atom_id] = -1;
    5858  if (AddedAtomList.find(atom_id) != AddedAtomList.end()) // mark already present atoms (i.e. Root and maybe others) as visited
    59     ColorList[atom_id] = bond::lightgray;
     59    ColorList[atom_id] = GraphEdge::lightgray;
    6060  else
    61     ColorList[atom_id] = bond::white;
     61    ColorList[atom_id] = GraphEdge::white;
    6262}
    6363
     
    6565void BreadthFirstSearchAdd::UnvisitedNode(molecule *Mol, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond)
    6666{
    67   if (Binder != Bond) // let other atom bond::white if it's via Root bond. In case it's cyclic it has to be reached again (yet Root is from OtherAtom already bond::black, thus no problem)
    68     ColorList[OtherAtom->getNr()] = bond::lightgray;
     67  if (Binder != Bond) // let other atom GraphEdge::white if it's via Root bond. In case it's cyclic it has to be reached again (yet Root is from OtherAtom already GraphEdge::black, thus no problem)
     68    ColorList[OtherAtom->getNr()] = GraphEdge::lightgray;
    6969  PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor
    7070  ShortestPathList[OtherAtom->getNr()] = ShortestPathList[Walker->getNr()] + 1;
    71   DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << Binder->getColorName(ColorList[OtherAtom->getNr()]) << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl);
     71  DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << GraphEdge::getColorName(ColorList[OtherAtom->getNr()]) << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl);
    7272  if ((((ShortestPathList[OtherAtom->getNr()] < BondOrder) && (Binder != Bond)))) { // Check for maximum distance
    7373    DoLog(3) && (Log() << Verbose(3));
     
    7777      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->getNr()], AddedAtomList[OtherAtom->getNr()], Binder);
    7878      DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");
    79     } else { // this code should actually never come into play (all bond::white atoms are not yet present in BondMolecule, that's why they are bond::white in the first place)
     79    } else { // this code should actually never come into play (all GraphEdge::white atoms are not yet present in BondMolecule, that's why they are GraphEdge::white in the first place)
    8080      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName());
    8181      if (AddedBondList[Binder->nr] == NULL) {
     
    8989  } else { // out of bond order, then replace
    9090    if ((AddedAtomList[OtherAtom->getNr()] == NULL) && (Binder->Cyclic))
    91       ColorList[OtherAtom->getNr()] = bond::white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)
     91      ColorList[OtherAtom->getNr()] = GraphEdge::white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic)
    9292    if (Binder == Bond)
    9393      DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond");
     
    139139  Init(_Root, _BondOrder);
    140140
    141   // and go on ... Queue always contains all bond::lightgray vertices
     141  // and go on ... Queue always contains all GraphEdge::lightgray vertices
    142142  while (!BFSStack.empty()) {
    143143    // we have to pop the oldest atom from stack. This keeps the atoms on the stack always of the same ShortestPath distance.
     
    156156        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    157157        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
    158         if (ColorList[OtherAtom->getNr()] == bond::white) {
     158        if (ColorList[OtherAtom->getNr()] == GraphEdge::white) {
    159159          UnvisitedNode(Mol, Walker, OtherAtom, Binder, Bond);
    160160        } else {
     
    163163      }
    164164    }
    165     ColorList[Walker->getNr()] = bond::black;
    166     DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " bond::black." << endl);
     165    ColorList[Walker->getNr()] = GraphEdge::black;
     166    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " GraphEdge::black." << endl);
    167167  }
    168168}
  • src/Graph/BreadthFirstSearchAdd.hpp

    r766ba5 r129204  
    2020#include "types.hpp"
    2121
    22 #include "bond.hpp"
     22#include "Bond/bond.hpp"
    2323
    2424class atom;
     
    6060  std::map<atomId_t, atom *> PredecessorList;
    6161  std::map<atomId_t, int > ShortestPathList;
    62   std::map<atomId_t, enum bond::Shading> ColorList;
     62  std::map<atomId_t, enum GraphEdge::Shading> ColorList;
    6363  std::deque<atom *> BFSStack;
    6464  int BondOrder;
Note: See TracChangeset for help on using the changeset viewer.