00001 /** 00002 * \file example/ExampleSingletonModifier.h 00003 * \brief A singleton modifier which wraps an attribute into a 00004 * given range. 00005 * 00006 * Copyright 2007-8 IMP Inventors. All rights reserved. 00007 */ 00008 00009 #ifndef IMPEXAMPLE_EXAMPLE_SINGLETON_MODIFIER_H 00010 #define IMPEXAMPLE_EXAMPLE_SINGLETON_MODIFIER_H 00011 00012 #include "example_config.h" 00013 #include <IMP/SingletonModifier.h> 00014 #include <IMP/algebra/BoundingBoxD.h> 00015 00016 IMPEXAMPLE_BEGIN_NAMESPACE 00017 00018 //! An example singleton modifer 00019 /** A simple singleton modifier which restrains the x,y,z 00020 coordinates to a box by wrapping them. 00021 00022 Such a class could be coupled with an IMP::core::SingletonRestraint 00023 or IMP::core::SingletonsRestraint to keep a set of particles 00024 in a box. 00025 00026 \htmlinclude range_restriction.py.html 00027 00028 The source code is as follows: 00029 \include ExampleRestraint.h 00030 \include ExampleRestraint.cpp 00031 */ 00032 class IMPEXAMPLEEXPORT ExampleSingletonModifier: public SingletonModifier 00033 { 00034 algebra::BoundingBoxD<3> bb_; 00035 public: 00036 ExampleSingletonModifier(const algebra::BoundingBoxD<3> &bb); 00037 00038 // note, Doxygen wants a semicolon at the end of macro lines 00039 IMP_SINGLETON_MODIFIER(ExampleSingletonModifier); 00040 }; 00041 00042 00043 IMPEXAMPLE_END_NAMESPACE 00044 00045 #endif /* IMPEXAMPLE_EXAMPLE_SINGLETON_MODIFIER_H */