Changeset 09eaac for src/Actions/FillAction
- Timestamp:
- Nov 15, 2012, 5:31:07 PM (12 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:
- 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)
- Location:
- src/Actions/FillAction
- Files:
-
- 3 moved
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 } -
src/Actions/FillAction/FillSurfaceAction.def
r98d03b r09eaac 1 1 /* 2 * Fill RegularGridAction.def2 * FillSurfaceAction.def 3 3 * 4 4 * Created on: Mar 29, 2012 … … 20 20 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 21 21 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 22 #define paramtypes ( Vector)(double)(unsigned int)(double)(Vector)23 #define paramtokens ("c enter")("radius")("count")("min-distance")("Alignment-Axis")24 #define paramdescriptions (" center of the sphere")("sphere size")("number of instances to be added, changed according to geometric needs")("minimum distance between added instances")("The filler molecule is rotated relative to this alignment axis")25 #define paramdefaults (PARAM_DEFAULT( Vector(0.,0.,0.)))(NOPARAM_DEFAULT)(PARAM_DEFAULT(12))(PARAM_DEFAULT(1.))(NOPARAM_DEFAULT)26 #define paramreferences ( center)(radius)(N)(mindistance)(AlignedAxis)22 #define paramtypes (unsigned int)(double)(Vector) 23 #define paramtokens ("count")("min-distance")("Alignment-Axis") 24 #define paramdescriptions ("number of instances to be added, changed according to geometric needs")("minimum distance between added instances")("The filler molecule is rotated relative to this alignment axis") 25 #define paramdefaults (PARAM_DEFAULT(12))(PARAM_DEFAULT(1.))(NOPARAM_DEFAULT) 26 #define paramreferences (N)(mindistance)(AlignedAxis) 27 27 #define paramvalids \ 28 (BoxVectorValidator()) \29 (BoxLengthValidator()) \30 28 (DummyValidator< unsigned int >()) \ 31 29 (BoxLengthValidator()) \ … … 39 37 #define MENUNAME "fill" 40 38 #define MENUPOSITION 1 41 #define ACTIONNAME S phericalSurface42 #define TOKEN "fill-s pherical-surface"39 #define ACTIONNAME Surface 40 #define TOKEN "fill-surface" 43 41 44 42 45 43 // finally the information stored in the ActionTrait specialization 46 44 #define DESCRIPTION "\ 47 fill homogenous points on a s pheresurface with instances of the selected molecule."45 fill homogenous points on a shape's surface with instances of the selected molecule." 48 46 #undef SHORTFORM -
src/Actions/FillAction/FillSurfaceAction.hpp
r98d03b r09eaac 1 1 /* 2 * FillS phericalSurfaceAction.hpp2 * FillSurfaceAction.hpp 3 3 * 4 4 * Created on: Mar 29, 2012 … … 6 6 */ 7 7 8 #ifndef FILLS PHERICALSURFACEACTION_HPP9 #define FILLS PHERICALSURFACEACTION_HPP8 #ifndef FILLSURFACEACTION_HPP 9 #define FILLSURFACEACTION_HPP 10 10 11 11 // include config.h … … 17 17 #include "Actions/Action.hpp" 18 18 19 #include "FillS phericalSurfaceAction.def"19 #include "FillSurfaceAction.def" 20 20 #include "Action_impl_header.hpp" 21 21 22 #endif // FILLS PHERICALSURFACEACTION_HPP22 #endif // FILLSURFACEACTION_HPP
Note:
See TracChangeset
for help on using the changeset viewer.