/**
 * \file core/spoms/complementarypeak.h
 * \date 11/02/2026
 * \author Aurélien Berthier, BENOIST Emile, TESSIER Dominique
 * \brief handle processed spectrum
 */


/*
 * PeptidOMS, Spectra to protein alignment tool
 * Copyright (C) 2026  Olivier Langella
 * <olivier.langella@cnrs.fr>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "complementarypeak.h"
#include <QDebug>
namespace pappso
{
namespace spoms
{

bool
operator<(ComplementaryPeak const &lhs, ComplementaryPeak const &rhs)
{
  return lhs.mass < rhs.mass;
}

ComplementaryPeak::ComplementaryPeak()
{
}


ComplementaryPeak::ComplementaryPeak(double mass_in,
                                     bool is_double_in,
                                     int native_peak_in)
{
  mass        = mass_in;
  is_double   = is_double_in;
  native_peak = native_peak_in;
}


ComplementaryPeak::ComplementaryPeak(const ComplementaryPeak &other)
{
  mass        = other.mass;
  is_double   = other.is_double;
  native_peak = other.native_peak;
}
ComplementaryPeak &
ComplementaryPeak::operator=(const ComplementaryPeak &other)
{
  mass        = other.mass;
  is_double   = other.is_double;
  native_peak = other.native_peak;
  return *this;
}

ComplementaryPeak::~ComplementaryPeak()
{
}

void
ComplementaryPeak::overwrite(double mass_in,
                             bool is_double_in,
                             int native_peak_in)
{
  // qDebug();
  mass        = mass_in;
  is_double   = is_double_in;
  native_peak = native_peak_in;
  // qDebug();
}

double
ComplementaryPeak::get_mass() const
{
  return mass;
}

bool
ComplementaryPeak::isDouble() const
{
  return is_double;
}


int
ComplementaryPeak::getNativePeak() const
{
  return native_peak;
}


QString
ComplementaryPeak::toString() const
{
  // return
  return QString::number(mass, 'f', 6);
  // return SpomsUtils::massToString(mass);
}


} // namespace spoms
} // namespace pappso
