/***************************************************************************
 *   Copyright (C) 2004 by Armando Navarro-V�quez                         *
 *   qoajnv@usc.es                                                         *
 *                                                                         *
 *   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 2 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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef IRSPECTRUM_H
#define IRSPECTRUM_H
#include <vector>

#include "sinusoid.h"
#include "frequency.h"
/**
@author Armando Navarro-Vázquez
*/
class IRSpectrum
{
public:
  enum SpectrumType { IR, VCD };
  IRSpectrum();
  ~IRSpectrum();
  void SetFrequencies(std::vector<frequency>& v,double scale=1.0);
  void CalculateSpectrum();
  bool WriteJCampDX();
  void SetFile(const char* file);
  fidarray*  GetData() { return &m_data; }
  float Max() { return m_max; }
  float Min() { return m_min; }
  float LineWidth() const { return m_linewidth; }
  void SetLimits(float& max, float& min) { m_max=max; m_min=min; CalculateSpectrum(); }
  void SetAutoLimits();
  void SetLineWidth(float lw);
  void SetType(SpectrumType type);
  SpectrumType GetType() const { return m_spectrumtype; }
protected:
  std::string m_file;
  std::vector<frequency> m_frequencies;
private:
  std::vector<CSinusoid> m_sinusoid;
  fidarray m_data;
  float m_max;
  float m_min;
  std::string m_title;
  SpectrumType m_spectrumtype;
  /** Linewidth in cm-1*/
  float m_linewidth;
};

#endif
