Changeset a83171
- Timestamp:
- Mar 3, 2010, 2:53:07 PM (16 years ago)
- Children:
- 328418d, 3d575e
- Parents:
- bd506d
- git-author:
- Frederik Heber <heber@…> (03/03/10 14:46:13)
- git-committer:
- Frederik Heber <heber@…> (03/03/10 14:53:07)
- Location:
- molecuilder/src
- Files:
-
- 6 edited
-
World.cpp (modified) (3 diffs)
-
World.hpp (modified) (1 diff)
-
builder.cpp (modified) (3 diffs)
-
molecule.cpp (modified) (1 diff)
-
molecule_graph.cpp (modified) (1 diff)
-
moleculelist.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/World.cpp
rbd506d ra83171 6 6 */ 7 7 8 #include <string> 9 8 10 #include "World.hpp" 9 11 10 12 double *World::cell_size = 0; 13 char *World::DefaultName = 0; 11 14 12 15 /** Constructor of World. … … 16 19 { 17 20 cell_size = new double[6]; 21 DefaultName = new char[6]; 22 strncpy(DefaultName, "none", 4); 18 23 }; 19 24 … … 24 29 { 25 30 delete[](cell_size); 31 delete[](DefaultName); 26 32 }; 27 33 -
molecuilder/src/World.hpp
rbd506d ra83171 32 32 33 33 static double *cell_size; 34 static char *DefaultName; 34 35 35 36 private: -
molecuilder/src/builder.cpp
rbd506d ra83171 1480 1480 Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl; 1481 1481 Log() << Verbose(0) << "\t-V\t\tGives version information." << endl; 1482 Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl; 1482 1483 Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl; 1483 1484 return (1); … … 1518 1519 Log() << Verbose(0) << "I won't parse trajectories." << endl; 1519 1520 configuration.FastParsing = true; 1521 break; 1522 case 'X': 1523 { 1524 char **name = &(World::get()->DefaultName); 1525 delete[](*name); 1526 const int length = strlen(argv[argptr]); 1527 *name = new char[length+2]; 1528 strncpy(*name, argv[argptr], length); 1529 Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl; 1530 } 1520 1531 break; 1521 1532 default: // no match? Step on … … 1709 1720 } 1710 1721 } 1711 if ( mol == NULL) {1722 if ((mol == NULL) && (!molecules->ListOfMolecules.empty())) { 1712 1723 mol = *(molecules->ListOfMolecules.begin()); 1713 mol->ActiveFlag = true; 1724 if (mol != NULL) 1725 mol->ActiveFlag = true; 1714 1726 } 1715 1727 break; -
molecuilder/src/molecule.cpp
rbd506d ra83171 46 46 for(int i=MAX_ELEMENTS;i--;) 47 47 ElementsInMolecule[i] = 0; 48 strcpy(name, "none");48 strcpy(name,World::get()->DefaultName); 49 49 }; 50 50 -
molecuilder/src/molecule_graph.cpp
rbd506d ra83171 495 495 bond *Binder = NULL; 496 496 497 if (AtomCount == 0) 498 return SubGraphs; 497 499 Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl; 498 500 DepthFirstSearchAnalysis_Init(DFS, this); -
molecuilder/src/moleculelist.cpp
rbd506d ra83171 786 786 787 787 // 1. dissect the molecule into connected subgraphs 788 configuration->BG->ConstructBondGraph(mol); 788 if (configuration->BG->ConstructBondGraph(mol)) { 789 delete (mol); 790 eLog() << Verbose(1) << "There are no bonds." << endl; 791 return; 792 } 789 793 790 794 // 2. scan for connected subgraphs … … 793 797 Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack); 794 798 delete(BackEdgeStack); 799 if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) { 800 delete (mol); 801 eLog() << Verbose(1) << "There are no atoms." << endl; 802 return; 803 } 795 804 796 805 // 3. dissect (the following construct is needed to have the atoms not in the order of the DFS, but in
Note:
See TracChangeset
for help on using the changeset viewer.
