Changeset e08f45 for molecuilder/src/atom.cpp
- Timestamp:
- Feb 9, 2009, 5:24:10 PM (17 years ago)
- Children:
- 451d7a
- Parents:
- 4aef8a
- git-author:
- Frederik Heber <heber@…> (02/09/09 15:55:37)
- git-committer:
- Frederik Heber <heber@…> (02/09/09 17:24:10)
- File:
-
- 1 edited
-
molecuilder/src/atom.cpp (modified) (6 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/atom.cpp
-
Property mode
changed from
100644to100755
r4aef8a re08f45 14 14 { 15 15 Name = NULL; 16 previous = NULL;17 next = NULL;18 father = this;// generally, father is itself19 Ancestor = NULL;20 type = NULL;21 sort = NULL;22 FixedIon = 0;23 nr = -1;24 GraphNr = -1;25 ComponentNr = NULL;26 IsCyclic = false;27 SeparationVertex = false;28 LowpointNr = -1;29 AdaptiveOrder = 0;30 MaxOrder = false;16 previous = NULL; 17 next = NULL; 18 father = this; // generally, father is itself 19 Ancestor = NULL; 20 type = NULL; 21 sort = NULL; 22 FixedIon = 0; 23 nr = -1; 24 GraphNr = -1; 25 ComponentNr = NULL; 26 IsCyclic = false; 27 SeparationVertex = false; 28 LowpointNr = -1; 29 AdaptiveOrder = 0; 30 MaxOrder = false; 31 31 }; 32 32 … … 36 36 { 37 37 Free((void **)&Name, "atom::~atom: *Name"); 38 Free((void **)&ComponentNr, "atom::~atom: *ComponentNr");38 Free((void **)&ComponentNr, "atom::~atom: *ComponentNr"); 39 39 }; 40 40 … … 45 45 atom *atom::GetTrueFather() 46 46 { 47 atom *walker = this;48 do {49 if (walker == walker->father) // top most father is the one that points on itself50 break;51 walker = walker->father;52 } while (walker != NULL);53 return walker;47 atom *walker = this; 48 do { 49 if (walker == walker->father) // top most father is the one that points on itself 50 break; 51 walker = walker->father; 52 } while (walker != NULL); 53 return walker; 54 54 }; 55 55 … … 61 61 bool atom::Output(int ElementNo, int AtomNo, ofstream *out) const 62 62 { 63 if (out != NULL) {64 *out << "Ion_Type" << ElementNo << "_" << AtomNo << "\t"<< fixed << setprecision(9) << showpoint;65 *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2];66 *out << "\t" << FixedIon;67 if (v.Norm() > MYEPSILON)68 *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 return true;71 } else72 return false;63 if (out != NULL) { 64 *out << "Ion_Type" << ElementNo << "_" << AtomNo << "\t" << fixed << setprecision(9) << showpoint; 65 *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2]; 66 *out << "\t" << FixedIon; 67 if (v.Norm() > MYEPSILON) 68 *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 return true; 71 } else 72 return false; 73 73 }; 74 74 … … 78 78 bool atom::OutputXYZLine(ofstream *out) const 79 79 { 80 if (out != NULL) {81 *out << type->symbol << "\t" << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2] << "\t" << endl;82 return true;83 } else84 return false;80 if (out != NULL) { 81 *out << type->symbol << "\t" << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2] << "\t" << endl; 82 return true; 83 } else 84 return false; 85 85 }; 86 86 87 87 ostream & operator << (ostream &ost, atom &a) 88 88 { 89 ost << "[" << a.Name << "|" << &a << "]";90 return ost;89 ost << "[" << a.Name << "|" << &a << "]"; 90 return ost; 91 91 }; 92 92 … … 97 97 bool atom::Compare(atom &ptr) 98 98 { 99 if (nr < ptr.nr)100 return true;101 else102 return false;99 if (nr < ptr.nr) 100 return true; 101 else 102 return false; 103 103 }; 104 104 105 105 bool operator < (atom &a, atom &b) 106 106 { 107 return a.Compare(b);107 return a.Compare(b); 108 108 }; 109 109 -
Property mode
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
