All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Signals | Public Member Functions | Protected Member Functions | Protected Attributes
SciFigs::LiveGridLayer Class Reference

#include <LiveGridLayer.h>

Inheritance diagram for SciFigs::LiveGridLayer:
SciFigs::GridPlot SciFigs::GraphContentLayer QGpGuiTools::PropertyItem QGpCoreTools::XMLClass

List of all members.

Signals

void paletteAdjusted (const ColorPalette &pal) const

Public Member Functions

virtual void addProperties (PropertyProxy *pp)
bool autoAdjustPalette () const
virtual Rect boundingRect () const
bool forceMaximumValue () const
bool forceMinimumValue () const
const AbstractFunction2function () const
virtual bool hasProperties ()
 LiveGridLayer (AxisWindow *parent)
double maximumValue () const
double minimumValue () const
virtual void properties (PropertyWidget *w) const
virtual void removeProperties (PropertyProxy *pp)
int sampling () const
SamplingParameters::Type scale () const
void setAutoAdjustPalette (bool a)
void setForceMaximumValue (bool f)
void setForceMinimumValue (bool f)
void setFunction (AbstractFunction2 *f)
void setMaximumValue (double m)
void setMinimumValue (double m)
virtual void setProperty (uint wid, int pid, QVariant val)
void setSampling (int s)
void setScale (SamplingParameters::Type s)
void setSmallestDetail (double d)
int smallestDetail () const
AbstractFunction2takeFunction ()
virtual const QString & xml_tagName () const
 ~LiveGridLayer ()

Protected Member Functions

virtual void paintData (const LayerPainterRequest &lp, QPainter &p, double dotpercm) const
virtual void xml_writeChildren (XML_WRITECHILDREN_ARGS) const

Protected Attributes

AbstractFunction2_function
int _sampling
double _smallestDetail

Constructor & Destructor Documentation

References _function, _sampling, _smallestDetail, paletteAdjusted(), and TRACE.

    : GridPlot(parent)
{
  TRACE;
  _function=0;
  _sampling=1;
  _autoAdjustPalette=true;
  _forceMinimumValue=true;
  _forceMaximumValue=false;
  _scale=SamplingParameters::Linear;
  _minimumValue=0.0;
  _maximumValue=0.0;
  _smallestDetail=1e99;
  _tab=0;
  connect(this, SIGNAL(paletteAdjusted(const ColorPalette&)),
          this, SLOT(showAdjustedPalette(const ColorPalette&)), Qt::QueuedConnection);
}

References _function, and TRACE.

{
  TRACE;
  delete _function;
}

Member Function Documentation

Setup property editor

Reimplemented from SciFigs::GridPlot.

References QGpGuiTools::PropertyProxy::addReference(), QGpGuiTools::PropertyProxy::addTab(), QGpGuiTools::PropertyProxy::setCurrentTab(), QGpCoreTools::tr(), TRACE, and w.

{
  TRACE;
  GridPlot::addProperties(pp);
  if(pp->setCurrentTab(_tab)) {
    pp->addReference(this);
  } else {
    LiveGridLayerProperties * w=new LiveGridLayerProperties;
    pp->addTab(_tab, tr("Palette update"), w, this);
  }
}

Referenced by properties().

{return _autoAdjustPalette;}

Implements SciFigs::GraphContentLayer.

References TRACE.

{
  TRACE;
  return Rect();
}

Referenced by properties().

{return _forceMaximumValue;}

Referenced by properties().

{return _forceMinimumValue;}
{return _function;}
virtual bool SciFigs::LiveGridLayer::hasProperties ( ) [inline, virtual]

Reimplemented from SciFigs::GridPlot.

{return true;}
double SciFigs::LiveGridLayer::maximumValue ( ) const [inline]

Referenced by properties().

{return _maximumValue;}
double SciFigs::LiveGridLayer::minimumValue ( ) const [inline]

Referenced by properties().

{return _minimumValue;}
void SciFigs::LiveGridLayer::paintData ( const LayerPainterRequest lp,
QPainter &  p,
double  dotpercm 
) const [protected, virtual]

Implements SciFigs::GraphContentLayer.

References _function, SciFigs::GridPlot::drawGrid2DBlock(), SciFigs::GridPlot::drawGrid2DSmooth(), SciFigs::LayerPainterRequest::options(), SciFigs::GridPlot::palette(), paletteAdjusted(), SciFigs::IrregularGrid2DDraw::setCellLimits(), SciFigs::IrregularGrid2DDraw::setCellNodes(), SciFigs::IrregularGrid2DDraw::setVisibleArea(), SciFigs::LayerPainterRequest::size(), SciFigs::GridPlot::smooth(), and TRACE.

