Ignore:
Timestamp:
Aug 3, 2009, 8:21:05 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
04dcc0
Parents:
0e2190 (diff), eb167d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'TesselationRefactoring' into ConcaveHull

Conflicts:

molecuilder/src/boundary.cpp
molecuilder/src/boundary.hpp
molecuilder/src/linkedcell.cpp
molecuilder/src/linkedcell.hpp
molecuilder/src/molecules.hpp

All of Saskia Metzler's new function were transfered from boundary.cpp to tesselation.cpp and the changes due to TesselPoint, LinkedCell and so on incorporated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.cpp

    r0e2190 rf4a346  
    55 */
    66
     7#include "config.hpp"
    78#include "molecules.hpp"
    89
     
    4243  end->father = NULL;
    4344  link(start,end);
     45  InternalPointer = start;
    4446  // init bond chain list
    4547  first = new bond(start, end, 1, -1);
     
    8284  delete(end);
    8385  delete(start);
     86};
     87
     88
     89/** Determine center of all atoms.
     90 * \param *out output stream for debugging
     91 * \return pointer to allocated with central coordinates
     92 */
     93Vector *molecule::GetCenter(ofstream *out)
     94{
     95  Vector *center = DetermineCenterOfAll(out);
     96  return center;
     97};
     98
     99/** Return current atom in the list.
     100 * \return pointer to atom or NULL if none present
     101 */
     102TesselPoint *molecule::GetPoint()
     103{
     104  if ((InternalPointer != start) && (InternalPointer != end))
     105    return InternalPointer;
     106  else
     107    return NULL;
     108};
     109
     110/** Return pointer to one after last atom in the list.
     111 * \return pointer to end marker
     112 */
     113TesselPoint *molecule::GetTerminalPoint()
     114{
     115  return end;
     116};
     117
     118/** Go to next atom.
     119 * Stops at last one.
     120 */
     121void molecule::GoToNext()
     122{
     123  if (InternalPointer->next != end)
     124    InternalPointer = InternalPointer->next;
     125};
     126
     127/** Go to previous atom.
     128 * Stops at first one.
     129 */
     130void molecule::GoToPrevious()
     131{
     132  if (InternalPointer->previous != start)
     133    InternalPointer = InternalPointer->previous;
     134};
     135
     136/** Goes to first atom.
     137 */
     138void molecule::GoToFirst()
     139{
     140  InternalPointer = start->next;
     141};
     142
     143/** Goes to last atom.
     144 */
     145void molecule::GoToLast()
     146{
     147  InternalPointer = end->previous;
     148};
     149
     150/** Checks whether we have any atoms in molecule.
     151 * \return true - no atoms, false - not empty
     152 */
     153bool molecule::IsEmpty()
     154{
     155  return (start->next == end);
     156};
     157
     158/** Checks whether we are at the last atom
     159 * \return true - current atom is last one, false - is not last one
     160 */
     161bool molecule::IsLast()
     162{
     163  return (InternalPointer->next == end);
    84164};
    85165
Note: See TracChangeset for help on using the changeset viewer.