Changes in src/molecule.hpp [e39e7a:5be798]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.hpp
re39e7a r5be798 22 22 23 23 #include <string> 24 25 #include <boost/bimap/bimap.hpp>26 #include <boost/bimap/unordered_set_of.hpp>27 #include <boost/bimap/multiset_of.hpp>28 #include <boost/optional.hpp>29 #include <boost/shared_ptr.hpp>30 24 31 25 #include "AtomIdSet.hpp" … … 121 115 MoleculeNameChanged, 122 116 IndexChanged, 123 BoundingBoxChanged,124 117 AboutToBeRemoved, 125 118 NotificationType_MAX … … 245 238 bool changeAtomNr(int oldNr, int newNr, atom* target=0); 246 239 247 friend bool atom::changeId(atomId_t newId);248 /**249 * used when changing an ParticleInfo::Id.250 * Note that this number is global (and the molecule uses it to know which atoms belong to it)251 *252 * @param oldId old Id253 * @param newId new Id to set254 * @return indicates wether the change could be done or not.255 */256 bool changeAtomId(int oldId, int newId);257 258 240 /** Updates the internal lookup fro local to global indices. 259 241 * … … 278 260 279 261 public: 280 281 /** Structure for the required information on the bounding box.282 *283 */284 struct BoundingBoxInfo {285 //!> position of center286 Vector position;287 //!> radius of sphere288 double radius;289 290 /** Equivalence operator for bounding box.291 *292 * \return true - both bounding boxes have same position and radius293 */294 bool operator==(const BoundingBoxInfo &_other) const295 { return (radius == _other.radius) && (position == _other.position); }296 297 /** Inequivalence operator for bounding box.298 *299 * \return true - bounding boxes have either different positions or different radii or both300 */301 bool operator!=(const BoundingBoxInfo &_other) const302 { return !(*this == _other); }303 };304 305 private:306 307 /** Returns the current bounding box.308 *309 * \return Shape with center and extension of box310 */311 BoundingBoxInfo updateBoundingBox() const;312 313 // stuff for keeping bounding box up-to-date efficiently314 315 //!> Cacheable for the bounding box, ptr such that316 boost::shared_ptr< Cacheable<BoundingBoxInfo> > BoundingBox;317 /** Bimap storing atomic ids and the component per axis.318 *319 * We need a bimap in order to have the components sorted and be able to320 * access max and min values in linear time and also access the ids in321 * constant time in order to update the map, when atoms move, are inserted,322 * or removed.323 */324 typedef boost::bimaps::bimap<325 boost::bimaps::unordered_set_of< atomId_t >,326 boost::bimaps::multiset_of< double, std::greater<double> >327 > AtomDistanceMap_t;328 std::vector<AtomDistanceMap_t> BoundingBoxSweepingAxis;329 330 public:331 332 /** Returns the current bounding box of this molecule.333 *334 * \return bounding box info with center and radius335 */336 BoundingBoxInfo getBoundingBox() const;337 262 338 263 /** Function to create a bounding spherical shape for the currently associated atoms.
Note:
See TracChangeset
for help on using the changeset viewer.