The base class for all layers of the plot content of a AxisWindow (GraphContent). More...
#include <GraphContentLayer.h>
Public Slots | |
| Q_SCRIPTABLE void | deepUpdate () |
| virtual void | toggleTrackingAction (bool checked, int id=-1) |
Signals | |
| void | dataPainted (QPainter &p, double dotpercm, int w, int h) const |
Public Member Functions | |
| virtual void | addProperties (PropertyProxy *) |
| void | addReference () |
| QAction * | addTrackingAction (QString text, int id=0, QString statusTip=QString::null) |
| virtual Rect | boundingRect () const =0 |
| virtual QString | coordinateTipInfo (const Point2D &p) const |
| AxisWindow * | graph () const |
| GraphContent * | graphContent () |
| const GraphContent * | graphContent () const |
| GraphContentLayer (AxisWindow *parent=0) | |
| virtual bool | hasProperties () |
| bool | isEditable () const |
| bool | isRemovable () const |
| bool | isSelected () const |
| virtual bool | keyPressEvent (QKeyEvent *e) |
| virtual bool | keyReleaseEvent (QKeyEvent *e) |
| void | lock () |
| void | lockDelayPainting () |
| virtual void | mouseMoveEvent (const QPoint &pt, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) |
| virtual bool | mousePressEvent (QMouseEvent *e, int id=-1) |
| virtual bool | mouseReleaseEvent (QMouseEvent *e, int id=-1) |
| qreal | opacity () const |
| void | paint (const LayerPainterRequest &lp, QPainter &p, double dotpercm) |
| virtual void | paintText (const LayerPainterRequest &lp, double dotpercm) |
| virtual void | properties (PropertyWidget *) const |
| virtual void | removeProperties (PropertyProxy *) |
| void | removeReference () |
| void | setEditable (bool r) |
| void | setOpacity (qreal o) |
| virtual void | setParent (GraphContent *parent) |
| virtual void | setProperty (uint, int, QVariant) |
| void | setSelected (bool s) |
| void | setTrackingAction (int id, bool checked) |
| virtual bool | trackRectangle (int id, double rx1, double ry1, double rx2, double ry2, Qt::KeyboardModifiers m) |
| void | unlock () |
| virtual bool | wheelEvent (QWheelEvent *e) |
| virtual void | xml_layerPolish (XML_POLISH_ARGS) |
| virtual const QString & | xml_tagName () const |
Static Public Member Functions | |
| static QString | trackingActionCtrlHelp () |
Static Public Attributes | |
| static const QString | xmlGraphContentLayerTag = "GraphContentLayer" |
Protected Member Functions | |
| void | beginMouseTracking (const LayerMouseTracking &mt) |
| void | endMouseTracking (int id=0) |
| bool | isMouseTracking (int id=0) |
| virtual void | paintData (const LayerPainterRequest &lp, QPainter &p, double dotpercm) const =0 |
| virtual XMLMember | xml_member (XML_MEMBER_ARGS) |
| virtual bool | xml_setProperty (XML_SETPROPERTY_ARGS) |
| virtual void | xml_writeProperties (XML_WRITEPROPERTIES_ARGS) const |
Protected Attributes | |
| uint | _isEditable:1 |
| uint | _isSelected:1 |
| QMutex | _mutex |
| qreal | _opacity |
| int | _referenceCount |
Properties | |
| DUMMY_PROPERTIES | |
| QString | name |
| QString | objectName |
| qreal | opacity |
The base class for all layers of the plot content of a AxisWindow (GraphContent).
| SciFigs::GraphContentLayer::GraphContentLayer | ( | AxisWindow * | parent = 0 | ) |
If parent is not null the layer is automatically added to the stack of layers. You
References _isEditable, _isSelected, _opacity, _referenceCount, SciFigs::GraphContent::addLayer(), SciFigs::AxisWindow::graphContent(), and TRACE.
:
QObject(parent ? parent->graphContent() : 0), _mutex(QMutex::Recursive)
{
TRACE;
_opacity=1.0;
_referenceCount=1; // By default one reference from the internal code
_isEditable=true;
_isSelected=true;
if(parent) {
parent->graphContent()->addLayer(this);
}
}
| virtual void SciFigs::GraphContentLayer::addProperties | ( | PropertyProxy * | ) | [inline, virtual] |
Reimplemented in GeopsyGui::SignalLayer, SciFigs::LineLayer, SciFigs::ImageLayer, SciFigs::LiveGridLayer, SciFigs::XYColorLines, SciFigs::XUniqueYColorLines, SciFigs::XYPlot, NAModelsPlot, GeopsyGui::ChronogramLayer, SciFigs::NameLineLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, GeopsyGui::PickLayer, SciFigs::GridPlot, and SciFigs::GridMaxFollower.
Referenced by SciFigs::GraphContent::addProperties().
{}
| void SciFigs::GraphContentLayer::addReference | ( | ) | [inline] |
Referenced by GeopsyGui::TimeWindowLayer::TimeWindowLayer(), and GeopsyGui::TimeWindowLayer::xml_layerPolish().
{_referenceCount++;}
| QAction * SciFigs::GraphContentLayer::addTrackingAction | ( | QString | text, |
| int | id = 0, |
||
| QString | statusTip = QString::null |
||
| ) |
References graphContent(), objectName, toggleTrackingAction(), TRACE, and trackingActionCtrlHelp().
Referenced by GeopsyGui::ArrayMap::ArrayMap(), ChronogramWindow::ChronogramWindow(), MonoStation::AbstractSummary::createSpectrumGridGraph(), GraphicWindow::GraphicWindow(), HistogramWidget::HistogramWidget(), DinverDCGui::DCModelViewer::initGraphs(), SciFigs::CurveBrowser::initLayer(), MapWindow::MapWindow(), MonoStation::StationResults::setGraph(), and StatGridAnalyser::setGrid().
{
TRACE;
GraphContent * gc=graphContent();
QAction * a;
QList<QAction *> al=gc->actions();
/*for(QList<QAction *>::iterator it=al.begin(); it!=al.end();++it) {
if((*it)->data().toInt()==id) return; // already added
}*/
if(!al.last()->objectName().startsWith("layerTracking")) {
a=new QAction(gc);
a->setObjectName( "LayerTrackingSeparator" );
a->setSeparator(true);
gc->QWidget::addAction(a);
}
a=new QAction(text, gc);
a->setObjectName(QString("layerTracking")+objectName()+QString::number(id));
a->setCheckable(true);
a->setChecked(false);
a->setData(id);
if(!statusTip.isEmpty()) {
a->setStatusTip(statusTip+trackingActionCtrlHelp());
}
connect(a, SIGNAL(toggled(bool)), this, SLOT(toggleTrackingAction(bool)));
gc->QWidget::addAction(a);
return a;
}
| void SciFigs::GraphContentLayer::beginMouseTracking | ( | const LayerMouseTracking & | mt | ) | [protected] |
References graphContent(), and TRACE.
Referenced by GeopsyGui::PickLayer::toggleMouseLine(), SciFigs::ImageLayer::toggleTrackingAction(), SciFigs::LineLayer::toggleTrackingAction(), and toggleTrackingAction().
{
TRACE;
graphContent()->beginMouseTracking(mt);
}
| virtual Rect SciFigs::GraphContentLayer::boundingRect | ( | ) | const [pure virtual] |
Implemented in SciFigs::LiveGridLayer, GeopsyGui::SignalLayer, SciFigs::LineLayer, SciFigs::XYPlot, SciFigs::XYColorLines, SciFigs::ImageLayer, SciFigs::XUniqueYColorLines, SciFigs::IrregularGrid2DPlot, GeopsyGui::TimeWindowLayer, GeopsyGui::ChronogramLayer, SciFigs::CircleViewer, SciFigs::ColorPaletteLayer, GeopsyGui::PickLayer, SciFigs::GridViewer, SciFigs::ParallelBands, SciFigs::HistogramLayer, NAModelsPlot, FKMeshLayer, and SciFigs::CircleMask.
Referenced by SciFigs::GraphContent::boundingRect().
| QString SciFigs::GraphContentLayer::coordinateTipInfo | ( | const Point2D & | p | ) | const [virtual] |
| void SciFigs::GraphContentLayer::dataPainted | ( | QPainter & | p, |
| double | dotpercm, | ||
| int | w, | ||
| int | h | ||
| ) | const [signal] |
Referenced by GeopsyGui::PickLayer::paintData().
| void SciFigs::GraphContentLayer::deepUpdate | ( | ) | [slot] |
References SciFigs::GraphContent::deepUpdate(), graphContent(), and TRACE.
Referenced by AutocorrTargetWidget::addCurve(), SciFigs::CurveProperties::curveChanged(), ToolNR::highlightShot(), GeopsyGui::PickLayer::keyPressEvent(), SciFigs::LineLayer::keyPressEvent(), SciFigs::CurveBrowser::legend(), DinverDCGui::GroundModelViewer::minMaxProfiles(), GeopsyGui::PickLayer::mouseMoveEvent(), SciFigs::LineLayer::mouseMoveEvent(), GeopsyGui::PickLayer::mousePressEvent(), SciFigs::LineLayer::mousePressEvent(), SciFigs::LineLayer::mouseReleaseEvent(), Simulator::on_gridSizeEdit_valueChanged(), FKTimeWindows::on_kEdit_valueChanged(), FKTimeWindows::on_vEdit_valueChanged(), ArrayGui::ArrayResponse::setAzimuth(), QGpGuiWave::DispersionLimitLayer::setConstantWaveNumber(), FKTimeWindows::setCurrentWindow(), SciFigs::LayerPropertiesItem::setData(), SciFigs::NameLineItem::setData(), SciFigs::LineItem::setData(), FKTimeWindows::setGrid(), ArrayGui::ArrayResponse::setKmax(), ArrayGui::ArrayResponse::setKmin(), SciFigs::NameLineLayer::setLegend(), SciFigs::LineLayer::setLegend(), FKTimeWindows::setParameters(), GeopsyGui::PickLayer::setPick(), GeopsyGui::PickLayer::setProperty(), GeopsyGui::ChronogramLayer::setProperty(), DinverDCGui::EllipticityViewer::showTarget(), DinverDCGui::DCModelViewer::showTarget(), MonoStation::AbstractTool::signalMouseMoved(), MonoStation::AbstractTool::signalMousePressed(), MonoStation::AbstractTool::signalMouseReleased(), MonoStation::AbstractTool::start(), GeopsyGui::PickLayer::toggleMouseLine(), GeopsyGui::ChronogramLayer::trackRectangle(), GeopsyGui::RingEditor::updateGraph(), SciFigs::LineLayer::wheelEvent(), and MonoStation::AbstractTool::windowsChanged().
{
TRACE;
graphContent()->deepUpdate(graphContent()->indexOf(this));
}
| void SciFigs::GraphContentLayer::endMouseTracking | ( | int | id = 0 | ) | [protected] |
References graphContent(), and TRACE.
Referenced by GeopsyGui::PickLayer::toggleMouseLine(), SciFigs::ImageLayer::toggleTrackingAction(), SciFigs::LineLayer::toggleTrackingAction(), and toggleTrackingAction().
{
TRACE;
graphContent()->endMouseTracking(this, id);
}
| AxisWindow* SciFigs::GraphContentLayer::graph | ( | ) | const [inline] |
Referenced by addDotPlot(), addManyCurvePlot(), SciFigs::ColorPaletteWidget::axis(), ChronogramWindow::ChronogramWindow(), MonoStation::StationResults::clear(), SciFigs::ImageLayer::colorHistogram(), TFAResults::compute(), SciFigs::ColorPaletteLayer::coordinateTipInfo(), SciFigs::IrregularGrid2DPlot::coordinateTipInfo(), coordinateTipInfo(), GeopsyGui::RingEditor::countPairs(), createBands(), createCircles(), createCurve(), createCurveName(), createDots(), createGrid(), MonoStation::AbstractSummary::createGridCrossSectionGraph(), createManyCurves(), SpacSelector::createObjects(), MonoStation::AbstractSummary::createSpectrumGridGraph(), SciFigs::ColorPaletteWidget::deepUpdate(), SciFigs::ColorPaletteWidget::eventFilter(), LinearFKActiveResults::exportCurves(), GraphicWindow::fastFourierTransform(), GraphicWindow::GraphicWindow(), SciFigs::CurveBrowser::initLayer(), Seismic1DThread::initModelGraphs(), MagnetoTelluricThread::initModelGraphs(), EllipticityThread::initResultsGraphs(), CurvesThread::initResultsGraphs(), DispersionThread::initResultsGraphs(), MagnetoTelluricThread::initResultsGraphs(), SpacSelector::inverse(), SpacSelector::inverseAt(), Seismic1DThread::modelDeepUpdate(), MagnetoTelluricThread::modelDeepUpdate(), SciFigs::ColorPaletteWidget::operator=(), GeopsyGui::RingEditor::optimizeBut_clicked(), GeopsyGui::PickLayer::paintData(), SciFigs::ColorPaletteWidget::print(), ChronogramWindow::refreshSignal(), SciFigs::LineLayer::resetLineProperties(), MagnifierSignal::resizeEvent(), SciFigs::ColorPaletteWidget::resizeEvent(), SciFigs::ColorPaletteWidget::restoreScaleFonts(), HVRotateStation::resultGraph(), SpectrumRotateStation::resultGraph(), CurvesThread::resultsDeepUpdate(), DispersionGridThread::resultsDeepUpdate(), MagnetoTelluricThread::resultsDeepUpdate(), SciFigs::ColorPaletteWidget::scaleFonts(), SpacSelector::selectSamples(), MonoStation::AbstractSummary::setBubbleValues(), MonoStation::AbstractTool::setCurrentDisplayStation(), ArrayGui::ArrayResponse::setFrequencySampling(), SpacSelector::setK(), RefractionTargetWidget::setLimits(), ChronogramWindow::setLimits(), AutocorrTargetWidget::setLimits(), DispersionGridThread::setLimits(), GraphicWindow::setLimits(), MonoStation::AbstractSummary::setLimits(), PSViewer::setLimits(), SciFigs::CurveBrowser::setLimits(), GraphicWindow::setMagnifySignal(), Seismic1DThread::setModelLimits(), MagnetoTelluricThread::setModelLimits(), SciFigs::ColorPaletteWidget::setPalette(), SignalDisplay::setProperty(), NAModelsPlot::setProperty(), CurvesThread::setResultsLimits(), MagnetoTelluricThread::setResultsLimits(), MagnifierSignal::setSignal(), Results::setThreshold(), MagnifierSignal::setTime(), MonoStation::StationResults::setWindowColor(), GraphicWindow::showMagnify(), ChronogramWindow::signalsUpdate(), GraphicWindow::signalsUpdate(), LinearFKActiveResults::stackGrids(), MonoStation::StatisticResults::studentTest(), ChronogramWindow::subPoolUpdate(), GraphicWindow::subPoolUpdate(), SciFigs::ColorPaletteWidget::update(), ChronogramWindow::updateLabels(), GraphicWindow::updateLabels(), PtMotionResults::updateSignals(), and SciFigs::ColorPaletteWidget::xml_polishChild().
{return reinterpret_cast<AxisWindow *>(parent()->parent());}
| GraphContent* SciFigs::GraphContentLayer::graphContent | ( | ) | [inline] |
Referenced by GeopsyGui::PickLayer::addActions(), addTrackingAction(), beginMouseTracking(), ChronogramWindow::ChronogramWindow(), DampingResults::compute(), deepUpdate(), endMouseTracking(), GeopsyGui::ChronogramLayer::exportGaps(), FKTimeWindows::FKTimeWindows(), ChronogramWindow::focusInEvent(), GraphicWindow::focusInEvent(), GraphicWindow::GraphicWindow(), SciFigs::ImageLayer::grayFilter(), SciFigs::ImageLayer::highPassFilter(), isMouseTracking(), GeopsyGui::PickLayer::keyPressEvent(), SciFigs::ImageLayer::loadImage(), lockDelayPainting(), SciFigs::ImageLayer::lowPassFilter(), MagnifierSignal::MagnifierSignal(), SciFigs::LineEditor::mouseMoveEvent(), GeopsyGui::PickLayer::mouseMoveEvent(), GeopsyGui::PickLayer::mousePressEvent(), SciFigs::PolarGridPlot::mouseReleaseEvent(), SciFigs::GridViewer::mouseReleaseEvent(), SciFigs::IrregularGrid2DPlot::mouseReleaseEvent(), SciFigs::ImageLayer::mouseReleaseEvent(), SciFigs::LineLayer::mouseReleaseEvent(), NAModelsPlot::NAModelsPlot(), SciFigs::ImageLayer::redPassFilter(), HistogramWidget::setHistogram(), SciFigs::XYValueLines::setLinearPalette(), Seismic1DThread::setModelLimits(), MagnetoTelluricThread::setModelLimits(), SciFigs::XYValuePlot::setPalette(), SciFigs::XYValueLines::setPalette(), SciFigs::GridPlot::setPalette(), NAModelsPlot::setParamX(), NAModelsPlot::setParamY(), GeopsyGui::PickLayer::setPick(), SciFigs::GridPlot::setProperty(), SciFigs::NameLineLayer::setProperty(), GeopsyGui::ChronogramLayer::setProperty(), NAModelsPlot::setProperty(), SciFigs::XUniqueYColorLines::setProperty(), SciFigs::XYPlot::setProperty(), SciFigs::ColorPaletteWidget::setProperty(), SciFigs::XYColorLines::setProperty(), SciFigs::ImageLayer::setProperty(), GeopsyGui::SignalLayer::setProperty(), setTrackingAction(), GeopsyGui::SignalLayer::signalAt(), MonoStation::AbstractTool::signalMouseReleased(), GeopsyGui::SignalLayer::signalsUpdate(), GeopsyGui::SignalLayer::sigYBoundaries(), SciFigs::XYPlot::swapXY(), SciFigs::GridViewer::trackRectangle(), SciFigs::IrregularGrid2DPlot::trackRectangle(), SciFigs::LineLayer::trackRectangle(), GeopsyGui::SignalLayer::updateGrid(), GeopsyGui::TimeWindowLayer::xml_layerPolish(), SciFigs::LiveGridLayer::xml_writeChildren(), ChronogramWindow::~ChronogramWindow(), and GraphicWindow::~GraphicWindow().
{return reinterpret_cast<GraphContent *>(parent());}
| const GraphContent* SciFigs::GraphContentLayer::graphContent | ( | ) | const [inline] |
{return reinterpret_cast<const GraphContent *>(parent());}
| virtual bool SciFigs::GraphContentLayer::hasProperties | ( | ) | [inline, virtual] |
Reimplemented in GeopsyGui::SignalLayer, SciFigs::LineLayer, SciFigs::ImageLayer, SciFigs::LiveGridLayer, SciFigs::XYColorLines, SciFigs::XUniqueYColorLines, SciFigs::XYPlot, NAModelsPlot, GeopsyGui::ChronogramLayer, SciFigs::NameLineLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, GeopsyGui::PickLayer, SciFigs::GridPlot, and SciFigs::GridMaxFollower.
Referenced by SciFigs::GraphContent::addProperties().
{return false;}
| bool SciFigs::GraphContentLayer::isEditable | ( | ) | const [inline] |
Referenced by SciFigs::GraphContent::addProperties().
{return _isEditable;}
| bool SciFigs::GraphContentLayer::isMouseTracking | ( | int | id = 0 | ) | [protected] |
References graphContent(), and TRACE.
Referenced by SciFigs::ImageLayer::toggleTrackingAction(), SciFigs::LineLayer::toggleTrackingAction(), and toggleTrackingAction().
{
TRACE;
return graphContent()->isMouseTracking(this, id);
}
| bool SciFigs::GraphContentLayer::isRemovable | ( | ) | const [inline] |
Referenced by SciFigs::GraphContent::removeLayer(), and SciFigs::LayerPropertiesItem::removeLayers().
{return _referenceCount==0;}
| bool SciFigs::GraphContentLayer::isSelected | ( | ) | const [inline] |
Referenced by SciFigs::GraphContent::xml_writeChildren().
{return _isSelected;}
| virtual bool SciFigs::GraphContentLayer::keyPressEvent | ( | QKeyEvent * | e | ) | [inline, virtual] |
Reimplemented in GeopsyGui::SignalLayer, SciFigs::LineLayer, and GeopsyGui::PickLayer.
{Q_UNUSED(e); return true;}
| virtual bool SciFigs::GraphContentLayer::keyReleaseEvent | ( | QKeyEvent * | e | ) | [inline, virtual] |
{Q_UNUSED(e); return true;}
| void SciFigs::GraphContentLayer::lock | ( | ) | [inline] |
References _mutex, SciFigs::GraphContent::delayPainting(), and graphContent().
Referenced by SciFigs::LayerLocker::LayerLocker(), DinverDCGui::DCModelViewer::loadModels(), SignalViewer::lock(), PSViewer::lockPlots(), SciFigs::GraphContent::moveLayerDown(), SciFigs::GraphContent::moveLayerUp(), StatGridAnalyser::on_freqScroll_valueChanged(), SciFigs::GraphContent::removeLayer(), Simulator::setAllSources(), ArrayGui::ArrayResponse::setArray(), FKTimeWindows::setGrid(), and ProcessStatus::updateMisfitCurve().
{
if(_mutex.tryLock()) return;
// Else probably locked by a painting thread, these low priority threads can be terminated
// to allow this lock
graphContent()->delayPainting();
while(!_mutex.tryLock(10)) {}
}
| virtual void SciFigs::GraphContentLayer::mouseMoveEvent | ( | const QPoint & | pt, |
| Qt::MouseButtons | buttons, | ||
| Qt::KeyboardModifiers | modifiers | ||
| ) | [inline, virtual] |
Reimplemented in SciFigs::LineLayer, and GeopsyGui::PickLayer.
{
Q_UNUSED(pt);
Q_UNUSED(buttons);
Q_UNUSED(modifiers);
}
| virtual bool SciFigs::GraphContentLayer::mousePressEvent | ( | QMouseEvent * | e, |
| int | id = -1 |
||
| ) | [inline, virtual] |
Reimplemented in SciFigs::LineLayer, and GeopsyGui::PickLayer.
{Q_UNUSED(e); Q_UNUSED(id); return true;}
| virtual bool SciFigs::GraphContentLayer::mouseReleaseEvent | ( | QMouseEvent * | e, |
| int | id = -1 |
||
| ) | [inline, virtual] |
Reimplemented in SciFigs::LineLayer, GeopsyGui::PickLayer, SciFigs::ImageLayer, SciFigs::GridViewer, SciFigs::IrregularGrid2DPlot, and SciFigs::PolarGridPlot.
{Q_UNUSED(e); Q_UNUSED(id); return true;}
| qreal SciFigs::GraphContentLayer::opacity | ( | ) | const [inline] |
| void SciFigs::GraphContentLayer::paint | ( | const LayerPainterRequest & | lp, |
| QPainter & | p, | ||
| double | dotpercm | ||
| ) |
References lock(), opacity(), paintData(), TRACE, and unlock().
Referenced by SciFigs::XYColorPlot::paintData(), SciFigs::XYValuePlot::paintData(), and SciFigs::XYPlot::paintData().
{
TRACE;
if(opacity()==1.0) {
lock();
paintData(lp, p, dotpercm);
unlock();
} else if(opacity() > 0.0) {
p.save();
p.setOpacity(opacity());
// Opacity must be applied on the whole layer image not on individual painting operations
// So we first draw to a temporary pixmap with full opacity and then draw this pixmap with the
// appropriate opacity.
//QPixmap * pm=new QPixmap(w,h);
//QPainter ppx;
//ppx.begin(pm);
//ppx.fillRect(0,0,w,h,Qt::white);
lock();
paintData(lp, p, dotpercm);
unlock();
//ppx.end();
//p.drawPixmap(0,0,*pm);
//delete pm;
p.restore();
}
}
| virtual void SciFigs::GraphContentLayer::paintData | ( | const LayerPainterRequest & | lp, |
| QPainter & | p, | ||
| double | dotpercm | ||
| ) | const [protected, pure virtual] |
Implemented in GeopsyGui::SignalLayer, SciFigs::ImageLayer, SciFigs::XYColorLines, SciFigs::LiveGridLayer, SciFigs::XUniqueYColorLines, SciFigs::LineLayer, SciFigs::XYPlot, GeopsyGui::PickLayer, SciFigs::NameLineLayer, SciFigs::ParallelBands, NAModelsPlot, GeopsyGui::ChronogramLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, SciFigs::IrregularGrid2DPlot, SciFigs::GridViewer, SciFigs::SlopeEstimator, SciFigs::ColorPaletteLayer, SciFigs::CircleViewer, SciFigs::XYColorPlot, SciFigs::HistogramLayer, SciFigs::PolarGridPlot, FKMeshLayer, and SciFigs::CircleMask.
Referenced by paint().
| void SciFigs::GraphContentLayer::paintText | ( | const LayerPainterRequest & | lp, |
| double | dotpercm | ||
| ) | [inline, virtual] |
Reimplemented in GeopsyGui::PickLayer, SciFigs::NameLineLayer, and SciFigs::SlopeEstimator.
References TRACE.
{
TRACE;
Q_UNUSED(lp);
Q_UNUSED(dotpercm);
}
| virtual void SciFigs::GraphContentLayer::properties | ( | PropertyWidget * | ) | const [inline, virtual] |
Implements QGpGuiTools::PropertyItem.
Reimplemented in GeopsyGui::SignalLayer, SciFigs::ImageLayer, SciFigs::LiveGridLayer, SciFigs::XYColorLines, SciFigs::XUniqueYColorLines, SciFigs::XYPlot, NAModelsPlot, GeopsyGui::ChronogramLayer, SciFigs::NameLineLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, GeopsyGui::PickLayer, and SciFigs::GridPlot.
{}
| virtual void SciFigs::GraphContentLayer::removeProperties | ( | PropertyProxy * | ) | [inline, virtual] |
Reimplemented in GeopsyGui::SignalLayer, SciFigs::LineLayer, SciFigs::ImageLayer, SciFigs::LiveGridLayer, SciFigs::XYColorLines, SciFigs::XUniqueYColorLines, SciFigs::XYPlot, NAModelsPlot, GeopsyGui::ChronogramLayer, SciFigs::NameLineLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, GeopsyGui::PickLayer, and SciFigs::GridPlot.
Referenced by SciFigs::GraphContent::removeLayer().
{}
| void SciFigs::GraphContentLayer::removeReference | ( | ) | [inline] |
Referenced by SciFigs::GraphContent::xml_member(), and GeopsyGui::TimeWindowLayer::~TimeWindowLayer().
{_referenceCount--; ASSERT(_referenceCount>=0);}
| void SciFigs::GraphContentLayer::setEditable | ( | bool | r | ) | [inline] |
Referenced by ArrayGui::ArrayResponse::createObjects(), and SciFigs::CurveBrowser::initLayer().
{_isEditable=r;}
| void SciFigs::GraphContentLayer::setOpacity | ( | qreal | o | ) |
References _opacity, and TRACE.
Referenced by FKMeshLayer::FKMeshLayer(), SciFigs::GridPlot::GridPlot(), HistogramWidget::HistogramWidget(), Simulator::init(), MainWidget::MainWidget(), SciFigs::LayerPropertiesItem::setData(), StatGridAnalyser::setGrid(), DinverDCGui::EllipticityViewer::setTarget(), Results::setThreshold(), MonoStation::StationResults::setVisibleLayers(), DinverDCGui::EllipticityViewer::showTarget(), DinverDCGui::DCModelViewer::showTarget(), and MonoStation::WinResultsOptions::visibleLayers().
| void SciFigs::GraphContentLayer::setParent | ( | GraphContent * | parent | ) | [virtual] |
Set parent has no effect if the layer has already a parent (i.e. already inserted in a layer stack). This function is mainly called by the xml restore where layer objects are created without parent.
If you re-implement this function you must explicitely call it from your contructor otherwise your function won't be executed when the layer is created with a non null parent (normal way).
Reimplemented in NAModelsPlot.
Referenced by SciFigs::GraphContent::addLayer().
{
if(!QObject::parent()) QObject::setParent(parent);
}
| virtual void SciFigs::GraphContentLayer::setProperty | ( | uint | , |
| int | , | ||
| QVariant | |||
| ) | [inline, virtual] |
Implements QGpGuiTools::PropertyItem.
Reimplemented in GeopsyGui::SignalLayer, SciFigs::ImageLayer, SciFigs::LiveGridLayer, SciFigs::XYColorLines, SciFigs::XUniqueYColorLines, SciFigs::XYPlot, NAModelsPlot, GeopsyGui::ChronogramLayer, SciFigs::NameLineLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, GeopsyGui::PickLayer, SciFigs::GridPlot, and SignalDisplay.
{}
| void SciFigs::GraphContentLayer::setSelected | ( | bool | s | ) | [inline] |
Referenced by SciFigs::LayerPropertiesItem::selectAllLayers().
{_isSelected=s;}
| void SciFigs::GraphContentLayer::setTrackingAction | ( | int | id, |
| bool | checked | ||
| ) |
Convenient function to switch on/off a tracking action
References graphContent(), and TRACE.
{
TRACE;
GraphContent * gc=graphContent();
QList<QAction *> alist=gc->actions();
for(QList<QAction *>::iterator it=alist.begin(); it!= alist.end(); it++) {
QAction * a=*it;
if(a->data().toInt()==id) {
a->setChecked(checked);
return;
}
}
}
| void SciFigs::GraphContentLayer::toggleTrackingAction | ( | bool | checked, |
| int | id = -1 |
||
| ) | [virtual, slot] |
Reimplemented in SciFigs::LineLayer, and SciFigs::ImageLayer.
References beginMouseTracking(), endMouseTracking(), isMouseTracking(), SciFigs::LayerMouseTracking::setId(), SciFigs::LayerMouseTracking::setIdleCursor(), SciFigs::LayerMouseTracking::setRectangle(), SciFigs::LayerMouseTracking::showRectangle(), and TRACE.
Referenced by addTrackingAction().
{
TRACE;
if(id==-1) {
QAction * a=qobject_cast<QAction *>(sender());
if(!a) return;
id=a->data().toInt();
}
if(checked) {
if(!isMouseTracking(id)) {
LayerMouseTracking mt(this);
mt.setId(id);
mt.setIdleCursor(QPixmap(":/images/selectcursor.png"), 4, 4);
mt.setRectangle(true);
mt.showRectangle();
beginMouseTracking(mt);
}
} else {
if(isMouseTracking(id)) {
endMouseTracking(id);
}
}
}
| QString SciFigs::GraphContentLayer::trackingActionCtrlHelp | ( | ) | [static] |
References QGpCoreTools::tr().
Referenced by addTrackingAction().
{
return tr(" Hold CTRL to deactive temporarily this mode.");
}
| bool SciFigs::GraphContentLayer::trackRectangle | ( | int | id, |
| double | rx1, | ||
| double | ry1, | ||
| double | rx2, | ||
| double | ry2, | ||
| Qt::KeyboardModifiers | m | ||
| ) | [inline, virtual] |
Reimplemented in SciFigs::LineLayer, GeopsyGui::ChronogramLayer, SciFigs::XYColorLines, SciFigs::XYPlot, SciFigs::XUniqueYColorLines, SciFigs::ImageLayer, SciFigs::ParallelBands, SciFigs::GridViewer, and SciFigs::IrregularGrid2DPlot.
References TRACE.
{
TRACE;
Q_UNUSED(id);
Q_UNUSED(rx1);
Q_UNUSED(ry1);
Q_UNUSED(rx2);
Q_UNUSED(ry2);
Q_UNUSED(m);
return false;
}
| void SciFigs::GraphContentLayer::unlock | ( | ) | [inline] |
Referenced by DinverDCGui::DCModelViewer::loadModels(), SciFigs::GraphContent::moveLayerDown(), SciFigs::GraphContent::moveLayerUp(), StatGridAnalyser::on_freqScroll_valueChanged(), paint(), SciFigs::GraphContent::removeLayer(), Simulator::setAllSources(), ArrayGui::ArrayResponse::setArray(), FKTimeWindows::setGrid(), SciFigs::LayerLocker::unlock(), SignalViewer::unlock(), PSViewer::unlockPlots(), ProcessStatus::updateMisfitCurve(), and SciFigs::LayerLocker::~LayerLocker().
{_mutex.unlock();}
| virtual bool SciFigs::GraphContentLayer::wheelEvent | ( | QWheelEvent * | e | ) | [inline, virtual] |
Reimplemented in GeopsyGui::SignalLayer, and SciFigs::LineLayer.
{Q_UNUSED(e); return true;}
| virtual void SciFigs::GraphContentLayer::xml_layerPolish | ( | XML_POLISH_ARGS | ) | [inline, virtual] |
Reimplemented in GeopsyGui::TimeWindowLayer.
{Q_UNUSED(context);}
| XMLMember SciFigs::GraphContentLayer::xml_member | ( | XML_MEMBER_ARGS | ) | [protected, virtual] |
Re-implement this function to offer XML restore (children and properties) support to your class.
From tag and map (with contains the attibute value) return a unique identifier under the format of a XMLMember. XMLMember is initialized with 3 types of contructors:
Map of attributes can be inspected in this way (can be achived also in xml_setProperty()):
static const QString tmp("childrenName"); XMLRestoreAttributeIterator it=map.find(tmp); if(it!=map.end()) { // found attribute "childrenName" }
If the map of attributes is not used:
Q_UNUSED(attributes);
if(tag=="x1") return XMLMember(0);
else if(tag=="y1") return XMLMember(1);
else if(tag=="x2") return XMLMember(2);
else if(tag=="y2") return XMLMember(3);
else return XMLMember(XMLMember::Unknown);
Arithmetic operations + and - apply to XMLMember to avoid confusion of property id numbers between inherited objects. Offset 3 corresponds to the number of properties defined in this object.
if(tag=="anInteger") return XMLMember(0); else if(tag=="aString") return XMLMember(1); else if(tag=="aDouble") return XMLMember(2); return AbstractLine::xml_member(tag, attributes, context)+3;
For the arguments of this function use Macro XML_MEMBER_ARGS.
Reimplemented from QGpCoreTools::XMLClass.
Reimplemented in GeopsyGui::SignalLayer, SciFigs::ImageLayer, SciFigs::LineLayer, SciFigs::GridPlot, SciFigs::CircleViewer, GeopsyGui::PickLayer, NAModelsPlot, SciFigs::ParallelBands, GeopsyGui::ChronogramLayer, SciFigs::XYValueLines, SciFigs::XYValuePlot, GeopsyGui::TimeWindowLayer, SciFigs::GridViewer, and SciFigs::HistogramLayer.
References SciFigs::XMLSciFigs::makeUp(), QGpCoreTools::XMLClass::qobject_member(), and TRACE.
{
TRACE;
XMLSciFigs * scifigsContext=static_cast<XMLSciFigs *>(context);
if(scifigsContext->makeUp()) {
return qobject_member(this, tag, attributes, context);
}
return XMLMember(XMLMember::Unknown);
}
| virtual bool SciFigs::GraphContentLayer::xml_setProperty | ( | XML_SETPROPERTY_ARGS | ) | [inline, protected, virtual] |
Re-implement this function to offer XML restore properties support to your class.
From memberID set the corresponding property with value content. The map of attributes is given as a supplementary information (not useful in all cases).
For a general case:
Q_UNUSED(attributes); double val=content.toDouble(); switch (memberID) { case 0: _x1=val; return true; case 1: _y1=val; return true; case 2: _x2=val; return true; case 3: _y2=val; return true; default: return false; }
For classes inheriting other classes (see also xml_member())
switch (memberID) { case 0: _anInteger=content.toString(); return true; case 1: _aString=content.toInt(); return true; case 2: _aDouble=content.toDouble(); return true; default: return AbstractLine::xml_setProperty(memberID-3, map, content);
For the arguments of this function use Macro XML_SETPROPERTY_ARGS.
Reimplemented from QGpCoreTools::XMLClass.
Reimplemented in GeopsyGui::SignalLayer, SciFigs::LineLayer, SciFigs::CircleViewer, NAModelsPlot, GeopsyGui::TimeWindowLayer, and SciFigs::HistogramLayer.
{return qobject_setProperty(this, memberID, tag, attributes, content, context);}
| virtual const QString& SciFigs::GraphContentLayer::xml_tagName | ( | ) | const [inline, virtual] |
Implements QGpCoreTools::XMLClass.
Reimplemented in GeopsyGui::SignalLayer, SciFigs::LineLayer, SciFigs::ImageLayer, GeopsyGui::TimeWindowLayer, SciFigs::GridPlot, SciFigs::XYPlot, SciFigs::XYColorLines, GeopsyGui::PickLayer, SciFigs::LiveGridLayer, SciFigs::NameLineLayer, GeopsyGui::ChronogramLayer, NAModelsPlot, SciFigs::XUniqueYColorLines, SciFigs::GridViewer, SciFigs::IrregularGrid2DPlot, SciFigs::ParallelBands, SciFigs::HistogramLayer, SciFigs::SlopeEstimator, SciFigs::XYValueLines, SciFigs::XYValuePlot, SciFigs::CircleViewer, SciFigs::ColorPaletteLayer, SciFigs::XYColorPlot, and SciFigs::CircleMask.
Referenced by SciFigs::LayerPropertiesItem::data(), and SciFigs::GraphContent::findLayer().
{return xmlGraphContentLayerTag;}
| void SciFigs::GraphContentLayer::xml_writeProperties | ( | XML_WRITEPROPERTIES_ARGS | ) | const [protected, virtual] |
Reimplemented from QGpCoreTools::XMLClass.
Reimplemented in GeopsyGui::SignalLayer, SciFigs::ImageLayer, SciFigs::XYColorLines, SciFigs::XUniqueYColorLines, SciFigs::CircleViewer, SciFigs::XYPlot, NAModelsPlot, GeopsyGui::TimeWindowLayer, and SciFigs::HistogramLayer.
References SciFigs::XMLSciFigs::makeUp(), QGpCoreTools::XMLClass::qobject_writeProperties(), and TRACE.
Referenced by GeopsyGui::PickLayer::xml_writeChildren().
{
TRACE;
XMLSciFigs * scifigsContext=static_cast<XMLSciFigs *>(context);
if(scifigsContext->makeUp()) {
qobject_writeProperties(this, this, s, context);
}
}
uint SciFigs::GraphContentLayer::_isEditable [protected] |
Referenced by GraphContentLayer().
uint SciFigs::GraphContentLayer::_isSelected [protected] |
Referenced by GraphContentLayer().
QMutex SciFigs::GraphContentLayer::_mutex [mutable, protected] |
Referenced by lockDelayPainting().
qreal SciFigs::GraphContentLayer::_opacity [protected] |
Referenced by GraphContentLayer(), and setOpacity().
int SciFigs::GraphContentLayer::_referenceCount [protected] |
Referenced by GraphContentLayer().
const QString SciFigs::GraphContentLayer::xmlGraphContentLayerTag = "GraphContentLayer" [static] |
QString SciFigs::GraphContentLayer::name [read, write] |
Referenced by SciFigs::ColorPaletteLayer::coordinateTipInfo().
QString SciFigs::GraphContentLayer::objectName [read, write] |
qreal SciFigs::GraphContentLayer::opacity [read, write] |