Changeset f4a346 for molecuilder/src/molecules.cpp
- Timestamp:
- Aug 3, 2009, 8:21:05 PM (16 years ago)
- 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. - File:
-
- 1 edited
-
molecuilder/src/molecules.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.cpp
r0e2190 rf4a346 5 5 */ 6 6 7 #include "config.hpp" 7 8 #include "molecules.hpp" 8 9 … … 42 43 end->father = NULL; 43 44 link(start,end); 45 InternalPointer = start; 44 46 // init bond chain list 45 47 first = new bond(start, end, 1, -1); … … 82 84 delete(end); 83 85 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 */ 93 Vector *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 */ 102 TesselPoint *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 */ 113 TesselPoint *molecule::GetTerminalPoint() 114 { 115 return end; 116 }; 117 118 /** Go to next atom. 119 * Stops at last one. 120 */ 121 void 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 */ 130 void molecule::GoToPrevious() 131 { 132 if (InternalPointer->previous != start) 133 InternalPointer = InternalPointer->previous; 134 }; 135 136 /** Goes to first atom. 137 */ 138 void molecule::GoToFirst() 139 { 140 InternalPointer = start->next; 141 }; 142 143 /** Goes to last atom. 144 */ 145 void 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 */ 153 bool 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 */ 161 bool molecule::IsLast() 162 { 163 return (InternalPointer->next == end); 84 164 }; 85 165
Note:
See TracChangeset
for help on using the changeset viewer.
