#include "curve.h" #include #include using namespace std; Curve::Curve(const Instanc &i) : Instanc(i){ cerr << "Created curve"; // may through 'child not found'... Instanc point_array = getChild(PLOT_POINT); vector pa = point_array.getChildren(); vector::iterator pai; for(pai = pa.begin(); pai < pa.end() ; ++pai){ Instanc xinst = pai->getChild(PLOT_XPOINT); Instanc yinst = pai->getChild(PLOT_YPOINT); if(xinst.isAssigned() && yinst.isAssigned()){ x.push_back(xinst.getRealValue()); y.push_back(yinst.getRealValue()); } } } Curve::Curve(){ throw runtime_error("not allowed"); } Curve::Curve(const Curve &old) : Instanc(old.getInternalType()){ x = old.x; y = old.y; } Curve & Curve::operator=(const Curve &old){ this->x = old.x; this->y = old.y; return *this; } const string Curve::getLegend() const{ Instanc li = getChild(PLOT_LEGEND); if(li.isAssigned()){ return li.getSymbolValue().toString(); } return ""; }