Changeset 94d0ad for molecuilder/src/atom.cpp
- Timestamp:
- Oct 27, 2009, 8:54:44 AM (16 years ago)
- Children:
- 8b6ee4
- Parents:
- 2e6aa1
- File:
-
- 1 edited
-
molecuilder/src/atom.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/atom.cpp
r2e6aa1 r94d0ad 43 43 sort = &nr; 44 44 node = &x; 45 } 45 }; 46 46 47 47 … … 83 83 * \param **res return value (only set if atom::father is equal to \a *ptr) 84 84 */ 85 void atom::EqualsFather ( atom *ptr, atom **res )85 void atom::EqualsFather ( const atom *ptr, const atom **res ) const 86 86 { 87 87 if ( ptr == father ) … … 94 94 * \return true - is inside, false - is not 95 95 */ 96 bool atom::IsInParallelepiped( Vector offset, double *parallelepiped)96 bool atom::IsInParallelepiped(const Vector offset, const double *parallelepiped) const 97 97 { 98 98 return (node->IsInParallelepiped(offset, parallelepiped)); … … 110 110 }; 111 111 112 /** Output of a single atom .112 /** Output of a single atom with given numbering. 113 113 * \param ElementNo cardinal number of the element 114 114 * \param AtomNo cardinal number among these atoms of the same element … … 117 117 * \return true - \a *out present, false - \a *out is NULL 118 118 */ 119 bool atom::Output (ofstream *out, int ElementNo,int AtomNo, const char *comment) const119 bool atom::OutputIndexed(ofstream *out, const int ElementNo, const int AtomNo, const char *comment) const 120 120 { 121 121 if (out != NULL) { … … 133 133 return false; 134 134 }; 135 bool atom::Output(ofstream *out, int *ElementNo, int *AtomNo, const char *comment) 135 136 /** Output of a single atom with numbering from array according to atom::type. 137 * \param *ElementNo cardinal number of the element 138 * \param *AtomNo cardinal number among these atoms of the same element 139 * \param *out stream to output to 140 * \param *comment commentary after '#' sign 141 * \return true - \a *out present, false - \a *out is NULL 142 */ 143 bool atom::OutputArrayIndexed(ofstream *out, const int *ElementNo, int *AtomNo, const char *comment) const 136 144 { 137 145 AtomNo[type->Z]++; // increment number … … 171 179 * \return true - \a *out present, false - \a *out is NULL 172 180 */ 173 bool atom::OutputTrajectory(ofstream *out, int *ElementNo, int *AtomNo,int step) const181 bool atom::OutputTrajectory(ofstream *out, const int *ElementNo, int *AtomNo, const int step) const 174 182 { 175 183 AtomNo[type->Z]++; … … 193 201 * \return true - \a *out present, false - \a *out is NULL 194 202 */ 195 bool atom::OutputTrajectoryXYZ(ofstream *out, int step) const203 bool atom::OutputTrajectoryXYZ(ofstream *out, const int step) const 196 204 { 197 205 if (out != NULL) { … … 210 218 * \param *AtomNo pointer to atom counter that is increased by one 211 219 */ 212 void atom::OutputMPQCLine(ofstream *out, Vector *center, int *AtomNo = NULL) const220 void atom::OutputMPQCLine(ofstream *out, const Vector *center, int *AtomNo = NULL) const 213 221 { 214 222 *out << "\t\t" << type->symbol << " [ " << x.x[0]-center->x[0] << "\t" << x.x[1]-center->x[1] << "\t" << x.x[2]-center->x[2] << " ]" << endl; … … 217 225 }; 218 226 219 ostream & operator << (ostream &ost, const ParticleInfo &a)220 {221 ost << "[" << a.Name << "|" << &a << "]";222 return ost;223 };224 225 ostream & ParticleInfo::operator << (ostream &ost)226 {227 ost << "[" << Name << "|" << this << "]";228 return ost;229 };230 231 227 /** Compares the indices of \a this atom with a given \a ptr. 232 228 * \param ptr atom to compare index against 233 229 * \return true - this one's is smaller, false - not 234 230 */ 235 bool atom::Compare(const atom &ptr) 231 bool atom::Compare(const atom &ptr) const 236 232 { 237 233 if (nr < ptr.nr) … … 245 241 * \return distance squared 246 242 */ 247 double atom::DistanceSquaredToVector( Vector &origin)243 double atom::DistanceSquaredToVector(const Vector &origin) const 248 244 { 249 245 return origin.DistanceSquared(&x); … … 254 250 * \return distance 255 251 */ 256 double atom::DistanceToVector( Vector &origin)252 double atom::DistanceToVector(const Vector &origin) const 257 253 { 258 254 return origin.Distance(&x);
Note:
See TracChangeset
for help on using the changeset viewer.
