Ignore:
Timestamp:
Nov 15, 2012, 5:31:07 PM (13 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

FillSphericalSurfaceAction > FillSurfaceAction (using shape factory)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/Actions/FillAction/FillSurfaceAction.cpp

    r98d03b r09eaac  
    2222
    2323/*
    24  * FillSphericalSurfaceAction.cpp
     24 * FillSurfaceAction.cpp
    2525 *
    2626 *  Created on: Mar 29, 2012
     
    4848#include "molecule.hpp"
    4949#include "Shapes/BaseShapes.hpp"
     50#include "Shapes/ShapeFactory.hpp"
    5051#include "World.hpp"
    5152
     
    5859#include <vector>
    5960
    60 #include "Actions/FillAction/FillSphericalSurfaceAction.hpp"
     61#include "Actions/FillAction/FillSurfaceAction.hpp"
    6162
    6263using namespace MoleCuilder;
    6364
    6465// and construct the stuff
    65 #include "FillSphericalSurfaceAction.def"
     66#include "FillSurfaceAction.def"
    6667#include "Action_impl_pre.hpp"
    6768/** =========== define the function ====================== */
    68 Action::state_ptr FillSphericalSurfaceAction::performCall() {
     69Action::state_ptr FillSurfaceAction::performCall() {
    6970  // get the filler molecule
    7071  const std::vector< molecule *> molecules = World::getInstance().getSelectedMolecules();
     
    99100
    100101  // create predicate, mesh, and filler
    101   FillSphericalSurfaceState *UndoState = NULL;
     102  FillSurfaceState *UndoState = NULL;
    102103  bool successflag = false;
    103104  {
     
    107108            )
    108109        );
    109     Shape s = Sphere(params.center.get(), params.radius.get());
     110
     111    Shape s = ShapeFactory::getInstance().produce();
     112
    110113    boost::function<const NodeSet ()> func =
    111114        boost::bind(&Shape::getHomogeneousPointsOnSurface, boost::ref(s), params.N.get());
     
    150153        std::transform(filler->begin(), filler->end(), MovedToVector.begin(),
    151154            boost::bind(&AtomInfo::getPosition, _1) );
    152         UndoState = new FillSphericalSurfaceState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params);
     155        UndoState = new FillSurfaceState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params);
    153156      }
    154157    }
     
    166169}
    167170
    168 Action::state_ptr FillSphericalSurfaceAction::performUndo(Action::state_ptr _state) {
    169   FillSphericalSurfaceState *state = assert_cast<FillSphericalSurfaceState*>(_state.get());
     171Action::state_ptr FillSurfaceAction::performUndo(Action::state_ptr _state) {
     172  FillSurfaceState *state = assert_cast<FillSurfaceState*>(_state.get());
    170173
    171174  // remove all created atoms
     
    177180}
    178181
    179 Action::state_ptr FillSphericalSurfaceAction::performRedo(Action::state_ptr _state){
    180   FillSphericalSurfaceState *state = assert_cast<FillSphericalSurfaceState*>(_state.get());
     182Action::state_ptr FillSurfaceAction::performRedo(Action::state_ptr _state){
     183  FillSurfaceState *state = assert_cast<FillSurfaceState*>(_state.get());
    181184
    182185  // place filler cluster again at new spot
     
    194197}
    195198
    196 bool FillSphericalSurfaceAction::canUndo() {
     199bool FillSurfaceAction::canUndo() {
    197200  return true;
    198201}
    199202
    200 bool FillSphericalSurfaceAction::shouldUndo() {
     203bool FillSurfaceAction::shouldUndo() {
    201204  return true;
    202205}
Note: See TracChangeset for help on using the changeset viewer.