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

Brief description of class still missing. More...

#include <LayerPainterRequest.h>

List of all members.

Signals

void finished (QImage im, LayerImages li)

Public Member Functions

int depth () const
GraphContentgraphContent () const
const LayerImageslayerImages () const
 LayerPainterRequest ()
const GraphContentOptionsoptions () const
void paint ()
void paintText ()
void setDepth (int depth)
void setGraphContent (GraphContent *gc)
void setLayerImages (const LayerImages &li)
void setLayers (const QList< GraphContentLayer * > &layers)
void setOptions (const QSharedDataPointer< GraphContentOptions > &o)
void setSize (int w, int h)
void setSize (const QSize &s)
QSize size () const
void terminate ()
bool terminated () const

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

{
  _terminate=false;
  _gc=0;
}

Member Function Documentation

int SciFigs::LayerPainterRequest::depth ( ) const [inline]
void SciFigs::LayerPainterRequest::finished ( QImage  im,
LayerImages  li 
) [signal]

Referenced by paint().

{return _layerImages;}

References SciFigs::GraphContentOptions::contourWeight(), finished(), SciFigs::GraphContentOptions::gridLines(), SciFigs::GraphContentOptions::paintContour(), SciFigs::GraphContentOptions::paintGridLines(), SciFigs::SciFigsGlobal::screenResolution(), and terminated().

Referenced by SciFigs::LayerPainterThread::run().

{
  _image=QImage(_size, QImage::Format_ARGB32_Premultiplied);

  const GraphContentOptions& gc=*_options.constData();
  QPainter p;
  p.begin(&_image);
  if(_depth==0) {
    p.fillRect(0, 0, _size.width(), _size.height(), Qt::white);
    if(gc.gridLines()) {
      gc.paintGridLines(p, SciFigsGlobal::screenResolution(), _size.width(), _size.height());
    }
    paintLayers(p);
  } else { // Plot only some of the layers
    paintLayers(_depth, p);
  }
  if(terminated()) {
    p.end();
    return;
  }
  if(gc.contourWeight()>0) {
    gc.paintContour(p, SciFigsGlobal::screenResolution(), _size.width(), _size.height());
  }
  p.end();
  emit finished(_image, _layerImages);
}

References SciFigs::SciFigsGlobal::screenResolution().

Referenced by SciFigs::LayerPainter::paint().

{
  int nLayers=_layers.count();
  for(int i=_depth;i<nLayers;i++) {
    _layers.at(i)->paintText( *this, SciFigsGlobal::screenResolution());
  }
}

Depth is relative to the final display. It is not the layer index to start with. A depth of 0 is for starting from the uppermost layer. A depth of -1, means do nothing.

Can be called only outside a painting thread. Set the depth of painting. It is automatically adjusted to available layer images (setLayerImage() must be called before).

References depth().

Referenced by SciFigs::LayerPainter::paint().

{
  _depth=depth;
  if(_depth > 0) {
    GraphContentLayer * l=_layers.at(_depth);
    if(!_layerImages.contains(l)) {
      _layerImages.insert(l,QImage(_size, QImage::Format_ARGB32_Premultiplied));
      do {
        _depth--;
      } while(_depth>0 && !_layerImages.contains(_layers.at(_depth)));
    }
  }
}

Can be called only outside a painting thread.

Referenced by SciFigs::GraphContent::print().

{_gc=gc;}
{_layerImages=li;}
void SciFigs::LayerPainterRequest::setLayers ( const QList< GraphContentLayer * > &  layers) [inline]

Can be called only outside a painting thread. Used only for true painting requests. For other requests (e.g. clear), setLayers() is not mandatory.

{_layers=layers;}
void SciFigs::LayerPainterRequest::setOptions ( const QSharedDataPointer< GraphContentOptions > &  o) [inline]

Referenced by SciFigs::GraphContent::print().

{_options=o;}
void SciFigs::LayerPainterRequest::setSize ( int  w,
int  h 
) [inline]

Referenced by SciFigs::GraphContent::print().

{_size=QSize(w, h);}
void SciFigs::LayerPainterRequest::setSize ( const QSize &  s) [inline]
{_size=s;}
QSize SciFigs::LayerPainterRequest::size ( ) const [inline]

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