Ignore:
Timestamp:
Nov 15, 2012, 5:31:07 PM (12 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, 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)

Location:
src/Actions/FillAction
Files:
3 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}
  • src/Actions/FillAction/FillSurfaceAction.def

    r98d03b r09eaac  
    11/*
    2  * FillRegularGridAction.def
     2 * FillSurfaceAction.def
    33 *
    44 *  Created on: Mar 29, 2012
     
    2020// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    2121// "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 ("center")("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)
    2727#define paramvalids \
    28 (BoxVectorValidator()) \
    29 (BoxLengthValidator()) \
    3028(DummyValidator< unsigned int >()) \
    3129(BoxLengthValidator()) \
     
    3937#define MENUNAME "fill"
    4038#define MENUPOSITION 1
    41 #define ACTIONNAME SphericalSurface
    42 #define TOKEN "fill-spherical-surface"
     39#define ACTIONNAME Surface
     40#define TOKEN "fill-surface"
    4341
    4442
    4543// finally the information stored in the ActionTrait specialization
    4644#define DESCRIPTION "\
    47 fill homogenous points on a sphere surface with instances of the selected molecule."
     45fill homogenous points on a shape's surface with instances of the selected molecule."
    4846#undef SHORTFORM
  • src/Actions/FillAction/FillSurfaceAction.hpp

    r98d03b r09eaac  
    11/*
    2  * FillSphericalSurfaceAction.hpp
     2 * FillSurfaceAction.hpp
    33 *
    44 *  Created on: Mar 29, 2012
     
    66 */
    77
    8 #ifndef FILLSPHERICALSURFACEACTION_HPP
    9 #define FILLSPHERICALSURFACEACTION_HPP
     8#ifndef FILLSURFACEACTION_HPP
     9#define FILLSURFACEACTION_HPP
    1010
    1111// include config.h
     
    1717#include "Actions/Action.hpp"
    1818
    19 #include "FillSphericalSurfaceAction.def"
     19#include "FillSurfaceAction.def"
    2020#include "Action_impl_header.hpp"
    2121
    22 #endif // FILLSPHERICALSURFACEACTION_HPP
     22#endif // FILLSURFACEACTION_HPP
Note: See TracChangeset for help on using the changeset viewer.