| 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 | Info FunctionInfo(__func__);
|
|---|
| 41 | return (*InternalPointer);
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 | /** PointCloud implementation of GoToNext.
|
|---|
| 45 | * Uses atoms and STL stuff.
|
|---|
| 46 | */
|
|---|
| 47 | void molecule::GoToNext() const
|
|---|
| 48 | {
|
|---|
| 49 | Info FunctionInfo(__func__);
|
|---|
| 50 | if (InternalPointer != atoms.end())
|
|---|
| 51 | InternalPointer++;
|
|---|
| 52 | };
|
|---|
| 53 |
|
|---|
| 54 | /** PointCloud implementation of GoToFirst.
|
|---|
| 55 | * Uses atoms and STL stuff.
|
|---|
| 56 | */
|
|---|
| 57 | void molecule::GoToFirst() const
|
|---|
| 58 | {
|
|---|
| 59 | Info FunctionInfo(__func__);
|
|---|
| 60 | InternalPointer = atoms.begin();
|
|---|
| 61 | };
|
|---|
| 62 |
|
|---|
| 63 | /** PointCloud implementation of IsEmpty.
|
|---|
| 64 | * Uses atoms and STL stuff.
|
|---|
| 65 | */
|
|---|
| 66 | bool molecule::IsEmpty() const
|
|---|
| 67 | {
|
|---|
| 68 | Info FunctionInfo(__func__);
|
|---|
| 69 | return (empty());
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | /** PointCloud implementation of IsLast.
|
|---|
| 73 | * Uses atoms and STL stuff.
|
|---|
| 74 | */
|
|---|
| 75 | bool molecule::IsEnd() const
|
|---|
| 76 | {
|
|---|
| 77 | Info FunctionInfo(__func__);
|
|---|
| 78 | return (InternalPointer == atoms.end());
|
|---|
| 79 | };
|
|---|