Changeset c830e8e for molecuilder/src/atom.cpp
- Timestamp:
- Apr 2, 2009, 4:12:54 PM (16 years ago)
- Children:
- 3021d93
- Parents:
- 451d7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/atom.cpp
r451d7a rc830e8e 1 1 /** \file atom.cpp 2 * 2 * 3 3 * Function implementations for the class atom. 4 * 4 * 5 5 */ 6 6 7 7 #include "molecules.hpp" 8 8 9 9 /************************************* Functions for class atom *************************************/ 10 10 11 11 /** Constructor of class atom. 12 12 */ 13 atom::atom() 13 atom::atom() 14 14 { 15 15 Name = NULL; … … 33 33 /** Destructor of class atom. 34 34 */ 35 atom::~atom() 35 atom::~atom() 36 36 { 37 37 Free((void **)&Name, "atom::~atom: *Name"); … … 58 58 * \param AtomNo cardinal number among these atoms of the same element 59 59 * \param *out stream to output to 60 * \param *comment commentary after '#' sign 60 61 */ 61 bool atom::Output(int ElementNo, int AtomNo, ofstream *out ) const62 bool atom::Output(int ElementNo, int AtomNo, ofstream *out, const char *comment) const 62 63 { 63 64 if (out != NULL) { … … 67 68 if (v.Norm() > MYEPSILON) 68 69 *out << "\t" << scientific << setprecision(6) << v.x[0] << "\t" << v.x[1] << "\t" << v.x[2] << "\t"; 69 *out << " # Number in molecule " << nr << endl; 70 if (comment != NULL) 71 *out << " # " << comment << endl; 72 else 73 *out << " # molecule nr " << nr << endl; 70 74 return true; 71 75 } else … … 85 89 }; 86 90 87 ostream & operator << (ostream &ost, atom &a) 91 ostream & operator << (ostream &ost, atom &a) 88 92 { 89 93 ost << "[" << a.Name << "|" << &a << "]"; … … 94 98 * \param ptr atom to compare index against 95 99 * \return true - this one's is smaller, false - not 96 */ 100 */ 97 101 bool atom::Compare(atom &ptr) 98 102 { … … 103 107 }; 104 108 105 bool operator < (atom &a, atom &b) 109 bool operator < (atom &a, atom &b) 106 110 { 107 111 return a.Compare(b);
Note:
See TracChangeset
for help on using the changeset viewer.