--- trunk/FAS/src/fasresidue.cpp 2002/08/14 16:03:32 71 +++ trunk/FAS/src/fasresidue.cpp 2002/08/19 20:49:08 88 @@ -23,26 +23,65 @@ #include "fasbond.h" #include "bitvector.h" +//constuctor/destructor TFASResidue::TFASResidue() { + Clear(); +} +TFASResidue::TFASResidue(const unsigned int index) +{ + Clear(); + + _index = index; } -TFASResidue::TFASResidue(int index, int resid) +TFASResidue::TFASResidue(const TFASResidue &residue) { + _index = residue._index; + _resid = residue._resid; + _model = residue._model; + _mol = residue._mol; + _atomList = residue._atomList; } TFASResidue::~TFASResidue() { - + Clear(); } void TFASResidue::Clear() { + vector::iterator i; + TFASAtom *atom; + for (atom=BeginAtom(i); atom!=NULL;atom=NextAtom(i)) + { + atom->SetResidue(NULL); + } + _index = -1; + _resid = -1; + _mol = NULL; + _model = NULL; + _atomList.clear(); } +//overload operator = +TFASResidue &TFASResidue::operator =(const TFASResidue &residue) +{ + if (this != &residue) + { + _index = residue._index; + _resid = residue._resid; + _model = residue._model; + _mol = residue._mol; + _atomList = residue._atomList; + } + + return *this; +} +//method to traverse atoms TFASAtom *TFASResidue::BeginAtom(vector::iterator &i) { i = _atomList.begin(); @@ -114,7 +153,7 @@ vector TFASResidue::GetBonds(bool exterior { if (!exterior) { - if ((bond->GetNbrAtom(atom))->GetResidue == this) + if ((bond->GetNbrAtom(atom))->GetResidue() == this) { bondList.push_back(bond); }