Ignore:
Timestamp:
Nov 24, 2009, 3:34:49 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
1a3354
Parents:
7d1ad9
Message:

Fixes and naming of final Tecplot output file is now molecule name.

  • FIXES to builder.cpp:
    • case 'p' would not dissect the molecule into connected subgraphs
    • if done so, the BondGraph was not yet initialised
    • if done so, we need to check whether BondGraphFileName has been set
    • BondGraphFileName.empty() could not be used as a check, as was set to "" instead of "\n"
    • if (finally) done so, we have to remove the empty molecule that we parsed in
    • ... and then pick the newly added molecule for mol to point at
    • SaveConfig() did not set the merged molecule name correctly.
    • if empty config is given, the empty molecule now receives the ConfigFileName as name
  • FIXES to config.cpp
    • Load() did not set the name of the molecule
  • changes to tesselationhelper.cpp and tesselation.cpp
  • changes to PointCloud and molecule
    • new virtual function PointCloud::GetName() returns "unknown"
    • new function molecule::GetName() returns pointer to name of molecule
    • IsEmpty() and IsEnd() now return true by default
  • all .dat files in the "Tesselations" tests were changed accordingly (i.e. have now the name in the second line)
  • benzene was added as a new test for an absolutely flat molecule. So far, it fails horribly.
  • 13 of 17 tests run fine

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/moleculelist.cpp

    r7d1ad9 rcc9225  
    760760  // 4a. create array of molecules to fill
    761761  const int MolCount = Subgraphs->next->Count();
     762  char number[MAXSTRINGSIZE];
    762763  molecule **molecules = Malloc<molecule *>(MolCount, "config::Load() - **molecules");
    763764  for (int i=0;i<MolCount;i++) {
    764765    molecules[i] = (molecule*) new molecule(mol->elemente);
    765766    molecules[i]->ActiveFlag = true;
     767    strncpy(molecules[i]->name, mol->name, MAXSTRINGSIZE);
     768    if (MolCount > 1) {
     769      sprintf(number, "-%d", i+1);
     770      strncat(molecules[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1);
     771    }
     772    cout << "MolName is " << molecules[i]->name << endl;
    766773    insert(molecules[i]);
    767774  }
     
    800807    }
    801808  }
    802   // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintained their ListOfBonds, but we have to remove them from first..last list
     809  // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain their ListOfBonds, but we have to remove them from first..last list
    803810  bond *Binder = mol->first;
    804811  while (mol->first->next != mol->last) {
Note: See TracChangeset for help on using the changeset viewer.