Ignore:
Timestamp:
Oct 30, 2009, 4:09:29 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
df0520
Parents:
b84ab4
Message:

BondGraph is initialized within config::Load(), as it has to happen after parsing options and before loading molecule. And various fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/config.cpp

    rb84ab4 r245826  
    831831/** Initializes config file structure by loading elements from a give file.
    832832 * \param *file input file stream being the opened config file
     833 * \param BondGraphFileName file name of the bond length table file, if string is left blank, no table is parsed.
    833834 * \param *periode pointer to a periodentafel class with all elements
    834835 * \param *mol pointer to molecule containing all atoms of the molecule
    835836 */
    836 void config::Load(const char * const filename, const periodentafel * const periode, molecule * const &mol)
     837void config::Load(const char * const filename, const string &BondGraphFileName, const periodentafel * const periode, molecule * const &mol)
    837838{
    838839  ifstream *file = new ifstream(filename);
     
    860861  /* Namen einlesen */
    861862
     863  // 1. parse in options
    862864  ParseForParameter(verbose,FileBuffer, "mainname", 0, 1, 1, string_type, (config::mainname), 1, critical);
    863865  ParseForParameter(verbose,FileBuffer, "defaultpath", 0, 1, 1, string_type, (config::defaultpath), 1, critical);
     
    10401042    config::StructOpt = 0;
    10411043
     1044  // 2. parse the bond graph file if given
     1045  BG = new BondGraph(IsAngstroem);
     1046  if (BG->LoadBondLengthTable((ofstream *)&cout, BondGraphFileName)) {
     1047    cout << Verbose(0) << "Bond length table loaded successfully." << endl;
     1048  } else {
     1049    cout << Verbose(0) << "Bond length table loading failed." << endl;
     1050  }
     1051
     1052  // 3. parse the molecule in
    10421053  LoadMolecule(mol, FileBuffer, periode, FastParsing);
     1054
     1055  // 4. dissect the molecule into connected subgraphs
     1056  BG->ConstructBondGraph((ofstream *)&cout, mol);
    10431057
    10441058  delete(FileBuffer);
     
    10471061/** Initializes config file structure by loading elements from a give file with old pcp syntax.
    10481062 * \param *file input file stream being the opened config file with old pcp syntax
     1063 * \param BondGraphFileName file name of the bond length table file, if string is left blank, no table is parsed.
    10491064 * \param *periode pointer to a periodentafel class with all elements
    10501065 * \param *mol pointer to molecule containing all atoms of the molecule
    10511066 */
    1052 void config::LoadOld(const char * const filename, const periodentafel * const periode, molecule * const &mol)
     1067void config::LoadOld(const char * const filename, const string &BondGraphFileName, const periodentafel * const periode, molecule * const &mol)
    10531068{
    10541069  ifstream *file = new ifstream(filename);
     
    12071222  config::StructOpt = 0;
    12081223
     1224
     1225  // 2. parse the bond graph file if given
     1226  BG = new BondGraph(IsAngstroem);
     1227  if (BG->LoadBondLengthTable((ofstream *)&cout, BondGraphFileName)) {
     1228    cout << Verbose(0) << "Bond length table loaded successfully." << endl;
     1229  } else {
     1230    cout << Verbose(0) << "Bond length table loading failed." << endl;
     1231  }
     1232
    12091233  // Routine from builder.cpp
    1210 
    12111234
    12121235  for (i=MAX_ELEMENTS;i--;)
Note: See TracChangeset for help on using the changeset viewer.