{
  TRACE;
  if(!_function) return;
  IrregularGrid2D grid=calculateGrid(lp.size(), lp.options(), &lp);
  // Make a copy of current palette (mandatory for multi-thread, palette are implicitly shared
  // objects so deep copy probably is not occuring right now, only upon user request for modification)
  ColorPalette pal=palette();
  if(_autoAdjustPalette) {
    adjustPalette(grid, pal);
    emit paletteAdjusted(pal);
  }
  const GraphContentOptions& gc=lp.options();
  IrregularGrid2DDraw d;
  // Get the limit of visible area in terms of grid indexes
  d.setVisibleArea(grid, gc);
  // Create two int vectors containing the x and y of nodes (centers of blocks)
  d.setCellNodes(grid, gc);

  if(smooth()) {
    drawGrid2DSmooth(grid, pal, lp, p, d);
  } else {
    d.setCellLimits();
    drawGrid2DBlock(grid, pal, lp, p, d);
  }
  /*GraphContent * gc=graphContent();
  QImage im(w, h, QImage::Format_ARGB32);
  uint * imPtr=(uint * ) im.bits() + w + 1;
  double y;
  int h1=h-1;
  int w1=w-1;
  int iy;
  for(iy=1;iy<h1; iy+=3) {
    y=gc->ys2r(iy);
    fillRow(gc, imPtr, y, w, w1);
    imPtr+=2*w;
  }
  // Add last pixel rows
  switch(iy-h1) {
  case 0:  // two rows are missing
    y=gc->xs2r(iy);
    fillRowSup2(gc, imPtr, y, w, w1);
    break;
  case 1:  // one row is missing
    y=gc->xs2r(iy);
    fillRowSup1(gc, imPtr, y, w, w1);
    break;
  default: // h is a multiple of 3
    break;
  }
  p.drawImage(0, 0, im);*/
}
void SciFigs::LiveGridLayer::paletteAdjusted ( const ColorPalette pal) const [signal]

Referenced by LiveGridLayer(), and paintData().

void SciFigs::LiveGridLayer::properties ( PropertyWidget w) const [virtual]

Clean property editor

Reimplemented from SciFigs::GridPlot.

References QGpGuiTools::PropertyProxy::removeTab(), and TRACE.

{
  TRACE;
  pp->removeTab(_tab, this);
}
int SciFigs::LiveGridLayer::sampling ( ) const [inline]
{return _sampling;}

Referenced by properties().

{return _scale;}

Referenced by ArrayGui::ArrayResponse::createObjects(), and setProperty().

{_autoAdjustPalette=a;}

Referenced by DispersionGridThread::initResultsGraphs(), and setProperty().

{_forceMaximumValue=f;}

Referenced by DispersionGridThread::initResultsGraphs(), and setProperty().

{_forceMinimumValue=f;}
void SciFigs::LiveGridLayer::setMaximumValue ( double  m) [inline]

Referenced by DispersionGridThread::initResultsGraphs(), and setProperty().

{_maximumValue=m;}
void SciFigs::LiveGridLayer::setMinimumValue ( double  m) [inline]

Referenced by DispersionGridThread::initResultsGraphs(), and setProperty().

{_minimumValue=m;}
void SciFigs::LiveGridLayer::setProperty ( uint  wid,
int  pid,
QVariant  val 
) [virtual]
void SciFigs::LiveGridLayer::setSampling ( int  s) [inline]

Referenced by setProperty().

{_scale=s;}
void SciFigs::LiveGridLayer::setSmallestDetail ( double  d) [inline]
{return _smallestDetail;}

References _function, and TRACE.

Referenced by FKTimeWindows::setCurrentWindow().

{
  TRACE;
  LayerLocker ll(this);
  AbstractFunction2 * f=_function;
  _function=0;
  return f;
}
virtual const QString& SciFigs::LiveGridLayer::xml_tagName ( ) const [inline, virtual]

Reimplemented from SciFigs::GridPlot.

References SciFigs::XMLSciFigs::data(), SciFigs::GraphContentLayer::graphContent(), TRACE, and QGpCoreTools::XMLClass::xml_save().

{
  TRACE;
  // Calculate grid with current plot limits
  IrregularGrid2D grid=calculateGrid(graphContent()->size(), graphContent()->options());
  XMLSciFigs * scifigsContext=static_cast<XMLSciFigs *>(context);
  if(scifigsContext->data()) {
    grid.xml_save(s, context);
  }
  GridPlot::xml_writeChildren(s, context);
}

Member Data Documentation

Referenced by LiveGridLayer().

Referenced by LiveGridLayer().


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