Public Member Functions | Protected Member Functions | Protected Attributes
CurvesThread Class Reference

Brief description of class still missing. More...

#include <CurvesThread.h>

Inheritance diagram for CurvesThread:
ResultsThread QGpCoreTools::Thread MagnetoTelluricThread Seismic1DThread DispersionGridThread DispersionThread EllipticityThread ShAmplificationThread

List of all members.

Public Member Functions

virtual void clear ()
const QList< Curve< Point2D > > & curves () const
 CurvesThread (QObject *parent=0)
 CurvesThread (const CurvesThread &o)
virtual void initResultsGraphs (GraphicSheet *sheet)
virtual void initResultsGraphs (const ResultsThread &o)
virtual LegendWidgetlegend () const =0
double maxX () const
double minX () const
virtual void resultsDeepUpdate ()
virtual void run (GeophysicalModel *model)=0
virtual bool setParameters (int &argc, char **argv)
virtual void setResultsLimits ()
 ~CurvesThread ()

Protected Member Functions

virtual void run ()

Protected Attributes

QList< Curve< Point2D > > _curves
LineLayer_layer
QVector< double > _x

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

CurvesThread::CurvesThread ( QObject *  parent = 0)

Description of constructor still missing

References _layer, and TRACE.

    : ResultsThread(parent)
{
  TRACE;
  _layer=0;
  connect(this, SIGNAL(finished()), this, SLOT(showCurves()), Qt::QueuedConnection);
}

Description of constructor still missing

References _layer, _x, and TRACE.

    : ResultsThread(o.parent())
{
  TRACE;
  _layer=0;
  connect(this, SIGNAL(finished()), this, SLOT(showCurves()), Qt::QueuedConnection);
  _x=o._x;
}

Description of destructor still missing

References TRACE.

{
  TRACE;
}

Member Function Documentation

void CurvesThread::clear ( ) [virtual]
const QList< Curve<Point2D> >& CurvesThread::curves ( ) const [inline]

References _curves.

Referenced by MainWindow::scan().

{return _curves;}
void CurvesThread::initResultsGraphs ( GraphicSheet sheet) [virtual]

Implements ResultsThread.

Reimplemented in DispersionGridThread, MagnetoTelluricThread, DispersionThread, EllipticityThread, and ShAmplificationThread.

References _layer, SciFigs::GraphicSheet::addObject(), SciFigs::GraphicSheet::autoResizeContent(), legend(), SciFigs::GraphicSheet::printRight(), SciFigs::LineLayer::setReferenceLine(), SciFigs::GraphicSheet::showObject(), TRACE, and w.

{
  TRACE;
  AxisWindow * w=new AxisWindow;
  GraphicSheetMenu::setGraphGeometry(w, sheet->printRight(), 10.0, 0.5, 8.0);
  sheet->addObject(w);
  sheet->showObject(w);
  sheet->autoResizeContent();

  _layer=new LineLayer(w);
  _layer->setObjectName(objectName()+" curves");
  _layer->setReferenceLine(new PlotLine2D);
  QObject::connect(legend(), SIGNAL(changed( Legend) ), _layer, SLOT(setLegend( Legend) ));
}
void CurvesThread::initResultsGraphs ( const ResultsThread o) [virtual]

Implements ResultsThread.

Reimplemented in DispersionGridThread, MagnetoTelluricThread, DispersionThread, EllipticityThread, and ShAmplificationThread.

References _layer, SciFigs::GraphContentLayer::graph(), legend(), SciFigs::LineLayer::setReferenceLine(), and TRACE.

{
  TRACE;
  const CurvesThread& oc=static_cast<const CurvesThread&>(o);
  _layer=new LineLayer(oc._layer->graph());
  _layer->setObjectName(objectName()+" curves");
  _layer->setReferenceLine(new PlotLine2D);
  connect(legend(), SIGNAL(changed( Legend) ), _layer, SLOT(setLegend( Legend) ));
}
virtual LegendWidget* CurvesThread::legend ( ) const [pure virtual]

Implemented in MagnetoTelluricThread, and Seismic1DThread.

Referenced by initResultsGraphs().

double CurvesThread::maxX ( ) const [inline]

References _x.

{return _x[_x.count()-1];}
double CurvesThread::minX ( ) const [inline]

References _x.

{return _x[0];}
void CurvesThread::resultsDeepUpdate ( ) [virtual]
virtual void CurvesThread::run ( GeophysicalModel model) [pure virtual]

Implements ResultsThread.

Referenced by MainWindow::scan().

void CurvesThread::run ( ) [protected, virtual]

Reimplemented from ResultsThread.

References _curves, ResultsThread::_models, ResultsThread::terminated(), and TRACE.

{
  TRACE;
  _curves.clear();
  QList<GeophysicalModel *>::iterator it;
  for(it=_models.begin(); it!=_models.end(); it++) {
    if(terminated()) break;
    run(*it);
  }
  qDeleteAll(_models);
}
bool CurvesThread::setParameters ( int &  argc,
char **  argv 
) [virtual]

Reimplemented from ResultsThread.

Reimplemented in DispersionGridThread, DispersionThread, EllipticityThread, MagnetoTelluricThread, ShAmplificationThread, and Seismic1DThread.

References _x, QGpCoreTools::endl(), QGpCoreTools::Function, QGpCoreTools::InversedScale, QGpCoreTools::Curve< pointType >::line(), QGpCoreTools::LinearScale, QGpCoreTools::LogScale, QGpCoreTools::Curve< pointType >::resample(), QGpCoreTools::tr(), TRACE, QGpCoreTools::Curve< pointType >::xMultiply(), and QGpCoreTools::Curve< pointType >::xVector().

{
  TRACE;
  SamplingOption samplingType=LogScale;
  int nSamples=100;
  double minRange=0.2;
  double maxRange=20.0;
  int i, j=1;
  for(i=1; i<argc; i++) {
    QByteArray arg=argv[i];
    if(arg[0]=='-') {
      if(arg=="-s") {
        CoreApplication::checkOptionArg(i, argc, argv);
        if(strcmp(argv[i],"period")==0) {
          samplingType=InversedScale;
        } else if(strcmp(argv[i],"frequency")==0) {
          samplingType=LinearScale;
        } else {
          samplingType=LogScale;
        }
      } else if(arg=="-min") {
        CoreApplication::checkOptionArg(i, argc, argv);
        minRange=atof(argv[i]);
      } else if(arg=="-max") {
        CoreApplication::checkOptionArg(i, argc, argv);
        maxRange=atof(argv[i]);
      } else if(arg=="-n") {
        CoreApplication::checkOptionArg(i, argc, argv);
        nSamples=atoi(argv[i]);
        if(nSamples<=0) {
          App::stream() << tr("gpdclive: negative or null number of samples (option -n)") << endl;
          return false;
        }
      } else {
        argv[j++]=argv[i];
      }
    } else {
      argv[j++]=argv[i];
    }
  }
  if(j < argc) {
    argv[j]=0;
    argc=j;
  }
  // Compute common sampling scale
  Curve<Point1D> c;
  c.line(minRange, maxRange);
  c.resample(nSamples, minRange, maxRange, samplingType | Function);
  c.xMultiply(2*M_PI); // convert to angular frequency
  _x=c.xVector();
  return true;
}
void CurvesThread::setResultsLimits ( ) [virtual]

Member Data Documentation

QList< Curve<Point2D> > CurvesThread::_curves [protected]

Referenced by curves(), and run().

QVector<double> CurvesThread::_x [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines