Changeset 09eaac for src/Actions/FillAction/FillSurfaceAction.cpp
- Timestamp:
- Nov 15, 2012, 5:31:07 PM (13 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, Candidate_v1.7.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:
- eff536
- Parents:
- 98d03b
- git-author:
- Michael Ankele <ankele@…> (09/07/12 13:31:23)
- git-committer:
- Frederik Heber <heber@…> (11/15/12 17:31:07)
- File:
-
- 1 moved
-
src/Actions/FillAction/FillSurfaceAction.cpp (moved) (moved from src/Actions/FillAction/FillSphericalSurfaceAction.cpp ) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FillAction/FillSurfaceAction.cpp
r98d03b r09eaac 22 22 23 23 /* 24 * FillS phericalSurfaceAction.cpp24 * FillSurfaceAction.cpp 25 25 * 26 26 * Created on: Mar 29, 2012 … … 48 48 #include "molecule.hpp" 49 49 #include "Shapes/BaseShapes.hpp" 50 #include "Shapes/ShapeFactory.hpp" 50 51 #include "World.hpp" 51 52 … … 58 59 #include <vector> 59 60 60 #include "Actions/FillAction/FillS phericalSurfaceAction.hpp"61 #include "Actions/FillAction/FillSurfaceAction.hpp" 61 62 62 63 using namespace MoleCuilder; 63 64 64 65 // and construct the stuff 65 #include "FillS phericalSurfaceAction.def"66 #include "FillSurfaceAction.def" 66 67 #include "Action_impl_pre.hpp" 67 68 /** =========== define the function ====================== */ 68 Action::state_ptr FillS phericalSurfaceAction::performCall() {69 Action::state_ptr FillSurfaceAction::performCall() { 69 70 // get the filler molecule 70 71 const std::vector< molecule *> molecules = World::getInstance().getSelectedMolecules(); … … 99 100 100 101 // create predicate, mesh, and filler 101 FillS phericalSurfaceState *UndoState = NULL;102 FillSurfaceState *UndoState = NULL; 102 103 bool successflag = false; 103 104 { … … 107 108 ) 108 109 ); 109 Shape s = Sphere(params.center.get(), params.radius.get()); 110 111 Shape s = ShapeFactory::getInstance().produce(); 112 110 113 boost::function<const NodeSet ()> func = 111 114 boost::bind(&Shape::getHomogeneousPointsOnSurface, boost::ref(s), params.N.get()); … … 150 153 std::transform(filler->begin(), filler->end(), MovedToVector.begin(), 151 154 boost::bind(&AtomInfo::getPosition, _1) ); 152 UndoState = new FillS phericalSurfaceState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params);155 UndoState = new FillSurfaceState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params); 153 156 } 154 157 } … … 166 169 } 167 170 168 Action::state_ptr FillS phericalSurfaceAction::performUndo(Action::state_ptr _state) {169 FillS phericalSurfaceState *state = assert_cast<FillSphericalSurfaceState*>(_state.get());171 Action::state_ptr FillSurfaceAction::performUndo(Action::state_ptr _state) { 172 FillSurfaceState *state = assert_cast<FillSurfaceState*>(_state.get()); 170 173 171 174 // remove all created atoms … … 177 180 } 178 181 179 Action::state_ptr FillS phericalSurfaceAction::performRedo(Action::state_ptr _state){180 FillS phericalSurfaceState *state = assert_cast<FillSphericalSurfaceState*>(_state.get());182 Action::state_ptr FillSurfaceAction::performRedo(Action::state_ptr _state){ 183 FillSurfaceState *state = assert_cast<FillSurfaceState*>(_state.get()); 181 184 182 185 // place filler cluster again at new spot … … 194 197 } 195 198 196 bool FillS phericalSurfaceAction::canUndo() {199 bool FillSurfaceAction::canUndo() { 197 200 return true; 198 201 } 199 202 200 bool FillS phericalSurfaceAction::shouldUndo() {203 bool FillSurfaceAction::shouldUndo() { 201 204 return true; 202 205 }
Note:
See TracChangeset
for help on using the changeset viewer.
