Changeset 477bb2 for src/menu.cpp
- Timestamp:
- Jan 2, 2010, 3:49:40 PM (15 years ago)
- 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:
- 6b932c7
- Parents:
- 096214
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/menu.cpp
r096214 r477bb2 900 900 901 901 void oldmenu::createNewMolecule(periodentafel *periode,MoleculeListClass *molecules) { 902 molecule *mol = NULL; 903 mol = new molecule(periode); 904 molecules->insert(mol); 902 molecules->createNewMolecule(periode); 905 903 }; 906 904 907 905 void oldmenu::loadFromXYZ(periodentafel *periode,MoleculeListClass *molecules){ 908 molecule *mol = NULL; 909 Vector center; 910 char filename[MAXSTRINGSIZE]; 911 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 912 mol = new molecule(periode); 913 do { 914 Log() << Verbose(0) << "Enter file name: "; 915 cin >> filename; 916 } while (!mol->AddXYZFile(filename)); 917 mol->SetNameFromFilename(filename); 918 // center at set box dimensions 919 mol->CenterEdge(¢er); 920 mol->cell_size[0] = center.x[0]; 921 mol->cell_size[1] = 0; 922 mol->cell_size[2] = center.x[1]; 923 mol->cell_size[3] = 0; 924 mol->cell_size[4] = 0; 925 mol->cell_size[5] = center.x[2]; 926 molecules->insert(mol); 906 molecules->loadFromXYZ(periode); 927 907 } 928 908 929 909 void oldmenu::changeName(MoleculeListClass *molecules){ 930 char filename[MAXSTRINGSIZE]; 931 molecule *mol = NULL; 932 int nr; 933 do { 934 Log() << Verbose(0) << "Enter index of molecule: "; 935 cin >> nr; 936 mol = molecules->ReturnIndex(nr); 937 } while (mol == NULL); 938 Log() << Verbose(0) << "Enter name: "; 939 cin >> filename; 940 strcpy(mol->name, filename); 910 molecules->changeName(); 941 911 } 942 912 943 913 void oldmenu::setMoleculeFilename(MoleculeListClass *molecules) { 944 char filename[MAXSTRINGSIZE]; 945 int nr; 946 molecule *mol = NULL; 947 do { 948 Log() << Verbose(0) << "Enter index of molecule: "; 949 cin >> nr; 950 mol = molecules->ReturnIndex(nr); 951 } while (mol == NULL); 952 Log() << Verbose(0) << "Enter name: "; 953 cin >> filename; 954 mol->SetNameFromFilename(filename); 914 molecules->setMoleculeFilename(); 955 915 } 956 916 957 917 void oldmenu::parseXYZIntoMolecule(MoleculeListClass *molecules){ 958 char filename[MAXSTRINGSIZE]; 959 int nr; 960 molecule *mol = NULL; 961 mol = NULL; 962 do { 963 Log() << Verbose(0) << "Enter index of molecule: "; 964 cin >> nr; 965 mol = molecules->ReturnIndex(nr); 966 } while (mol == NULL); 967 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 968 do { 969 Log() << Verbose(0) << "Enter file name: "; 970 cin >> filename; 971 } while (!mol->AddXYZFile(filename)); 972 mol->SetNameFromFilename(filename); 918 molecules->parseXYZIntoMolecule(); 973 919 }; 974 920 975 921 void oldmenu::eraseMolecule(MoleculeListClass *molecules){ 976 int nr; 977 molecule *mol = NULL; 978 Log() << Verbose(0) << "Enter index of molecule: "; 979 cin >> nr; 980 for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 981 if (nr == (*ListRunner)->IndexNr) { 982 mol = *ListRunner; 983 molecules->ListOfMolecules.erase(ListRunner); 984 delete(mol); 985 break; 986 } 922 molecules->eraseMolecule(); 987 923 }; 988 924
Note:
See TracChangeset
for help on using the changeset viewer.