| 1 | /* | 
|---|
| 2 | * molecule_pointcloud.cpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Oct 5, 2009 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #include "atom.hpp" | 
|---|
| 9 | #include "config.hpp" | 
|---|
| 10 | #include "info.hpp" | 
|---|
| 11 | #include "memoryallocator.hpp" | 
|---|
| 12 | #include "molecule.hpp" | 
|---|
| 13 |  | 
|---|
| 14 | /************************************* Functions for class molecule *********************************/ | 
|---|
| 15 |  | 
|---|
| 16 | /** Returns a name for this point cloud, here the molecule's name. | 
|---|
| 17 | * \return name of point cloud | 
|---|
| 18 | */ | 
|---|
| 19 | const char * const molecule::GetName() const | 
|---|
| 20 | { | 
|---|
| 21 | return name; | 
|---|
| 22 | }; | 
|---|
| 23 |  | 
|---|
| 24 | /** Determine center of all atoms. | 
|---|
| 25 | * \param *out output stream for debugging | 
|---|
| 26 | * \return pointer to allocated with central coordinates | 
|---|
| 27 | */ | 
|---|
| 28 | Vector *molecule::GetCenter() const | 
|---|
| 29 | { | 
|---|
| 30 | Vector *center = DetermineCenterOfAll(); | 
|---|
| 31 | return center; | 
|---|
| 32 | }; | 
|---|
| 33 |  | 
|---|
| 34 |  | 
|---|
| 35 | /** PointCloud implementation of GoPoint | 
|---|
| 36 | * Uses atoms and STL stuff. | 
|---|
| 37 | */ | 
|---|
| 38 | TesselPoint* molecule::GetPoint() const | 
|---|
| 39 | { | 
|---|
| 40 | return (*InternalPointer); | 
|---|
| 41 | }; | 
|---|
| 42 |  | 
|---|
| 43 | /** PointCloud implementation of GoToNext. | 
|---|
| 44 | * Uses atoms and STL stuff. | 
|---|
| 45 | */ | 
|---|
| 46 | void molecule::GoToNext() const | 
|---|
| 47 | { | 
|---|
| 48 | if (InternalPointer != atoms.end()) | 
|---|
| 49 | InternalPointer++; | 
|---|
| 50 | }; | 
|---|
| 51 |  | 
|---|
| 52 | /** PointCloud implementation of GoToFirst. | 
|---|
| 53 | * Uses atoms and STL stuff. | 
|---|
| 54 | */ | 
|---|
| 55 | void molecule::GoToFirst() const | 
|---|
| 56 | { | 
|---|
| 57 | InternalPointer = atoms.begin(); | 
|---|
| 58 | }; | 
|---|
| 59 |  | 
|---|
| 60 | /** PointCloud implementation of IsEmpty. | 
|---|
| 61 | * Uses atoms and STL stuff. | 
|---|
| 62 | */ | 
|---|
| 63 | bool molecule::IsEmpty() const | 
|---|
| 64 | { | 
|---|
| 65 | return (empty()); | 
|---|
| 66 | }; | 
|---|
| 67 |  | 
|---|
| 68 | /** PointCloud implementation of IsLast. | 
|---|
| 69 | * Uses atoms and STL stuff. | 
|---|
| 70 | */ | 
|---|
| 71 | bool molecule::IsEnd() const | 
|---|
| 72 | { | 
|---|
| 73 | return (InternalPointer == atoms.end()); | 
|---|
| 74 | }; | 
|---|
| 75 |  | 
|---|
| 76 | int molecule::GetMaxId() const { | 
|---|
| 77 | return getAtomCount(); | 
|---|
| 78 | } | 
|---|