Changeset 26b4d62 for src/Actions/MoleculeAction
- Timestamp:
- Jun 27, 2014, 9:32:03 PM (11 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, Candidate_v1.7.0, 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:
- c73e35
- Parents:
- 0b6b77
- git-author:
- Frederik Heber <heber@…> (06/19/14 13:56:27)
- git-committer:
- Frederik Heber <heber@…> (06/27/14 21:32:03)
- Location:
- src/Actions/MoleculeAction
- Files:
-
- 16 edited
-
BondFileAction.cpp (modified) (2 diffs)
-
ChangeBondAngleAction.cpp (modified) (1 diff)
-
ChangeNameAction.cpp (modified) (1 diff)
-
FillVoidWithMoleculeAction.cpp (modified) (2 diffs)
-
FillWithMoleculeAction.cpp (modified) (1 diff)
-
LinearInterpolationofTrajectoriesAction.cpp (modified) (1 diff)
-
LoadAction.cpp (modified) (2 diffs)
-
RotateAroundSelfByAngleAction.cpp (modified) (1 diff)
-
RotateToPrincipalAxisSystemAction.cpp (modified) (1 diff)
-
SaveAdjacencyAction.cpp (modified) (1 diff)
-
SaveBondsAction.cpp (modified) (1 diff)
-
SaveSelectedMoleculesAction.cpp (modified) (4 diffs)
-
SaveTemperatureAction.cpp (modified) (2 diffs)
-
StretchBondAction.cpp (modified) (1 diff)
-
SuspendInWaterAction.cpp (modified) (1 diff)
-
VerletIntegrationAction.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/BondFileAction.cpp
r0b6b77 r26b4d62 67 67 mol->getBondCount(); 68 68 return Action::success; 69 } else 69 } else { 70 STATUS("There is not exactly one molecule selected."); 70 71 return Action::failure; 72 } 71 73 } 72 74 … … 77 79 // state->mol->setName(state->lastName); 78 80 81 STATUS("Undo for MoleculeBondFileAction not implemented."); 79 82 return Action::failure; 80 83 } 81 84 82 85 ActionState::ptr MoleculeBondFileAction::performRedo(ActionState::ptr _state){ 86 STATUS("Redo for MoleculeBondFileAction not implemented."); 83 87 return Action::failure; 84 88 } -
src/Actions/MoleculeAction/ChangeBondAngleAction.cpp
r0b6b77 r26b4d62 120 120 const std::vector< atom *> atoms = World::getInstance().getSelectedAtoms(); 121 121 if (atoms.size() != 3) { 122 ELOG(1,"Exactly three atoms must be selected.");122 STATUS("Exactly three atoms must be selected."); 123 123 return Action::failure; 124 124 } 125 125 // check precondition: linearly bonded atoms 126 126 const std::vector<size_t> indices = sortIndicesFromCentralAtom(atoms); 127 if (indices.size() != 3) 127 if (indices.size() != 3) { 128 STATUS("Selected atoms must be linearly bonded/form a chain"); 128 129 return Action::failure; 130 } 129 131 const molecule *mol = atoms[0]->getMolecule(); 130 132 if ((mol != atoms[1]->getMolecule()) || (mol != atoms[2]->getMolecule())) { 131 ELOG(1,"The two selected atoms must belong to the same molecule.");133 STATUS("The two selected atoms must belong to the same molecule."); 132 134 return Action::failure; 133 135 } -
src/Actions/MoleculeAction/ChangeNameAction.cpp
r0b6b77 r26b4d62 57 57 mol->setName(params.name.get()); 58 58 return ActionState::ptr(new MoleculeChangeNameState(mol,params)); 59 } else 59 } else { 60 STATUS("There must be exactly one molecule selected."); 60 61 return Action::failure; 62 } 61 63 } 62 64 -
src/Actions/MoleculeAction/FillVoidWithMoleculeAction.cpp
r0b6b77 r26b4d62 62 62 ActionState::ptr MoleculeFillVoidWithMoleculeAction::performCall() { 63 63 if (!boost::filesystem::exists(params.fillername.get())) { 64 ELOG(1, "File with filler molecule " << params.fillername.get() <<" does not exist!");64 STATUS("File with filler molecule "+params.fillername.get().string()+" does not exist!"); 65 65 return Action::failure; 66 66 } … … 152 152 //MoleculeFillVoidWithMoleculeState *state = assert_cast<MoleculeFillVoidWithMoleculeState*>(_state.get()); 153 153 154 STATUS("Redo for MoleculeFillVoidWithMoleculeAction not implemented."); 154 155 return Action::failure; 155 156 //return ActionState::ptr(_state); -
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
r0b6b77 r26b4d62 156 156 //MoleculeFillWithMoleculeState *state = assert_cast<MoleculeFillWithMoleculeState*>(_state.get()); 157 157 158 STATUS("Redo of MoleculeFillWithMoleculeAction not implemented."); 158 159 return Action::failure; 159 160 //return ActionState::ptr(_state); -
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp
r0b6b77 r26b4d62 74 74 // state->mol->setName(state->lastName); 75 75 76 STATUS("Undo of MoleculeLinearInterpolationofTrajectoriesAction not implemented."); 76 77 return Action::failure; 77 78 } -
src/Actions/MoleculeAction/LoadAction.cpp
r0b6b77 r26b4d62 60 60 // parsing file if present 61 61 if (!boost::filesystem::exists(params.filename.get())) { 62 LOG(1, "Specified input file " << params.filename.get() <<" not found.");62 STATUS("Specified input file "+params.filename.get().string()+" not found."); 63 63 return Action::failure; 64 64 } else { … … 73 73 FilenamePrefix = params.filename.get().stem().string(); 74 74 } else { 75 ELOG(1,"Input file does not have a suffix, cannot recognize format.");75 STATUS("Input file does not have a suffix, cannot recognize format."); 76 76 return Action::failure; 77 77 } -
src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp
r0b6b77 r26b4d62 57 57 // check whether a molecule is selected 58 58 std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules(); 59 if (selectedMolecules.size() == 0) 59 if (selectedMolecules.size() == 0) { 60 STATUS("There are need to be some molecules selected."); 60 61 return Action::failure; 62 } 61 63 62 64 // go through all selected molecules 63 65 BOOST_FOREACH(molecule *mol, selectedMolecules) { 64 66 // check whether Axis is valid 65 if (params.Axis.get().IsZero()) 67 if (params.Axis.get().IsZero()) { 68 STATUS("Rotation Axis must not be zero."); 66 69 return Action::failure; 70 } 67 71 68 72 // convert from degrees to radian -
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
r0b6b77 r26b4d62 78 78 // state->mol->setName(state->lastName); 79 79 80 STATUS("Undo of MoleculeRotateToPrincipalAxisSystemAction not implemented."); 80 81 return Action::failure; 81 82 } 82 83 83 84 ActionState::ptr MoleculeRotateToPrincipalAxisSystemAction::performRedo(ActionState::ptr _state){ 85 STATUS("Redo of MoleculeRotateToPrincipalAxisSystemAction not implemented."); 84 86 return Action::failure; 85 87 } -
src/Actions/MoleculeAction/SaveAdjacencyAction.cpp
r0b6b77 r26b4d62 82 82 // state->mol->setName(state->lastName); 83 83 84 STATUS("Undo of MoleculeSaveAdjacencyAction not implemented."); 84 85 return Action::failure; 85 86 } -
src/Actions/MoleculeAction/SaveBondsAction.cpp
r0b6b77 r26b4d62 70 70 // state->mol->setName(state->lastName); 71 71 72 STATUS("Undo of MoleculeSaveBondsAction not implemented."); 72 73 return Action::failure; 73 74 } -
src/Actions/MoleculeAction/SaveSelectedMoleculesAction.cpp
r0b6b77 r26b4d62 63 63 FilenamePrefix = params.filename.get().stem().string(); 64 64 } else { 65 ELOG(1,"Output file does not have a suffix, cannot recognize format.");65 STATUS("Output file does not have a suffix, cannot recognize format."); 66 66 return Action::failure; 67 67 } … … 74 74 FormatParserStorage::getInstance().saveSelectedMolecules(output, FilenameSuffix); 75 75 } else { 76 ELOG(1, "Could not open file " << params.filename.get() <<".");76 STATUS("Could not open file "+params.filename.get().string()+"."); 77 77 } 78 78 output.close(); … … 84 84 // ParserSaveXyzState *state = assert_cast<ParserSaveXyzState*>(_state.get()); 85 85 86 return Action:: failure;86 return Action::success; 87 87 // string newName = state->mol->getName(); 88 88 // state->mol->setName(state->lastName); … … 92 92 93 93 ActionState::ptr MoleculeSaveSelectedMoleculesAction::performRedo(ActionState::ptr _state){ 94 return Action:: failure;94 return Action::success; 95 95 // // Undo and redo have to do the same for this action 96 96 // return performUndo(_state); -
src/Actions/MoleculeAction/SaveTemperatureAction.cpp
r0b6b77 r26b4d62 63 63 const size_t MDSteps = set.getMaxTrajectorySize(); 64 64 OutputTemperature<std::vector<atom *> > writer(set); 65 if (output.fail() || !writer((ofstream * const) &output, 0, MDSteps)) 66 LOG(2, "File could not be written."); 67 else 65 if (output.fail() || !writer((ofstream * const) &output, 0, MDSteps)) { 66 STATUS("File could not be written."); 67 return Action::failure; 68 } else 68 69 LOG(2, "File stored."); 69 70 output.close(); … … 77 78 // state->mol->setName(state->lastName); 78 79 79 return Action:: failure;80 return Action::success; 80 81 } 81 82 -
src/Actions/MoleculeAction/StretchBondAction.cpp
r0b6b77 r26b4d62 58 58 const std::vector< atom *> atoms = World::getInstance().getSelectedAtoms(); 59 59 if (atoms.size() != 2) { 60 ELOG(1,"Exactly two atoms must be selected.");60 STATUS("Exactly two atoms must be selected."); 61 61 return Action::failure; 62 62 } 63 63 const molecule *mol = atoms[0]->getMolecule(); 64 64 if (mol != atoms[1]->getMolecule()) { 65 ELOG(1,"The two selected atoms must belong to the same molecule.");65 STATUS("The two selected atoms must belong to the same molecule."); 66 66 return Action::failure; 67 67 } -
src/Actions/MoleculeAction/SuspendInWaterAction.cpp
r0b6b77 r26b4d62 74 74 // state->mol->setName(state->lastName); 75 75 76 STATUS("Undo of MoleculeSuspendInWaterAction not implemented."); 76 77 return Action::failure; 77 78 } -
src/Actions/MoleculeAction/VerletIntegrationAction.cpp
r0b6b77 r26b4d62 89 89 // state->mol->setName(state->lastName); 90 90 91 STATUS("Undo of MoleculeVerletIntegrationAction not implemented."); 91 92 return Action::failure; 92 93 } 93 94 94 95 ActionState::ptr MoleculeVerletIntegrationAction::performRedo(ActionState::ptr _state){ 96 STATUS("Rddo of MoleculeVerletIntegrationAction not implemented."); 95 97 return Action::failure; 96 98 }
Note:
See TracChangeset
for help on using the changeset viewer.
