xicPlot.cpp 806 Bytes
Newer Older
Edlira Nano's avatar
Edlira Nano committed
1
2
3
4
5
6
7
/**
 * \file xicPlot.cpp
 * \date November 22, 2011
 * \author Edlira Nano
 */


Edlira Nano's avatar
Edlira Nano committed
8
9
#include "xicPlot.h"

Edlira Nano's avatar
Edlira Nano committed
10
11
XicPlot::XicPlot(const QString & title, XicProfile * xic_profile) :
  QwtPlotCurve(title), 
Edlira Nano's avatar
Edlira Nano committed
12
13
  _xic_profile(xic_profile) 
{
Edlira Nano's avatar
Edlira Nano committed
14
15
  setPlotStyle(_xic_profile->getStyle());
  setPlotData();
Edlira Nano's avatar
Edlira Nano committed
16
17
18
19
20
21
}

XicPlot::~XicPlot() {
}

void
Edlira Nano's avatar
Edlira Nano committed
22
XicPlot::setPlotStyle(PlotStyle * style) {
Edlira Nano's avatar
Edlira Nano committed
23
  _plot_style = style;
Edlira Nano's avatar
Edlira Nano committed
24
25
26
27
28
29
30
  this->setPen(_plot_style->_pen);
  if (_plot_style->_lines) {
    this->setStyle(QwtPlotCurve::Lines);
  }
  if (_plot_style->_render_antialiased) {
    this->setRenderHint(QwtPlotItem::RenderAntialiased);
  }
Edlira Nano's avatar
Edlira Nano committed
31
32
33
34
}


void
Edlira Nano's avatar
Edlira Nano committed
35
36
37
38
39
XicPlot::setPlotData() {
  unsigned int plotsize(_xic_profile->size());
  mcq_double x1[plotsize], y1[plotsize];
  _xic_profile->fill_data_array(x1, y1, plotsize);
  this->setData(x1, y1, plotsize);
Edlira Nano's avatar
Edlira Nano committed
40
}