Changeset 096214
- Timestamp:
- Jan 2, 2010, 3:28:29 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:
- 477bb2
- Parents:
- 7c6f73
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/menu.cpp
r7c6f73 r096214 29 29 #include "Menu/SeperatorItem.hpp" 30 30 #include "Menu/DisplayMenuItem.hpp" 31 #include "Menu/SubMenuItem.hpp" 31 32 #include "Actions/MethodAction.hpp" 32 33 #include "Views/StreamStringView.hpp" … … 986 987 }; 987 988 988 989 /** Submenu for creating new molecules.990 * \param *periode periodentafel991 * \param *molecules list of molecules to add to992 */993 void oldmenu::EditMolecules(periodentafel *periode, MoleculeListClass *molecules)994 {995 TextMenu *edit_molecules_menu = new TextMenu(Log() << Verbose(0), "Edit Molecules");996 997 Action *createMoleculeAction = new MethodAction(boost::bind(&oldmenu::createNewMolecule,this,periode,molecules));998 new ActionMenuItem('c',"create new molecule",edit_molecules_menu,createMoleculeAction);999 1000 Action *loadMoleculeAction = new MethodAction(boost::bind(&oldmenu::loadFromXYZ,this,periode,molecules));1001 new ActionMenuItem('l',"load molecule from xyz file",edit_molecules_menu,loadMoleculeAction);1002 1003 Action *changeFilenameAction = new MethodAction(boost::bind(&oldmenu::changeName,this,molecules));1004 new ActionMenuItem('n',"change molecule's name",edit_molecules_menu,changeFilenameAction);1005 1006 Action *giveFilenameAction = new MethodAction(boost::bind(&oldmenu::setMoleculeFilename,this,molecules));1007 new ActionMenuItem('N',"give molecules filename",edit_molecules_menu,giveFilenameAction);1008 1009 Action *parseAtomsAction = new MethodAction(boost::bind(&oldmenu::parseXYZIntoMolecule,this,molecules));1010 new ActionMenuItem('p',"parse atoms in xyz file into molecule",edit_molecules_menu,parseAtomsAction);1011 1012 Action *eraseMoleculeAction = new MethodAction(boost::bind(&oldmenu::eraseMolecule,this,molecules));1013 new ActionMenuItem('r',"remove a molecule",edit_molecules_menu,eraseMoleculeAction);1014 1015 Action *returnAction = new MethodAction(boost::bind(&TextMenu::doQuit,edit_molecules_menu));1016 MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",edit_molecules_menu,returnAction);1017 1018 edit_molecules_menu->addDefault(returnItem);1019 1020 1021 edit_molecules_menu->display();1022 1023 delete edit_molecules_menu;1024 delete createMoleculeAction;1025 delete loadMoleculeAction;1026 delete changeFilenameAction;1027 delete giveFilenameAction;1028 delete parseAtomsAction;1029 delete eraseMoleculeAction;1030 delete returnAction;1031 1032 #if 01033 char choice; // menu choice char1034 1035 Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;1036 Log() << Verbose(0) << "c - create new molecule" << endl;1037 Log() << Verbose(0) << "l - load molecule from xyz file" << endl;1038 Log() << Verbose(0) << "n - change molecule's name" << endl;1039 Log() << Verbose(0) << "N - give molecules filename" << endl;1040 Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;1041 Log() << Verbose(0) << "r - remove a molecule" << endl;1042 Log() << Verbose(0) << "all else - go back" << endl;1043 Log() << Verbose(0) << "===============================================" << endl;1044 Log() << Verbose(0) << "INPUT: ";1045 cin >> choice;1046 1047 switch (choice) {1048 default:1049 Log() << Verbose(0) << "Not a valid choice." << endl;1050 break;1051 case 'c':1052 createNewMolecule(periode,molecules);1053 break;1054 1055 case 'l': // load from XYZ file1056 loadFromXYZ(periode,molecules);1057 break;1058 1059 case 'n':1060 changeName(molecules);1061 break;1062 1063 case 'N':1064 setMoleculeFilename(molecules);1065 break;1066 1067 case 'p': // parse XYZ file1068 parseXYZIntoMolecule(molecules);1069 break;1070 1071 case 'r':1072 eraseMolecule(molecules);1073 break;1074 }1075 #endif1076 };1077 1078 1079 989 /** Submenu for merging molecules. 1080 990 * \param *periode periodentafel … … 1301 1211 new ActionMenuItem('a',"set molecule (in)active",main_menu,setMoleculeAction); 1302 1212 1303 Action *editMoleculeAction = new MethodAction(boost::bind(&oldmenu::EditMolecules,this,periode, molecules));1304 new ActionMenuItem('e',"edit molecules (load, parse, save)",main_menu,editMoleculeAction);1213 TextMenu *edit_molecules_menu = new TextMenu(Log() << Verbose(0), "Edit Molecules"); 1214 new SubMenuItem('e',"edit molecules (load, parse, save)",main_menu,edit_molecules_menu); 1305 1215 1306 1216 Action *manipulateMoleculeAction = new MethodAction(boost::bind(&oldmenu::ManipulateMolecules,this,periode, molecules, configuration)); … … 1329 1239 new ActionMenuItem('q',"quit",main_menu,quitAction); 1330 1240 1241 // build the EditMoleculesMenu 1242 Action *createMoleculeAction = new MethodAction(boost::bind(&oldmenu::createNewMolecule,this,periode,molecules)); 1243 new ActionMenuItem('c',"create new molecule",edit_molecules_menu,createMoleculeAction); 1244 1245 Action *loadMoleculeAction = new MethodAction(boost::bind(&oldmenu::loadFromXYZ,this,periode,molecules)); 1246 new ActionMenuItem('l',"load molecule from xyz file",edit_molecules_menu,loadMoleculeAction); 1247 1248 Action *changeFilenameAction = new MethodAction(boost::bind(&oldmenu::changeName,this,molecules)); 1249 new ActionMenuItem('n',"change molecule's name",edit_molecules_menu,changeFilenameAction); 1250 1251 Action *giveFilenameAction = new MethodAction(boost::bind(&oldmenu::setMoleculeFilename,this,molecules)); 1252 new ActionMenuItem('N',"give molecules filename",edit_molecules_menu,giveFilenameAction); 1253 1254 Action *parseAtomsAction = new MethodAction(boost::bind(&oldmenu::parseXYZIntoMolecule,this,molecules)); 1255 new ActionMenuItem('p',"parse atoms in xyz file into molecule",edit_molecules_menu,parseAtomsAction); 1256 1257 Action *eraseMoleculeAction = new MethodAction(boost::bind(&oldmenu::eraseMolecule,this,molecules)); 1258 new ActionMenuItem('r',"remove a molecule",edit_molecules_menu,eraseMoleculeAction); 1259 1260 Action *returnAction = new MethodAction(boost::bind(&TextMenu::doQuit,edit_molecules_menu)); 1261 MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",edit_molecules_menu,returnAction); 1262 1263 edit_molecules_menu->addDefault(returnItem); 1331 1264 1332 1265 main_menu->display(); 1333 1266 1334 1267 1268 delete main_menu; 1269 1270 // delete all actions and views contained in Menu 1271 // TODO: find a better way to handle this 1272 1335 1273 delete moleculeView; 1336 1274 1337 1275 delete setMoleculeAction; 1338 delete editMoleculeAction;1339 1276 delete manipulateMoleculeAction; 1340 1277 delete mergeMoleculeAction; … … 1345 1282 delete quitAction; 1346 1283 1347 delete main_menu; 1284 delete createMoleculeAction; 1285 delete loadMoleculeAction; 1286 delete changeFilenameAction; 1287 delete giveFilenameAction; 1288 delete parseAtomsAction; 1289 delete eraseMoleculeAction; 1290 delete returnAction; 1348 1291 }; 1349 1292 -
src/menu.hpp
r7c6f73 r096214 38 38 void AlignAtoms(periodentafel *, molecule *); 39 39 void CenterAtoms(molecule *); 40 void EditMolecules(periodentafel *, MoleculeListClass *);41 40 void FragmentAtoms(molecule *, config *); 42 41 void ManipulateAtoms(periodentafel *, MoleculeListClass *, config *);
Note:
See TracChangeset
for help on using the changeset viewer.