source: src/Filling/ClusterInterface.hpp@ 4464ef

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 4464ef was 35ec9c, checked in by Frederik Heber <heber@…>, 12 years ago

Added output operator to ClusterInterface.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 * ClusterInterface.hpp
3 *
4 * Created on: Jan 20, 2012
5 * Author: heber
6 */
7
8#ifndef CLUSTERINTERFACE_HPP_
9#define CLUSTERINTERFACE_HPP_
10
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include <boost/shared_ptr.hpp>
18#include <set>
19
20#include "AtomIdSet.hpp"
21#include "types.hpp"
22
23class atom;
24class CopyAtomsInterface;
25class RealSpaceMatrix;
26class Shape;
27class Vector;
28
29/** This is the interface class for clusters.
30 *
31 * Clusters are containers for \refAtomIdSet that make sure that within a given
32 * shape each of the atoms in the \ref AtomIdSet is contained and none else.
33 *
34 * We need this ClusterInterface to allow for ClusterInterface::clone() to not
35 * return a pointer but a boost::shared_ptr which is much cleaner in terms of
36 * memory management.
37 *
38 */
39class ClusterInterface
40{
41public:
42 //!> typedef for pointer to ClusterInterface-compatible instances
43 typedef boost::shared_ptr<ClusterInterface> Cluster_impl;
44 typedef AtomIdSet::atomIdSet atomIdSet;
45
46 virtual ~ClusterInterface() {}
47
48 /** Getter for the set of atomic ids associated to the cluster.
49 *
50 * @return set of atomic ids
51 */
52 virtual const atomIdSet & getAtomIds() const=0;
53
54 /** Getter for the set of atoms associated to the cluster.
55 *
56 * @return set of atoms
57 */
58 AtomIdSet getAtoms() const
59 {
60 return AtomIdSet(getAtomIds());
61 }
62
63 /** Getter for the cluster's Shape.
64 *
65 * @return Shape \a s
66 */
67 virtual const Shape& getShape() const=0;
68
69 /** Clones this cluster.
70 *
71 * We copy the shape and we copy all contained atoms in such a way as
72 * functor \a copyMethod does. We also translate atoms by \a offset
73 * eventually.
74 *
75 * @param copyMethod functor that knows how to copy the atoms
76 * @param offset translational offset for contained atoms
77 * @return reference to the clone cluster
78 */
79 virtual Cluster_impl clone(CopyAtomsInterface& copyMethod, const Vector &offset) const =0;
80
81 /** Move a cluster.
82 *
83 * This moves both all contained atoms associated to the cluster and the
84 * shape itself
85 *
86 * @param offset translation vector
87 */
88 virtual void translate(const Vector &offset)=0;
89
90 /** Transforms a cluster.
91 *
92 * This transforms both all contained atoms associated to the cluster and the
93 * shape itself with respect to their spatial positions.
94 *
95 * @param M transformation matrix
96 */
97 virtual void transform(const RealSpaceMatrix &M)=0;
98
99 /** Check whether the given atom is inside the Cluster's shape.
100 *
101 * @param id atom id to check
102 * @return true - is inside cluster's shape, false - else
103 */
104 virtual bool isInside(const atomId_t id) const = 0;
105};
106
107/** Output operator for the atoms contained in \a cluster.
108 *
109 * @param out output stream to print to
110 * @param cluster cluster to print
111 * @return \a out for concatenation
112 */
113std::ostream &operator<<(std::ostream &out, const ClusterInterface& cluster);
114
115#endif /* CLUSTERINTERFACE_HPP_ */
Note: See TracBrowser for help on using the repository browser.