00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <ostream>
00022
00023 template <typename AtomType>
00024 typename BTK::Molecule<AtomType>::self_type&
00025 BTK::Molecule<AtomType>::
00026 operator=(const self_type& rhs){
00027 if (&rhs == this) return *this;
00028 base_type::operator=(rhs);
00029 _chain_id = rhs._chain_id;
00030 _name = rhs._name;
00031 return *this;
00032 }
00033
00034 template <typename AtomType>
00035 template <typename T2>
00036 typename BTK::Molecule<AtomType>::self_type&
00037 BTK::Molecule<AtomType>::
00038 operator=(const Molecule<T2>& rhs){
00039 base_type::operator=(rhs);
00040 _chain_id = rhs.chain_id();
00041 _name = rhs.name();
00042 return *this;
00043 }
00044
00045 template <typename AtomType>
00046 std::ostream& operator<<(std::ostream& os,
00047 const BTK::Molecule<AtomType>& m){
00048 unsigned atom = 1;
00049 typedef typename BTK::Molecule<AtomType>::const_atom_iterator citer;
00050 citer i=m.atom_begin(),i_end=m.atom_end();
00051 for (;i!=i_end;++i) {
00052 i->print_pdb_line(atom++,m.chain_id(),os);
00053 }
00054 os << "TER\n";
00055
00056 return os;
00057 }
00058