From 1e7190cfd05a160835466c4877a1a0ef339ef34e Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 16 Nov 2024 10:29:45 -0500 Subject: [PATCH] Fix residue not initializing id in default ctor Ran clang-format again Signed-off-by: Geoff Hutchison --- avogadro/core/residue.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/avogadro/core/residue.cpp b/avogadro/core/residue.cpp index 7989c75e17..3b71e40624 100644 --- a/avogadro/core/residue.cpp +++ b/avogadro/core/residue.cpp @@ -3,32 +3,40 @@ This source code is released under the 3-Clause BSD License, (see "LICENSE"). ******************************************************************************/ -#include "molecule.h" #include "residue.h" +#include "molecule.h" #include "residuecolors.h" #include "residuedata.h" namespace Avogadro::Core { Residue::Residue(std::string& name) - : m_residueName(name), m_chainId('A'), m_heterogen(false), m_color(0,0,0), m_customColorSet(false), m_secondaryStructure(undefined) -{} + : m_residueName(name), m_residueId(0), m_chainId('A'), m_heterogen(false), + m_color(0, 0, 0), m_customColorSet(false), m_secondaryStructure(undefined) +{ +} Residue::Residue(std::string& name, Index& number) - : m_residueName(name), m_residueId(number), m_chainId('A'), m_heterogen(false), m_color(0,0,0), m_customColorSet(false), m_secondaryStructure(undefined) -{} + : m_residueName(name), m_residueId(number), m_chainId('A'), + m_heterogen(false), m_color(0, 0, 0), m_customColorSet(false), + m_secondaryStructure(undefined) +{ +} Residue::Residue(std::string& name, Index& number, char& id) - : m_residueName(name), m_residueId(number), m_chainId(id), m_heterogen(false), m_color(0,0,0), m_customColorSet(false), m_secondaryStructure(undefined) -{} + : m_residueName(name), m_residueId(number), m_chainId(id), m_heterogen(false), + m_color(0, 0, 0), m_customColorSet(false), m_secondaryStructure(undefined) +{ +} Residue::Residue(const Residue& other) : m_residueName(other.m_residueName), m_residueId(other.m_residueId), m_chainId(other.m_chainId), m_atomNameMap(other.m_atomNameMap), - m_heterogen(other.m_heterogen), m_color(other.m_color), + m_heterogen(other.m_heterogen), m_color(other.m_color), m_customColorSet(other.m_customColorSet), m_secondaryStructure(other.m_secondaryStructure) -{} +{ +} Residue& Residue::operator=(Residue other) { @@ -51,7 +59,7 @@ void Residue::addResidueAtom(const std::string& name, const Atom& atom) std::vector Residue::residueAtoms() const { std::vector res; - for (const auto & it : m_atomNameMap) { + for (const auto& it : m_atomNameMap) { res.push_back(it.second); } return res; @@ -70,7 +78,7 @@ Atom Residue::getAtomByName(std::string name) const std::string Residue::getAtomName(const Atom atom) const { - for (const auto & it : m_atomNameMap) { + for (const auto& it : m_atomNameMap) { if (it.second == atom) { return it.first; } @@ -80,7 +88,7 @@ std::string Residue::getAtomName(const Atom atom) const std::string Residue::getAtomName(const Index index) const { - for (const auto & it : m_atomNameMap) { + for (const auto& it : m_atomNameMap) { if (it.second.index() == index) { return it.first; }