/* * Filler.hpp * * Created on: Jan 16, 2012 * Author: heber */ #ifndef FILLER_HPP_ #define FILLER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "Cluster.hpp" #include "Predicates/FillPredicate.hpp" #include "Mesh/Mesh.hpp" #include "NodeTypes.hpp" class CopyAtomsInterface; class FillPredicate; class Inserter; class Mesh; /** This class operators on a set of nodes (Vector's), checks which fulfill some * given predicate, and fills these position with a given molecule lateron. * */ class Filler { public: /** Constructor for class Filler. * * \note We store inverted \a _predicate because we need it only for * remove_copy_if which works in this inverted way as desired. * * @param _mesh Mesh with a NodeSet that fills its Shape * @param _predicate predicate construct to check at each Node * @param _inserter inserter which places the cloned cluster */ Filler(const Mesh &_mesh, const FillPredicate &_predicate, const Inserter &_inserter); /** Destructor for class Filler. * */ ~Filler(); //!> typedef Vector of clusters as return type for operator() typedef std::vector ClusterVector_t; /** Fill in the desired Cluster at each remaining node. * * \note The cluster is non-const because it is moved to the first vacant node. * * @param copyMethod functor that knows how to copy atoms. * @param cluster set of atomic ids contained in a specific Shape to fill each Node with * @param ClonedClusters reference to vector of clusters, that is filled with created clones * @return true - all clusters inserted succesfully, else - insertion failed */ bool operator()(CopyAtomsInterface ©Method, ClusterInterface::Cluster_impl cluster, ClusterVector_t &ClonedClusters) const; private: //!> mesh is the set of points filling a Shape const Mesh mesh; //!> the predicate is evaluted whether a Node in the NodeSet of mesh is filled or not const FillPredicate predicate; //!> Inserter function to allow for some changes when placing the cluster at the node const Inserter &inserter; }; #endif /* FILLER_HPP_ */