Changeset 47d041 for src/Actions/AtomAction
- Timestamp:
- Nov 3, 2011, 7:44:01 PM (14 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:
- 41a467
- Parents:
- 50e4e5
- git-author:
- Frederik Heber <heber@…> (10/27/11 11:53:58)
- git-committer:
- Frederik Heber <heber@…> (11/03/11 19:44:01)
- Location:
- src/Actions/AtomAction
- Files:
-
- 5 edited
-
AddAction.cpp (modified) (3 diffs)
-
ChangeElementAction.cpp (modified) (1 diff)
-
RemoveAction.cpp (modified) (3 diffs)
-
RotateAroundOriginByAngleAction.cpp (modified) (1 diff)
-
SaveSelectedAtomsAction.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AtomAction/AddAction.cpp
r50e4e5 r47d041 48 48 first->setType(params.elemental); 49 49 first->setPosition(params.position); 50 DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << "." << endl);50 LOG(1, "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << "."); 51 51 // TODO: remove when all of World's atoms are stored. 52 52 std::vector<molecule *> molecules = World::getInstance().getAllMolecules(); … … 61 61 AtomAddState *state = assert_cast<AtomAddState*>(_state.get()); 62 62 63 DoLog(1) && (Log() << Verbose(1) << "Removing atom with id " << state->id << "." << endl);63 LOG(1, "Removing atom with id " << state->id << "."); 64 64 World::getInstance().destroyAtom(state->id); 65 65 … … 73 73 first->setType(state->params.elemental); 74 74 first->setPosition(state->params.position); 75 DoLog(1) && (Log() << Verbose(1) << "Re-adding new atom with element " << state->params.elemental->getName() << " at " << state->params.position << "." << endl);75 LOG(1, "Re-adding new atom with element " << state->params.elemental->getName() << " at " << state->params.position << "."); 76 76 // TODO: remove when all of World's atoms are stored. 77 77 std::vector<molecule *> molecules = World::getInstance().getAllMolecules(); -
src/Actions/AtomAction/ChangeElementAction.cpp
r50e4e5 r47d041 57 57 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 58 58 first = iter->second; 59 DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << *params.elemental << "." << endl);59 LOG(1, "Changing atom " << *first << " to element " << *params.elemental << "."); 60 60 mol = first->getMolecule(); 61 61 first->removeFromMolecule(); // remove atom -
src/Actions/AtomAction/RemoveAction.cpp
r50e4e5 r47d041 53 53 iter != World::getInstance().endAtomSelection(); 54 54 iter = World::getInstance().beginAtomSelection()) { 55 DoLog(1) && (Log() << Verbose(1) << "Removing atom " << (iter->second)->getId() << "." << endl);55 LOG(1, "Removing atom " << (iter->second)->getId() << "."); 56 56 World::getInstance().destroyAtom((iter->second)); 57 57 } … … 65 65 for (; i<state->Walkers.size(); ++i) { 66 66 // re-create the atom 67 DoLog(1) && (Log() << Verbose(1) << "Re-adding atom " << state->Walkers[i].getId() << "." << endl);67 LOG(1, "Re-adding atom " << state->Walkers[i].getId() << "."); 68 68 atom *Walker = World::getInstance().createAtom(); 69 69 if (!state->Walkers[i].setAtom(*Walker)) { 70 DoeLog(1) && (eLog() << Verbose(1) << "Failed to set id." << endl);70 ELOG(1, "Failed to set id."); 71 71 World::getInstance().destroyAtom(Walker); 72 72 break; … … 88 88 // simple remove again all previously added atoms 89 89 for (size_t i=0; i<state->Walkers.size(); ++i) { 90 DoLog(1) && (Log() << Verbose(1) << "Re-removing atom " << state->Walkers[i].getId() << "." << endl);90 LOG(1, "Re-removing atom " << state->Walkers[i].getId() << "."); 91 91 World::getInstance().destroyAtom(state->Walkers[i].getId()); 92 92 } -
src/Actions/AtomAction/RotateAroundOriginByAngleAction.cpp
r50e4e5 r47d041 56 56 Line RotationAxis(Vector(0.,0.,0.), params.Axis); 57 57 58 DoLog(0) && (Log() << Verbose(0) << "Rotate around origin by " << params.angle << " radian, axis from origin to " << params.Axis << "." << endl);58 LOG(0, "Rotate around origin by " << params.angle << " radian, axis from origin to " << params.Axis << "."); 59 59 // TODO: use AtomSet::rotate? 60 60 for (std::vector<atom *>::iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) { 61 61 (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), params.angle)); 62 62 } 63 DoLog(0) && (Log() << Verbose(0) << "done." << endl);63 LOG(0, "done."); 64 64 return Action::state_ptr(new AtomRotateAroundOriginByAngleState(World::getInstance().getSelectedAtoms(), params)); 65 65 } -
src/Actions/AtomAction/SaveSelectedAtomsAction.cpp
r50e4e5 r47d041 41 41 getParametersfromValueStorage(); 42 42 43 DoLog(1) && (Log() << Verbose(1) << "Storing selected atoms to file " << params.filename << "." << endl);43 LOG(1, "Storing selected atoms to file " << params.filename << "."); 44 44 45 45 // extract suffix … … 56 56 #endif 57 57 } else { 58 DoeLog(1) && (eLog() << Verbose(1) << "Output file does not have a suffix, cannot recognize format." << endl);58 ELOG(1, "Output file does not have a suffix, cannot recognize format."); 59 59 return Action::failure; 60 60 } … … 67 67 FormatParserStorage::getInstance().saveSelectedAtoms(output, FilenameSuffix); 68 68 } else { 69 DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);69 ELOG(1, "Could not open file " << params.filename << "."); 70 70 } 71 71 output.close();
Note:
See TracChangeset
for help on using the changeset viewer.
