Brief description of class still missing. More...
#include <LayerPainterRequest.h>
Signals | |
void | finished (QImage im, LayerImages li) |
Public Member Functions | |
int | depth () const |
GraphContent * | graphContent () const |
const LayerImages & | layerImages () const |
LayerPainterRequest () | |
const GraphContentOptions & | options () 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 |
Brief description of class still missing.
Full description of class still missing
{
_terminate=false;
_gc=0;
}
int SciFigs::LayerPainterRequest::depth | ( | ) | const [inline] |
Referenced by SciFigs::LayerPainter::paint(), setDepth(), and SciFigs::LayerPainter::terminate().
{return _depth;}
void SciFigs::LayerPainterRequest::finished | ( | QImage | im, |
LayerImages | li | ||
) | [signal] |
Referenced by paint().
GraphContent* SciFigs::LayerPainterRequest::graphContent | ( | ) | const [inline] |
Referenced by SciFigs::LayerPainter::clear(), SciFigs::GridPlot::drawGrid2DBlock(), SciFigs::GridPlot::drawGrid2DSmooth(), SciFigs::LayerPainter::paint(), SciFigs::XYValueLines::paintData(), GeopsyGui::SignalLayer::paintData(), GeopsyGui::PickLayer::paintText(), and SciFigs::LayerPainter::terminate().
{return _gc;}
const LayerImages& SciFigs::LayerPainterRequest::layerImages | ( | ) | const [inline] |
{return _layerImages;}
const GraphContentOptions& SciFigs::LayerPainterRequest::options | ( | ) | const [inline] |
Referenced by SciFigs::GridPlot::drawGrid2DBlock(), SciFigs::GridPlot::drawGrid2DSmooth(), SciFigs::GridPlot::drawGrid2DYSmooth(), SciFigs::GridPlot::drawGridLines(), SciFigs::CircleMask::paintData(), FKMeshLayer::paintData(), SciFigs::HistogramLayer::paintData(), SciFigs::XYColorPlot::paintData(), SciFigs::CircleViewer::paintData(), SciFigs::ColorPaletteLayer::paintData(), SciFigs::SlopeEstimator::paintData(), SciFigs::IrregularGrid2DPlot::paintData(), SciFigs::XYValuePlot::paintData(), SciFigs::XYValueLines::paintData(), NAModelsPlot::paintData(), GeopsyGui::ChronogramLayer::paintData(), SciFigs::ParallelBands::paintData(), SciFigs::NameLineLayer::paintData(), GeopsyGui::PickLayer::paintData(), SciFigs::XYPlot::paintData(), SciFigs::LineLayer::paintData(), SciFigs::XUniqueYColorLines::paintData(), SciFigs::LiveGridLayer::paintData(), SciFigs::XYColorLines::paintData(), SciFigs::ImageLayer::paintData(), GeopsyGui::SignalLayer::paintData(), SciFigs::SlopeEstimator::paintText(), SciFigs::NameLineLayer::paintText(), and GeopsyGui::PickLayer::paintText().
{return *_options;}
void SciFigs::LayerPainterRequest::paint | ( | ) |
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()); } }
void SciFigs::LayerPainterRequest::setDepth | ( | int | depth | ) |
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))); } } }
void SciFigs::LayerPainterRequest::setGraphContent | ( | GraphContent * | gc | ) | [inline] |
Can be called only outside a painting thread.
Referenced by SciFigs::GraphContent::print().
{_gc=gc;}
void SciFigs::LayerPainterRequest::setLayerImages | ( | const LayerImages & | li | ) | [inline] |
{_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] |
Referenced by SciFigs::GridPlot::drawGrid2DSmooth(), SciFigs::LayerPainter::paint(), SciFigs::ColorPaletteLayer::paintData(), SciFigs::SlopeEstimator::paintData(), SciFigs::XYValueLines::paintData(), SciFigs::ParallelBands::paintData(), GeopsyGui::PickLayer::paintData(), SciFigs::LineLayer::paintData(), SciFigs::XUniqueYColorLines::paintData(), SciFigs::LiveGridLayer::paintData(), SciFigs::XYColorLines::paintData(), GeopsyGui::SignalLayer::paintData(), and SciFigs::SlopeEstimator::paintText().
{return _size;}
void SciFigs::LayerPainterRequest::terminate | ( | ) | [inline] |
Referenced by SciFigs::LayerPainter::clear(), SciFigs::LayerPainter::paint(), SciFigs::LayerPainterThread::terminate(), and SciFigs::LayerPainter::terminate().
{_terminate.fetchAndStoreOrdered(true);}
bool SciFigs::LayerPainterRequest::terminated | ( | ) | const [inline] |
Referenced by SciFigs::GridPlot::drawGrid2DBlock(), SciFigs::GridPlot::drawGrid2DSmooth(), SciFigs::GridPlot::drawGrid2DYSmooth(), paint(), FKMeshLayer::paintData(), SciFigs::XYColorPlot::paintData(), SciFigs::CircleViewer::paintData(), SciFigs::SlopeEstimator::paintData(), SciFigs::XYValueLines::paintData(), NAModelsPlot::paintData(), SciFigs::ParallelBands::paintData(), SciFigs::NameLineLayer::paintData(), GeopsyGui::PickLayer::paintData(), SciFigs::LineLayer::paintData(), SciFigs::XUniqueYColorLines::paintData(), SciFigs::XYColorLines::paintData(), SciFigs::ImageLayer::paintData(), and GeopsyGui::SignalLayer::paintData().
{return _terminate.testAndSetOrdered(true, true);}