void Hierarchy::show(std::ostream &out) const { if (*this == Hierarchy()) { out << "nullptr Molecular Hierarchy node"; return; } bool found=false; if (get_as_atom()) { found=true; out << get_as_atom(); } if (get_as_residue()){ found=true; out << get_as_residue(); } if (get_as_chain()) { found=true; out << get_as_chain(); } else if (get_as_molecule()) { found=true; out << get_as_molecule(); } if (get_as_fragment()) { found=true; out << get_as_fragment(); } if (get_as_domain()) { found=true; out << get_as_domain(); } if (core::RigidBody::particle_is_instance(get_particle())) { found=true; out << core::RigidBody(get_particle()); } if (core::RigidMember::particle_is_instance(get_particle())) { found=true; out << " rigid member: " << core::RigidMember(get_particle()) .get_rigid_body()->get_name(); } if (get_as_xyzr()) { found=true; out << " sphere: " << get_as_xyzr().get_sphere(); } else if (get_as_xyz()) { found=true; out << " coordinates: " << get_as_xyz().get_coordinates(); } if (!found) { out << "Hierarchy \"" << get_particle()->get_name() << "\""; } }
void Hierarchy::show(std::ostream &out, std::string delimiter) const { if (*this == Hierarchy()) { out << "nullptr Molecular Hierarchy node"; return; } out << "\"" << get_particle()->get_name() << "\"" << delimiter; if (get_as_atom()) { out << get_as_atom() << delimiter; } if (get_as_residue()) { out << get_as_residue() << delimiter; } if (get_as_chain()) { out << get_as_chain() << delimiter; } else if (get_as_molecule()) { out << get_as_molecule() << delimiter; } if (get_as_fragment()) { out << get_as_fragment() << delimiter; } if (get_as_domain()) { out << get_as_domain() << delimiter; } if (core::RigidBody::get_is_setup(get_particle())) { out << core::RigidBody(get_particle()); } if (core::RigidMember::get_is_setup(get_particle())) { out << " rigid member: " << core::RigidMember(get_particle()).get_rigid_body()->get_name(); } if (get_as_xyzr()) { out << get_as_xyzr().get_sphere(); } else if (get_as_xyz()) { out << get_as_xyz().get_coordinates(); } }