The Axis widget provides the basic properties of an axis. More...
#include <Axis.h>
Public Types | |
enum | Orientation { North = 0, South, East, West } |
enum | SizeType { TotalSize = 0, AxisSize, Scaled } |
Public Slots | |
void | setMouseTrack (bool t) |
void | trackMouse (QPoint mouseP) |
Signals | |
void | contentChanged () |
void | lengthChanged () |
void | orientationChanged () |
void | positionChanged () |
void | rangeChanged () |
void | sizeChanged () |
Public Member Functions | |
void | addProperties (PropertyProxy *pp) |
void | addStringLabel (QString lab, bool updadeScale=true) |
bool | autoPrecision () const |
bool | autoTicks () const |
Axis (QWidget *parent=0) | |
Rect | boundingRect () const |
int | currentInversedNumberPrecision () const |
QString | currentInversedTitle () const |
int | currentLine () const |
int | currentNumberPrecision () const |
QString | currentTitle () const |
QString | fontString () const |
bool | isEffectivelyReversed () const |
bool | isMouseTrack () |
bool | isZoomed () |
int | lastMousePosition () |
int | lineCount () const |
double | lineWeight () const |
double | majorTicks () const |
double | maximum () const |
double | minimum () const |
double | minorTicks () const |
int | numberPrecision () const |
int | numberPrecisionInversedScale () const |
Number::Type | numberType () const |
QString | numberTypeString () const |
void | operator= (const Axis &o) |
Orientation | orientation () const |
QString | orientationString () const |
void | paint (QPainter &p, double dotpercm, int w, int h, bool mask) |
int | printThickness (int length, double dotpercm, QPainter *p=0) |
virtual void | properties (PropertyWidget *w) const |
Q_ENUMS (PrintScaleType) | |
void | removeProperties (PropertyProxy *pp) |
void | removeStringLabels () |
bool | reversedScale () const |
Scale::Type | scaleType () const |
QString | scaleTypeString () const |
void | setAutoPrecision (bool p) |
void | setAutoTicks (bool m) |
void | setCurrentInversedNumberPrecision (int p) |
void | setCurrentInversedTitle (QString s) |
void | setCurrentLine (int line) |
void | setCurrentNumberPrecision (int p) |
void | setCurrentTitle (QString s) |
void | setFontString (QString fs) |
void | setGraphContent (GraphContent *gc) |
void | setLineWeight (double val) |
void | setMajorTicks (double m) |
void | setMaximum (double m) |
void | setMinimum (double m) |
void | setMinorTicks (double m) |
void | setNumberPrecision (int p) |
void | setNumberPrecisionInversedScale (int np) |
void | setNumberType (Number::Type t) |
void | setNumberType (QString t) |
void | setOrientation (Orientation o) |
void | setOrientationBlocked (bool b) |
void | setOrientationString (QString o) |
void | setPrintScale (int w, int h) |
virtual void | setProperty (uint wid, int pid, QVariant val) |
void | setRange (double min, double max) |
void | setReversedScale (bool b) |
void | setScaleType (Scale::Type s) |
void | setScaleType (QString t) |
void | setShowLabels (bool m) |
void | setSizeInfo (double s) |
void | setSizeType (SizeType st) |
void | setSizeType (QString st) |
void | setStringLabels (QString s) |
void | setTickSize (double val) |
void | setTitle (QString s) |
void | setTitleInversedScale (QString s) |
void | setUnitFactor (double s) |
void | setVisibleRange (double val1, double val2) |
void | setVisibleRange (bool zoomed) |
void | setZoomEnabled (bool m) |
bool | showLabels () const |
double | sizeInfo () const |
SizeType | sizeType () const |
QString | sizeTypeString () const |
QString | stringLabels () const |
double | tickSize () const |
QString | title () const |
QString | titleInversedScale () const |
double | unitFactor () const |
double | visibleMaximum () const |
double | visibleMinimum () const |
virtual const QString & | xml_tagName () const |
bool | zoomEnabled () const |
~Axis () | |
Static Public Attributes | |
static const QString | xmlAxisTag = "Axis" |
Protected Member Functions | |
virtual XMLMember | xml_member (XML_MEMBER_ARGS) |
virtual bool | xml_setProperty (XML_SETPROPERTY_ARGS) |
virtual void | xml_writeProperties (XML_WRITEPROPERTIES_ARGS) const |
Properties | |
bool | autoLabel |
bool | autoPrec |
bool | autoPrecision |
bool | autoTicks |
DUMMY_PROPERTIES | |
QString | font |
int | inversedNumberPrecision |
int | inversedNumPrec |
QString | inversedTitle |
double | label |
double | lineWeight |
double | majorTicks |
double | max |
double | min |
double | minorTicks |
QString | name |
int | numberPrecision |
QString | numberType |
int | numPrec |
QString | numType |
QString | objectName |
QString | orientation |
QString | position |
double | printLengthInfo |
double | printLineWeight |
QString | printScaleType |
double | printTickLength |
bool | reversedScale |
QString | scaleType |
bool | showLabels |
double | sizeInfo |
QString | sizeType |
QString | stringLabels |
double | tick |
double | tickSize |
QString | title |
double | unitFactor |
bool | visible |
bool | zoomBlocked |
bool | zoomEnabled |
The Axis widget provides the basic properties of an axis.
The main properties are the minimum (minVal()) and maximum (maxVal()) values corresponding the end-points of the axis (expressed in real units). The axis support normal, log and inversed scales (scaleType()). The direction of the axis may be reversed (reversedScale()). position() manage the position of the axis relative to the GraphContent (left or right, and top or bottom).
label() and tick() returns the interval for plotting the labels and the secondary ticks, respectively.
numtype(), numprec(), numberPrecisionInversedScale(), title(), titleInversedScale(), and font() define the aspect of the axis title and of the labels. The labels may be defined by a list of names contained managed by stringLabels(), addStringLabel(), removeStringLabels(). In this case, labels are placed at integer values along the axis (0, 1, ...). The minimum and maximum values must be set accordingly.
Conversions between real units and screen or media (printer, ps, image, ...) units are performed with r2s() and s2r().
visMin() and visMax() return the current visible range if zooming is on. When no zoom is active, visMin() and visMax() are equal to minVal() and maxVal(). The zoom can be disabled by using zoomEnabled() and setZoomEnabled().
SciFigs::Axis::Axis | ( | QWidget * | parent = 0 | ) |
Construct an axis generally not called directly, use either HorizontalAxis or VerticalAxis
References North, QGpGuiTools::setWidgetColor(), TotalSize, and TRACE.
: QWidget(parent) { TRACE; setWidgetColor(this, Qt::white); setMouseTracking(true); _lastMousePosition=0; _mouseTrack=false; _stringLabels=0; _orientation=North; _orientationBlocked=false; _showLabels=true; _numberType=Number::Fixed; _numberPrecision=0; _unitFactor=1.0; _autoPrecision=true; _numberPrecisionInversedScale=1; _zoomEnabled=true; _autoTicks=true; _sizeType=TotalSize; _sizeInfo=5; _lineWeight=0.1; _tickSize=2; _content=0; }
void SciFigs::Axis::addProperties | ( | PropertyProxy * | pp | ) |
References QGpGuiTools::PropertyProxy::addReference(), QGpGuiTools::PropertyProxy::addTab(), QGpGuiTools::PropertyProxy::currentTabWidget(), SciFigs::AxisScaleProperties::setCurrentAxis(), QGpGuiTools::PropertyProxy::setCurrentTab(), QGpCoreTools::tr(), and TRACE.
Referenced by SciFigs::AxisWindow::addProperties(), and SciFigs::ColorPaletteWidget::addProperties().
{ TRACE; if(pp->setCurrentTab(_tabScale)) { pp->addReference(this); AxisScaleProperties * w=static_cast<AxisScaleProperties *>(pp->currentTabWidget()); w->setCurrentAxis(this); } else { AxisScaleProperties * w=new AxisScaleProperties; pp->addTab(_tabScale, tr("Scale"), w, this); w->setCurrentAxis(this); } if(pp->setCurrentTab(_tabFormat)) { pp->addReference(this); } else { AxisFormatProperties * w=new AxisFormatProperties; pp->addTab(_tabFormat, tr("Format"), w, this); } }
void SciFigs::Axis::addStringLabel | ( | QString | lab, |
bool | updadeScale = true |
||
) |
References SciFigs::Scale::autoTicks(), setRange(), and TRACE.
Referenced by MainWidget::MainWidget(), SignalViewer::setSignals(), setStringLabels(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
{ TRACE; if( !_stringLabels) { _stringLabels=new QVector<QString>; } _stringLabels->append(lab); if(updadeScale) { setRange(0.5, (double) _stringLabels->count() + 0.5); if(_autoTicks) scale().autoTicks(_numberType); } }
bool SciFigs::Axis::autoPrecision | ( | ) | const [inline] |
Referenced by properties(), setProperty(), and setScaleType().
{return _autoPrecision;}
bool SciFigs::Axis::autoTicks | ( | ) | const [inline] |
Referenced by properties(), setProperty(), and setScaleType().
{return _autoTicks;}
Rect SciFigs::Axis::boundingRect | ( | ) | const |
References SciFigs::GraphContent::boundingRect(), and TRACE.
{ TRACE; return _content->boundingRect(); }
void SciFigs::Axis::contentChanged | ( | ) | [signal] |
Referenced by setProperty().
int SciFigs::Axis::currentInversedNumberPrecision | ( | ) | const |
References SciFigs::Scale::Inversed, numberPrecision(), numberPrecisionInversedScale(), and TRACE.
{ TRACE; if(constScale().type()==Scale::Inversed) return numberPrecision(); else return numberPrecisionInversedScale(); }
QString SciFigs::Axis::currentInversedTitle | ( | ) | const |
References SciFigs::Scale::Inversed, title(), titleInversedScale(), and TRACE.
{ TRACE; if(constScale().type()==Scale::Inversed) return title(); else return titleInversedScale(); }
int SciFigs::Axis::currentLine | ( | ) | const |
References East, SciFigs::Scale::horizontalCurrentLine(), North, South, SciFigs::Scale::verticalCurrentLine(), and West.
Referenced by SciFigs::AxisWindow::browse(), and SciFigs::AxisWindow::updateScrollBars().
int SciFigs::Axis::currentNumberPrecision | ( | ) | const |
References SciFigs::Scale::Inversed, numberPrecision(), numberPrecisionInversedScale(), and TRACE.
Referenced by printThickness(), and properties().
{ TRACE; if(constScale().type()==Scale::Inversed) return numberPrecisionInversedScale(); else return numberPrecision(); }
QString SciFigs::Axis::currentTitle | ( | ) | const |
References SciFigs::Scale::Inversed, title(), titleInversedScale(), and TRACE.
Referenced by printThickness(), and properties().
{ TRACE; if(constScale().type()==Scale::Inversed) return titleInversedScale(); else return title(); }
QString SciFigs::Axis::fontString | ( | ) | const [inline] |
{return font().toString();}
bool SciFigs::Axis::isEffectivelyReversed | ( | ) | const [inline] |
{return constScale().isEffectivelyReversed();}
bool SciFigs::Axis::isMouseTrack | ( | ) | [inline] |
{return _mouseTrack;}
bool SciFigs::Axis::isZoomed | ( | ) | [inline] |
Return true if the visible range is smaller than the [min, max] range, i.e. zoomed range.
References SciFigs::Scale::globalMaximum(), SciFigs::Scale::globalMinimum(), SciFigs::Scale::maximum(), SciFigs::Scale::minimum(), and TRACE.
Referenced by SciFigs::AxisWindow::setMapScale(), setProperty(), and setRange().
{ TRACE; return constScale().globalMinimum() < constScale().minimum() || constScale().maximum() < constScale().globalMaximum(); }
int SciFigs::Axis::lastMousePosition | ( | ) | [inline] |
Referenced by GeopsyGui::PickLayer::paintData(), and GraphicWindow::setMagnifySignal().
{return _lastMousePosition;}
void SciFigs::Axis::lengthChanged | ( | ) | [signal] |
int SciFigs::Axis::lineCount | ( | ) | const [inline] |
Referenced by SciFigs::AxisWindow::updateScrollBars().
{return constScale().lineCount();}
double SciFigs::Axis::lineWeight | ( | ) | const [inline] |
Referenced by properties().
{return _lineWeight;}
double SciFigs::Axis::majorTicks | ( | ) | const [inline] |
Referenced by properties().
{return constScale().majorTicks();}
double SciFigs::Axis::maximum | ( | ) | const [inline] |
Return the maximum value of the axis.
Referenced by SciFigs::AxisWindow::checkZoomRects(), DinverDCGui::GroundModelViewer::minMaxProfiles(), properties(), SignalViewer::setDisplayRange(), SciFigs::ActivityMonitor::setDisplayRange(), SignalViewer::setMaximumTime(), setProperty(), setScaleType(), MagnifierSignal::setSignal(), MagnifierSignal::setTime(), LinearFKActiveResults::stackGrids(), and SciFigs::AxisWindow::xml_polish().
{return constScale().globalMaximum();}
double SciFigs::Axis::minimum | ( | ) | const [inline] |
Return the minimum value of the axis.
Referenced by SciFigs::AxisWindow::checkZoomRects(), DinverDCGui::GroundModelViewer::minMaxProfiles(), properties(), SignalViewer::setMaximumTime(), setProperty(), setScaleType(), MagnifierSignal::setSignal(), MagnifierSignal::setTime(), LinearFKActiveResults::stackGrids(), and SciFigs::AxisWindow::xml_polish().
{return constScale().globalMinimum();}
double SciFigs::Axis::minorTicks | ( | ) | const [inline] |
Referenced by properties().
{return constScale().minorTicks();}
int SciFigs::Axis::numberPrecision | ( | ) | const [inline] |
Referenced by currentInversedNumberPrecision(), currentNumberPrecision(), and printThickness().
{return _numberPrecision;}
int SciFigs::Axis::numberPrecisionInversedScale | ( | ) | const [inline] |
Referenced by currentInversedNumberPrecision(), and currentNumberPrecision().
{return _numberPrecisionInversedScale;}
Number::Type SciFigs::Axis::numberType | ( | ) | const [inline] |
Referenced by properties(), and setProperty().
{return _numberType;}
QString SciFigs::Axis::numberTypeString | ( | ) | const |
{ switch(_numberType) { case Number::Fixed: return "Fixed"; case Number::Scientific: return "Scientific"; case Number::Weeks: return "Weeks"; case Number::Days: return "Days"; case Number::Hours: return "Hours"; case Number::Minutes: return "Minutes"; case Number::Seconds: return "Seconds"; } return "Fixed"; }
void SciFigs::Axis::operator= | ( | const Axis & | o | ) |
References font, rangeChanged(), setOrientation(), sizeChanged(), and TRACE.
{ TRACE; setOrientation(o._orientation); scale()=o.constScale(); _showLabels=o._showLabels; _numberType=o._numberType; _numberPrecision=o._numberPrecision; _unitFactor=o._unitFactor; _autoPrecision=o._autoPrecision; _numberPrecisionInversedScale=o._numberPrecisionInversedScale; _zoomEnabled=o._zoomEnabled; _autoTicks=o._autoTicks; _title=o._title; _titleInversedScale=o._titleInversedScale; _sizeType=o._sizeType; _sizeInfo=o._sizeInfo; _lineWeight=o._lineWeight; _tickSize=o._tickSize; setFont(o.font()); emit rangeChanged(); if(_autoPrecision) calculatePrecicion(); emit sizeChanged(); }
Orientation SciFigs::Axis::orientation | ( | ) | const [inline] |
Referenced by properties().
{return _orientation;}
void SciFigs::Axis::orientationChanged | ( | ) | [signal] |
Referenced by setOrientation().
QString SciFigs::Axis::orientationString | ( | ) | const |
void SciFigs::Axis::paint | ( | QPainter & | p, |
double | dotpercm, | ||
int | w, | ||
int | h, | ||
bool | mask | ||
) |
void SciFigs::Axis::positionChanged | ( | ) | [signal] |
int SciFigs::Axis::printThickness | ( | int | length, |
double | dotpercm, | ||
QPainter * | p = 0 |
||
) |
Compute thickness of axis from a fixed length
References currentNumberPrecision(), currentTitle(), East, font, SciFigs::Scale::globalMaximum(), SciFigs::Scale::globalMinimum(), SciFigs::Scale::Inversed, MAX_INT, North, numberPrecision(), South, str, TRACE, SciFigs::Scale::type(), and West.
{ TRACE; const Scale& scl=constScale(); QFontMetrics f(font()); if(p) p->setFont(font()); QString str; QRect r; int maxThickness=0; int numberPrecision=currentNumberPrecision(); switch (_orientation) { case North: case South: if(_showLabels) { if(_stringLabels) { for(int i=_stringLabels->count() - 1;i >= 0;i-- ) { str=( *_stringLabels) [ i ]; if(p) r=p->boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); else r=f.boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); if(r.height() > maxThickness) maxThickness=r.height(); } } else { if(scl.globalMaximum()!=1e99) { if(scl.type()==Scale::Inversed) str=Number::toString(1.0/(constScale().globalMaximum()*_unitFactor), _numberType, numberPrecision); else str=Number::toString(constScale().globalMaximum()*_unitFactor, _numberType, numberPrecision); } else str=Number::toString(100.0*_unitFactor, _numberType, numberPrecision); if(p) r=p->boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); else r=f.boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); maxThickness=r.height(); if(scl.globalMinimum()!=-1e99) { if(scl.type()==Scale::Inversed) str=Number::toString(1.0/(constScale().globalMinimum() * _unitFactor), _numberType, numberPrecision); else str=Number::toString(constScale().globalMinimum()*_unitFactor, _numberType, numberPrecision); } else str=Number::toString(100.0*_unitFactor, _numberType, numberPrecision); if(p) r=p->boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); else r=f.boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); if(r.height() > maxThickness) maxThickness=r.height(); } } maxThickness += (int) round(( _tickSize + _lineWeight) * dotpercm * 0.1); // title str=currentTitle(); if(str.length() > 0) { if(p) r=p->boundingRect(0, 0, length, MAX_INT, Qt::AlignHCenter | Qt::AlignTop | Qt::TextWordWrap, str); else r=f.boundingRect(0, 0, length, MAX_INT, Qt::AlignHCenter | Qt::AlignTop | Qt::TextWordWrap, str); maxThickness += (int) r.height(); } break; case East: case West: if(_showLabels) { if(_stringLabels) { for(int i=_stringLabels->count() - 1;i >= 0;i-- ) { str=( *_stringLabels) [ i ]; if(p) r=p->boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); else r=f.boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); if(r.width() > maxThickness) maxThickness=r.width(); } } else { if(scl.globalMaximum()!=1e99) { if(scl.type()==Scale::Inversed) str=Number::toString(1.0/(constScale().globalMaximum() * _unitFactor), _numberType, numberPrecision ); else str=Number::toString(constScale().globalMaximum() * _unitFactor, _numberType, numberPrecision); } else str=Number::toString(100.0 * _unitFactor, _numberType, numberPrecision); if(p) r=p->boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); else r=f.boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); maxThickness=r.width(); if(scl.globalMinimum()!=-1e99) { if(scl.type()==Scale::Inversed) str=Number::toString(1.0/(constScale().globalMinimum() * _unitFactor), _numberType, numberPrecision); else str=Number::toString(constScale().globalMinimum() * _unitFactor, _numberType, numberPrecision); } else str=Number::toString(0.0, _numberType, numberPrecision); if(p) r=p->boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); else r=f.boundingRect(0, 0, MAX_INT, MAX_INT, Qt::AlignLeft | Qt::AlignTop, str); if(r.width() > maxThickness) maxThickness=r.width(); } } maxThickness += (int) round(( _tickSize + _lineWeight) * dotpercm * 0.1); // title str=currentTitle(); if(str.length() > 0) { if(p) r=p->boundingRect(0, 0, length, MAX_INT, Qt::AlignHCenter | Qt::AlignTop | Qt::TextWordWrap, str); else r=f.boundingRect(0, 0, length, MAX_INT, Qt::AlignHCenter | Qt::AlignTop | Qt::TextWordWrap, str); maxThickness += r.height(); } break; } return maxThickness; }
void SciFigs::Axis::properties | ( | PropertyWidget * | w | ) | const [virtual] |
Implements QGpGuiTools::PropertyItem.
References SciFigs::AxisFormatProperties::Autoprecision, autoPrecision(), SciFigs::AxisScaleProperties::AutoTicks, autoTicks(), currentNumberPrecision(), currentTitle(), SciFigs::AxisFormatProperties::Font, font, QGpGuiTools::PropertyWidget::id(), SciFigs::Scale::Inversed, SciFigs::AxisFormatProperties::LineWeight, lineWeight(), SciFigs::AxisScaleProperties::MajorTicks, majorTicks(), maximum(), SciFigs::AxisScaleProperties::MaximumValue, minimum(), SciFigs::AxisScaleProperties::MinimumValue, SciFigs::AxisScaleProperties::MinorTicks, minorTicks(), SciFigs::AxisFormatProperties::NumberPrecision, SciFigs::AxisFormatProperties::NumberType, numberType(), SciFigs::AxisFormatProperties::numberType2item(), SciFigs::AxisFormatProperties::Orientation, orientation(), SciFigs::AxisFormatProperties::orientation2item(), SciFigs::AxisScaleProperties::ReversedScale, reversedScale(), SciFigs::AxisScaleProperties::ScaleType, scaleType(), SciFigs::AxisScaleProperties::scaleType2item(), QGpGuiTools::PropertyWidget::setValue(), SciFigs::AxisScaleProperties::ShowLabels, showLabels(), SciFigs::AxisScaleProperties::SizeInfo, sizeInfo(), SciFigs::AxisScaleProperties::SizeType, sizeType(), SciFigs::AxisScaleProperties::sizeType2item(), SciFigs::AxisFormatProperties::TickSize, tickSize(), SciFigs::AxisFormatProperties::Title, TRACE, SciFigs::AxisFormatProperties::UnitFactor, unitFactor(), SciFigs::AxisScaleProperties::ZoomEnabled, and zoomEnabled().
{ TRACE; if(w->id()==_tabScale) { if(scaleType()==Scale::Inversed) { w->setValue(AxisScaleProperties::MinimumValue, 1.0/maximum()); w->setValue(AxisScaleProperties::MaximumValue, 1.0/minimum()); } else { w->setValue(AxisScaleProperties::MinimumValue, minimum()); w->setValue(AxisScaleProperties::MaximumValue, maximum()); } w->setValue(AxisScaleProperties::MajorTicks, majorTicks()); w->setValue(AxisScaleProperties::MinorTicks, minorTicks()); w->setValue(AxisScaleProperties::AutoTicks, autoTicks()); w->setValue(AxisScaleProperties::ShowLabels, showLabels()); w->setValue(AxisScaleProperties::ZoomEnabled, zoomEnabled()); w->setValue(AxisScaleProperties::ScaleType, AxisScaleProperties::scaleType2item(scaleType())); w->setValue(AxisScaleProperties::SizeType, AxisScaleProperties::sizeType2item(sizeType())); w->setValue(AxisScaleProperties::SizeInfo, sizeInfo()); w->setValue(AxisScaleProperties::ReversedScale, reversedScale()); } else if(w->id()==_tabFormat) { w->setValue(AxisFormatProperties::Title, currentTitle()); w->setValue(AxisFormatProperties::Font, font().toString()); w->setValue(AxisFormatProperties::Orientation, AxisFormatProperties::orientation2item(orientation()) ); w->setValue(AxisFormatProperties::LineWeight, lineWeight()); w->setValue(AxisFormatProperties::TickSize, tickSize()); w->setValue(AxisFormatProperties::NumberType, AxisFormatProperties::numberType2item(numberType())); w->setValue(AxisFormatProperties::NumberPrecision, currentNumberPrecision()); w->setValue(AxisFormatProperties::Autoprecision, autoPrecision()); w->setValue(AxisFormatProperties::UnitFactor, unitFactor()); } }
SciFigs::Axis::Q_ENUMS | ( | PrintScaleType | ) |
void SciFigs::Axis::rangeChanged | ( | ) | [signal] |
Referenced by operator=(), setRange(), and setVisibleRange().
void SciFigs::Axis::removeProperties | ( | PropertyProxy * | pp | ) |
References QGpGuiTools::PropertyProxy::removeTab(), and TRACE.
Referenced by SciFigs::AxisWindow::removeProperties(), and SciFigs::ColorPaletteWidget::removeProperties().
void SciFigs::Axis::removeStringLabels | ( | ) |
References TRACE.
Referenced by MainWidget::MainWidget(), SignalViewer::setSignals(), setStringLabels(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
{ TRACE; if(_stringLabels) { delete _stringLabels; _stringLabels=0; } }
bool SciFigs::Axis::reversedScale | ( | ) | const [inline] |
Referenced by properties().
{return constScale().isReversed();}
Scale::Type SciFigs::Axis::scaleType | ( | ) | const [inline] |
Referenced by properties(), and setProperty().
{return constScale().type();}
QString SciFigs::Axis::scaleTypeString | ( | ) | const |
References SciFigs::Scale::Inversed, SciFigs::Scale::Log, and TRACE.
{ TRACE; switch (constScale().type()) { case Scale::Inversed: return "Inversed"; case Scale::Log: return "Log"; default: return "Linear"; } }
void SciFigs::Axis::setAutoPrecision | ( | bool | p | ) |
References TRACE.
Referenced by setProperty(), and setScaleType().
{ TRACE; _autoPrecision=p; if(_autoPrecision) calculatePrecicion(); }
void SciFigs::Axis::setAutoTicks | ( | bool | m | ) |
Change the auto labelling to m. According to the min and max values, and the current scale type, typical rounded values are set for label() and tick().
References SciFigs::Scale::autoTicks(), and TRACE.
Referenced by SciFigs::ActivityMonitor::ActivityMonitor(), EllipticityThread::initResultsGraphs(), MainWidget::MainWidget(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), NAModelsPlot::setParamX(), NAModelsPlot::setParamY(), setProperty(), HVRotateStation::setResultGraph(), SpectrumRotateStation::setResultGraph(), setScaleType(), SignalViewer::setSignals(), DinverDCGui::EllipticityViewer::setTitles(), DinverDCGui::DispersionViewer::setTitles(), DinverDCGui::AutocorrViewer::setTitles(), DinverDCGui::MagnetoTelluricViewer::setTitles(), QGpGuiWave::ModalProxy::setXAxisProperties(), QGpGuiWave::RefractionProxy::setXAxisProperties(), QGpGuiWave::EllipticityProxy::setYAxisProperties(), SignalViewer::SignalViewer(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
void SciFigs::Axis::setCurrentInversedNumberPrecision | ( | int | p | ) |
References SciFigs::Scale::Inversed, setNumberPrecision(), setNumberPrecisionInversedScale(), and TRACE.
{ TRACE; if(constScale().type()==Scale::Inversed) setNumberPrecision(p); else setNumberPrecisionInversedScale(p); }
void SciFigs::Axis::setCurrentInversedTitle | ( | QString | s | ) |
References SciFigs::Scale::Inversed, setTitle(), setTitleInversedScale(), and TRACE.
{ TRACE; if(constScale().type()==Scale::Inversed) setTitle(s); else setTitleInversedScale(s); }
void SciFigs::Axis::setCurrentLine | ( | int | line | ) |
References East, North, SciFigs::Scale::setHorizontalCurrentLine(), SciFigs::Scale::setVerticalCurrentLine(), South, TRACE, and West.
{ TRACE; switch (_orientation) { case North: case South: scale().setHorizontalCurrentLine(line); break; case East: case West: scale().setVerticalCurrentLine(line); break; } if(_autoPrecision) calculatePrecicion(); setScaleTransformation(width(), height()); }
void SciFigs::Axis::setCurrentNumberPrecision | ( | int | p | ) |
References SciFigs::Scale::Inversed, setNumberPrecision(), setNumberPrecisionInversedScale(), and TRACE.
Referenced by setProperty().
{ TRACE; if(constScale().type()==Scale::Inversed) setNumberPrecisionInversedScale(p); else setNumberPrecision(p); }
void SciFigs::Axis::setCurrentTitle | ( | QString | s | ) |
References SciFigs::Scale::Inversed, setTitle(), setTitleInversedScale(), and TRACE.
Referenced by setProperty().
{ TRACE; if(constScale().type()==Scale::Inversed) setTitleInversedScale(s); else setTitle(s); }
void SciFigs::Axis::setFontString | ( | QString | fs | ) | [inline] |
{QFont f;f.fromString(fs);setFont(f);}
void SciFigs::Axis::setGraphContent | ( | GraphContent * | gc | ) |
Referenced by SciFigs::AxisWindow::AxisWindow().
{ _content=gc; }
void SciFigs::Axis::setLineWeight | ( | double | val | ) | [inline] |
Referenced by setProperty().
{_lineWeight=val;}
void SciFigs::Axis::setMajorTicks | ( | double | m | ) | [inline] |
Set the interval for ploting labels and major ticks. For log scales, use only values less than 10.
Use label() to get the current value.
Referenced by SciFigs::ActivityMonitor::ActivityMonitor(), EllipticityThread::initResultsGraphs(), MainWidget::MainWidget(), SciFigs::ActivityMonitor::setDisplayRange(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), NAModelsPlot::setParamX(), NAModelsPlot::setParamY(), setProperty(), HVRotateStation::setResultGraph(), SpectrumRotateStation::setResultGraph(), SignalViewer::setSignals(), DinverDCGui::EllipticityViewer::setTitles(), DinverDCGui::DispersionViewer::setTitles(), DinverDCGui::MagnetoTelluricViewer::setTitles(), DinverDCGui::AutocorrViewer::setTitles(), QGpGuiWave::ModalProxy::setXAxisProperties(), QGpGuiWave::EllipticityProxy::setYAxisProperties(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
{scale().setMajorTicks(m);}
void SciFigs::Axis::setMaximum | ( | double | val | ) | [inline] |
Set the maximum value of the axis. It does not update the Axis structure. To commit changes see setVisibleRange()
Referenced by SciFigs::AxisWindow::setMapScale(), and setProperty().
{scale().setGlobalMaximum(m);}
void SciFigs::Axis::setMinimum | ( | double | val | ) | [inline] |
Set the minimum value of the axis. It does not update the Axis structure. To commit changes see setVisibleRange()
Referenced by SciFigs::AxisWindow::setMapScale(), and setProperty().
{scale().setGlobalMinimum(m);}
void SciFigs::Axis::setMinorTicks | ( | double | m | ) | [inline] |
Set the interval for ploting minor ticks. For log scales, use only values less than 10.
Use tick() to get the current value.
Referenced by SciFigs::ActivityMonitor::ActivityMonitor(), EllipticityThread::initResultsGraphs(), MainWidget::MainWidget(), SciFigs::ActivityMonitor::setDisplayRange(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), NAModelsPlot::setParamX(), NAModelsPlot::setParamY(), setProperty(), HVRotateStation::setResultGraph(), SpectrumRotateStation::setResultGraph(), SignalViewer::setSignals(), DinverDCGui::EllipticityViewer::setTitles(), DinverDCGui::DispersionViewer::setTitles(), DinverDCGui::MagnetoTelluricViewer::setTitles(), DinverDCGui::AutocorrViewer::setTitles(), QGpGuiWave::ModalProxy::setXAxisProperties(), QGpGuiWave::EllipticityProxy::setYAxisProperties(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
{scale().setMinorTicks(m);}
void SciFigs::Axis::setMouseTrack | ( | bool | t | ) | [slot] |
Remove/set the lines that track the mouse position. Usually connected by AxisWindow to GraphContent::mouseInside(bool)
References TRACE.
{ TRACE; _mouseTrack=t; update(); }
void SciFigs::Axis::setNumberPrecision | ( | int | p | ) | [inline] |
Set the precision to display numbers. For log scales, it is the precision of the lowest number (minVal()). The precision is incremented for each power of ten: for instance 0.001, 0.01, 0.1, 1, 10, ... if numberPrecision() is 3 and minVal() is 0.001.
Use numberPrecision() to get the current value.
Referenced by DampingResults::createObjects(), HistogramWidget::HistogramWidget(), MagnifierSignal::MagnifierSignal(), setCurrentInversedNumberPrecision(), and setCurrentNumberPrecision().
{_numberPrecision=p;}
void SciFigs::Axis::setNumberPrecisionInversedScale | ( | int | np | ) | [inline] |
Referenced by DampingResults::createObjects(), setCurrentInversedNumberPrecision(), and setCurrentNumberPrecision().
{_numberPrecisionInversedScale=np;}
void SciFigs::Axis::setNumberType | ( | Number::Type | t | ) |
Set the type of numbers used for labels.
If autolabels() is on, the scale is automatically changed.
Use numberType() to get the current value.
References SciFigs::Scale::autoTicks(), and TRACE.
Referenced by ChronogramWindow::ChronogramWindow(), DampingResults::createObjects(), GraphicWindow::GraphicWindow(), HistogramWidget::HistogramWidget(), MainWidget::MainWidget(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), setNumberType(), setProperty(), HVRotateStation::setResultGraph(), SpectrumRotateStation::setResultGraph(), SignalViewer::setSignals(), SignalViewer::SignalViewer(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
void SciFigs::Axis::setNumberType | ( | QString | t | ) |
References QGpCoreTools::endl(), setNumberType(), and QGpCoreTools::tr().
{ switch(t[0].unicode()) { case 'S': if(t=="Scientific") { setNumberType(Number::Scientific); } else if(t=="Seconds") { setNumberType(Number::Seconds); } return; case 'T': // Compatibility case 'W': setNumberType(Number::Weeks); return; case 'D': setNumberType(Number::Days); return; case 'H': setNumberType(Number::Hours); return; case 'M': setNumberType(Number::Minutes); return; case 'F': setNumberType(Number::Fixed); return; default: break; } App::stream() << tr("Unrecognized number type %1").arg(t) << endl; }
void SciFigs::Axis::setOrientation | ( | Orientation | o | ) |
Set orientation of axis. If orientation is blocked (setOrientationBlocked()), it is not possible to change from East or West to North or South and vice-versa. This is mainly used by AxisWindow to block axis in their vertical or horizontal positions.
References East, North, orientationChanged(), South, TRACE, and West.
Referenced by SciFigs::AxisWindow::AxisWindow(), operator=(), setOrientationString(), and setProperty().
void SciFigs::Axis::setOrientationBlocked | ( | bool | b | ) | [inline] |
Prevent any change in the orientation from vertical to horizontal. Set vertical or horizontal orientation before blocking. By default axes are horizontal.
Referenced by SciFigs::AxisWindow::AxisWindow(), and SciFigs::ColorPaletteWidget::ColorPaletteWidget().
{_orientationBlocked=b;}
void SciFigs::Axis::setOrientationString | ( | QString | o | ) |
References East, North, setOrientation(), South, TRACE, and West.
{ TRACE; switch(o[0].unicode()) { case 'S': setOrientation(South); break; case 'W': setOrientation(West); break; case 'E': setOrientation(East); break; default: setOrientation(North); break; } }
void SciFigs::Axis::setPrintScale | ( | int | w, |
int | h | ||
) |
Set the scale to print
References SciFigs::Scale::autoTicks(), SciFigs::Scale::globalMaximum(), SciFigs::Scale::globalMinimum(), SciFigs::Scale::setMaximum(), SciFigs::Scale::setMinimum(), and TRACE.
Referenced by SciFigs::AxisWindow::print().
{ TRACE; Scale& scl=scale(); scl.setMinimum(scl.globalMinimum()); scl.setMaximum(scl.globalMaximum()); if(_autoTicks) scl.autoTicks(_numberType); setScaleTransformation(w, h); }
void SciFigs::Axis::setProperty | ( | uint | wid, |
int | pid, | ||
QVariant | val | ||
) | [virtual] |
Implements QGpGuiTools::PropertyItem.
References SciFigs::AxisFormatProperties::Autoprecision, autoPrecision(), SciFigs::AxisScaleProperties::AutoTicks, autoTicks(), contentChanged(), SciFigs::AxisFormatProperties::Font, SciFigs::Scale::Inversed, isZoomed(), SciFigs::AxisFormatProperties::item2numberType(), SciFigs::AxisFormatProperties::item2orientation(), SciFigs::AxisScaleProperties::item2scaleType(), SciFigs::AxisScaleProperties::item2sizeType(), SciFigs::AxisFormatProperties::LineWeight, SciFigs::AxisScaleProperties::MajorTicks, maximum(), SciFigs::AxisScaleProperties::MaximumValue, minimum(), SciFigs::AxisScaleProperties::MinimumValue, SciFigs::AxisScaleProperties::MinorTicks, SciFigs::AxisFormatProperties::NumberPrecision, SciFigs::AxisFormatProperties::NumberType, numberType(), SciFigs::AxisFormatProperties::Orientation, SciFigs::AxisScaleProperties::ReversedScale, Scaled, SciFigs::AxisScaleProperties::ScaleType, scaleType(), setAutoPrecision(), setAutoTicks(), setCurrentNumberPrecision(), setCurrentTitle(), setLineWeight(), setMajorTicks(), setMaximum(), setMinimum(), setMinorTicks(), setNumberType(), setOrientation(), setReversedScale(), setScaleType(), setShowLabels(), setSizeInfo(), setSizeType(), setTickSize(), setUnitFactor(), setVisibleRange(), setZoomEnabled(), SciFigs::AxisScaleProperties::ShowLabels, sizeChanged(), SciFigs::AxisScaleProperties::SizeInfo, sizeInfo(), SciFigs::AxisScaleProperties::SizeType, sizeType(), SciFigs::AxisFormatProperties::TickSize, SciFigs::AxisFormatProperties::Title, TRACE, SciFigs::AxisFormatProperties::UnitFactor, SciFigs::AxisScaleProperties::ZoomEnabled, and zoomEnabled().
{ TRACE; bool visibleRangeChange=false; bool previouslyZoomed=isZoomed(); bool deepUpdateChange=false; if(wid==_tabScale) { switch(pid) { case AxisScaleProperties::MinimumValue: { double dVal=Number::toDouble(val.toString(), numberType()); if(scaleType()==Scale::Inversed) setMaximum(1.0/dVal); else setMinimum(dVal); } visibleRangeChange=true; break; case AxisScaleProperties::MaximumValue: { double dVal=Number::toDouble(val.toString(), numberType()); if(scaleType()==Scale::Inversed) setMinimum(1.0/dVal); else setMaximum(dVal); } visibleRangeChange=true; break; case AxisScaleProperties::MajorTicks: if(autoTicks()) setAutoTicks(false); setMajorTicks(Number::toDouble(val.toString(), numberType())); deepUpdateChange=true; if(autoPrecision()) calculatePrecicion(); break; case AxisScaleProperties::MinorTicks: if(autoTicks()) setAutoTicks(false); setMinorTicks(Number::toDouble(val.toString(), numberType())); deepUpdateChange=true; if(autoPrecision()) calculatePrecicion(); break; case AxisScaleProperties::AutoTicks: setAutoTicks(val.toBool()); if(autoPrecision()) calculatePrecicion(); deepUpdateChange=true; break; case AxisScaleProperties::ShowLabels: setShowLabels(val.toBool()); break; case AxisScaleProperties::ZoomEnabled: setZoomEnabled(val.toBool()); break; case AxisScaleProperties::ScaleType: setScaleType(AxisScaleProperties::item2scaleType(val.toInt()) ); visibleRangeChange=true; break; case AxisScaleProperties::ReversedScale: setReversedScale(val.toBool()); visibleRangeChange=true; break; case AxisScaleProperties::SizeType: if(sizeType()!=Axis::Scaled) { setSizeType(AxisScaleProperties::item2sizeType(val.toInt()) ); if(sizeType()==Axis::Scaled) { setSizeInfo(( maximum() - minimum())/sizeInfo() * 100.0); } } else { setSizeType(AxisScaleProperties::item2sizeType(val.toInt()) ); if(sizeType()!=Axis::Scaled) { setSizeInfo(( maximum() - minimum())/sizeInfo() * 100.0); } } deepUpdateChange=true; break; case AxisScaleProperties::SizeInfo: setSizeInfo(val.toDouble()); break; default: break; } } else if(wid==_tabFormat) { switch(pid) { case AxisFormatProperties::Title: setCurrentTitle(val.toString()); break; case AxisFormatProperties::Font: { QFont f; if(f.fromString(val.toString()) ) { setFont(f); } } break; case AxisFormatProperties::Orientation: setOrientation(AxisFormatProperties::item2orientation(val.toInt()) ); break; case AxisFormatProperties::LineWeight: setLineWeight(val.toDouble()); break; case AxisFormatProperties::TickSize: setTickSize(val.toDouble()); break; case AxisFormatProperties::NumberType: setNumberType(AxisFormatProperties::item2numberType(val.toInt()) ); if(autoPrecision()) visibleRangeChange=true; break; case AxisFormatProperties::NumberPrecision: setCurrentNumberPrecision(val.toInt()); break; case AxisFormatProperties::Autoprecision: setAutoPrecision(val.toBool()); visibleRangeChange=true; break; case AxisFormatProperties::UnitFactor: if(scaleType()==Scale::Inversed) { setUnitFactor( 1.0/val.toDouble()); } else { setUnitFactor( val.toDouble()); } if(autoPrecision()) visibleRangeChange=true; break; default: break; } } if(visibleRangeChange) { bool tmp=zoomEnabled(); setZoomEnabled(true); setVisibleRange(previouslyZoomed); setZoomEnabled(tmp); deepUpdateChange=true; } else update(); if(deepUpdateChange) emit contentChanged(); emit sizeChanged(); }
void SciFigs::Axis::setRange | ( | double | min, |
double | max | ||
) |
Set the minimum and the maximum values of the axis. The min and max are swaped if necessary. The scale is always updated.
Use minVal or maxVal() to get the current values.
References isZoomed(), rangeChanged(), SciFigs::Scale::setGlobalMaximum(), SciFigs::Scale::setGlobalMinimum(), setVisibleRange(), sizeChanged(), and TRACE.
Referenced by SciFigs::ActivityMonitor::ActivityMonitor(), PSViewer::addPlot(), addPlot(), addStringLabel(), GeopsyGui::ArrayMap::ArrayMap(), SciFigs::ColorPaletteWidget::ColorPaletteWidget(), TFAResults::compute(), DampingResults::compute(), SpacSelector::createObjects(), ArrayGui::ArrayResponse::createObjects(), StatGridAnalyser::gridChanged(), HistogramWidget::HistogramWidget(), SpacSelector::inverse(), MonoStation::WinResults::loadResults(), MagnifierSignal::MagnifierSignal(), MonoStation::AbstractTool::setCurrentDisplayStation(), SignalViewer::setDisplayRange(), SciFigs::ActivityMonitor::setDisplayRange(), ArrayGui::ArrayResponse::setFrequencySampling(), DinverDCGui::GroundModelViewer::setGlobalLimits(), HistogramWidget::setHistogram(), HVRotateWinResults::setLimits(), SpectrumRotateWinResults::setLimits(), DinverDCGui::RefractionViewer::setLimits(), PtMotionResults::setLimits(), RefractionTargetWidget::setLimits(), ChronogramWindow::setLimits(), AutocorrTargetWidget::setLimits(), DinverDCGui::EllipticityViewer::setLimits(), DinverDCGui::DispersionViewer::setLimits(), DinverDCGui::MagnetoTelluricViewer::setLimits(), DinverDCGui::AutocorrViewer::setLimits(), DinverDCGui::GroundModelViewer::setLimits(), MonoStation::WinResults::setLimits(), GraphicWindow::setLimits(), DispersionGridThread::setLimits(), MonoStation::AbstractSummary::setLimits(), PSViewer::setLimits(), SciFigs::CurveBrowser::setLimits(), SignalViewer::setMaximumTime(), Seismic1DThread::setModelLimits(), MagnetoTelluricThread::setModelLimits(), SciFigs::ColorPaletteWidget::setPalette(), NAModelsPlot::setProperty(), StructureWinResults::setRatioLimits(), CurvesThread::setResultsLimits(), MagnetoTelluricThread::setResultsLimits(), MagnifierSignal::setSignal(), SignalViewer::setSignals(), StructureWinResults::setSpectrumLimits(), MagnifierSignal::setTime(), DinverDCGui::AutocorrViewer::setTitles(), LinearFKActiveResults::setXAxis(), QGpGuiWave::ModalProxy::setXAxisProperties(), QGpGuiWave::RefractionProxy::setXAxisProperties(), SciFigs::CurveBrowserProxy::setXAxisProperties(), LinearFKActiveResults::setYAxis(), QGpGuiWave::EllipticityProxy::setYAxisProperties(), QGpGuiWave::ModalProxy::setYAxisProperties(), QGpGuiWave::RefractionProxy::setYAxisProperties(), SciFigs::CurveBrowserProxy::setYAxisProperties(), GraphicWindow::showMagnify(), GraphicWindow::signalsUpdate(), SignalViewer::SignalViewer(), LinearFKActiveResults::stackGrids(), and MonoStation::StatisticResults::studentTest().
{ TRACE; bool zoomed=isZoomed(); if(min>max) qSwap(min, max); scale().setGlobalMinimum(min); scale().setGlobalMaximum(max); if( !zoomed) setVisibleRange(min, max); emit sizeChanged(); emit rangeChanged(); }
void SciFigs::Axis::setReversedScale | ( | bool | b | ) | [inline] |
Select the ploting direction of the axis, if true, it means:
Referenced by ChronogramWindow::ChronogramWindow(), GraphicWindow::GraphicWindow(), Seismic1DThread::initModelGraphs(), MagnetoTelluricThread::initModelGraphs(), MagnetoTelluricThread::initResultsGraphs(), MainWidget::MainWidget(), setProperty(), SignalViewer::setSignals(), DinverDCGui::MagnetoTelluricViewer::setTitles(), DinverDCGui::GroundModelViewer::setTitles(), SignalViewer::SignalViewer(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
{scale().setReversed(b);}
void SciFigs::Axis::setScaleType | ( | Scale::Type | s | ) |
References autoPrecision(), autoTicks(), SciFigs::Scale::Inversed, SciFigs::Scale::Log, maximum(), minimum(), setAutoPrecision(), setAutoTicks(), SciFigs::Scale::setGlobalMaximum(), SciFigs::Scale::setGlobalMinimum(), SciFigs::Scale::setMaximum(), SciFigs::Scale::setMinimum(), SciFigs::Scale::setType(), and TRACE.
Referenced by TFAResults::createObjects(), HistogramWidget::initGrid(), MagnetoTelluricThread::initModelGraphs(), EllipticityThread::initResultsGraphs(), MainWidget::MainWidget(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), NAModelsPlot::setParamX(), NAModelsPlot::setParamY(), setProperty(), HVRotateStation::setResultGraph(), SpectrumRotateStation::setResultGraph(), setScaleType(), SignalViewer::setSignals(), DinverDCGui::EllipticityViewer::setTitles(), DinverDCGui::DispersionViewer::setTitles(), DinverDCGui::MagnetoTelluricViewer::setTitles(), DinverDCGui::AutocorrViewer::setTitles(), DinverDCGui::GroundModelViewer::setTitles(), LinearFKActiveResults::setXAxis(), QGpGuiWave::ModalProxy::setXAxisProperties(), QGpGuiWave::RefractionProxy::setXAxisProperties(), LinearFKActiveResults::setYAxis(), QGpGuiWave::EllipticityProxy::setYAxisProperties(), QGpGuiWave::RefractionProxy::setYAxisProperties(), SignalViewer::SignalViewer(), LinearFKActiveResults::stackGrids(), ChronogramWindow::updateLabels(), and GraphicWindow::updateLabels().
{ TRACE; if(s==constScale().type()) return ; scale().setType(s); switch (constScale().type()) { case Scale::Inversed: case Scale::Log: if(constScale().globalMinimum() <= 0.0) scale().setGlobalMinimum(1e-16); if(constScale().globalMaximum() <= 0.0) scale().setGlobalMaximum(1e-16); if(constScale().minimum() <= 0.0) scale().setMinimum(1e-16); if(constScale().maximum() <= 0.0) scale().setMaximum(1e-16); default: break; } setScaleTransformation(width(), height()); // Adjust automatic ticks setAutoTicks(autoTicks()); // Adjust automatic precision setAutoPrecision(autoPrecision()); }
void SciFigs::Axis::setScaleType | ( | QString | t | ) |
References SciFigs::Scale::Inversed, SciFigs::Scale::Linear, SciFigs::Scale::Log, setScaleType(), and TRACE.
{ TRACE; switch(t.count()) { case 0: return; case 1: // Compatibility switch(t[0].unicode()) { case 'l': setScaleType(Scale::Log); break; case 'i': setScaleType(Scale::Inversed); break; default: setScaleType(Scale::Linear); break; } break; default: switch(t[1].unicode()) { case 'o': setScaleType(Scale::Log); break; case 'n': setScaleType(Scale::Inversed); break; default: setScaleType(Scale::Linear); break; } } }
void SciFigs::Axis::setShowLabels | ( | bool | m | ) | [inline] |
Referenced by setProperty().
{_showLabels=m;}
void SciFigs::Axis::setSizeInfo | ( | double | s | ) | [inline] |
Referenced by GeopsyGui::ArrayMap::ArrayMap(), SciFigs::AxisWindow::AxisWindow(), ChronogramWindow::ChronogramWindow(), ArrayGui::ArrayResponse::createObjects(), GraphicWindow::GraphicWindow(), MapWindow::MapWindow(), SciFigs::ColorPaletteWidget::print(), SciFigs::GraphicSheetMenu::setGraphGeometry(), SciFigs::AxisWindow::setMapScale(), setProperty(), and SignalViewer::SignalViewer().
{if(s>0.0) _sizeInfo=s;}
void SciFigs::Axis::setSizeType | ( | SizeType | st | ) | [inline] |
void SciFigs::Axis::setSizeType | ( | QString | st | ) |
References AxisSize, Scaled, setSizeType(), TotalSize, and TRACE.
{ TRACE; switch (st[0].unicode()) { case 'S': setSizeType(Axis::Scaled); break; case 'A': setSizeType(Axis::AxisSize); break; default: setSizeType(Axis::TotalSize); break; } }
void SciFigs::Axis::setStringLabels | ( | QString | s | ) |
References addStringLabel(), QGpCoreTools::StringSection::isEmpty(), label, removeStringLabels(), QGpCoreTools::StringSection::set(), QGpCoreTools::StringSection::setEnd(), QGpCoreTools::StringSection::toString(), and TRACE.
{ TRACE; removeStringLabels(); const QChar * p=s.data(); StringSection label(p, 0); while(true) { switch (p[ 0 ].unicode()) { case 0x005C: // '\' p++; break; case 0x002C: // ',' label.setEnd(p); addStringLabel(label.toString()); label.set(p + 1, 0); break; case 0x0000: label.setEnd(p); if(!label.isEmpty()) addStringLabel(label.toString()); return ; default: break; } p++; } }
void SciFigs::Axis::setTickSize | ( | double | val | ) | [inline] |
Referenced by setProperty().
{_tickSize=val;}
void SciFigs::Axis::setTitle | ( | QString | s | ) | [inline] |
Referenced by GeopsyGui::ArrayMap::ArrayMap(), SciFigs::AxisWindow::AxisWindow(), SciFigs::ColorPaletteWidget::ColorPaletteWidget(), MonoStation::AbstractSummary::createGridCrossSectionGraph(), TFAResults::createObjects(), DampingResults::createObjects(), ArrayGui::ArrayResponse::createObjects(), HistogramWidget::HistogramWidget(), SciFigs::CurveBrowser::initLayer(), Seismic1DThread::initModelGraphs(), MagnetoTelluricThread::initModelGraphs(), MagnetoTelluricThread::initResultsGraphs(), MonoStation::WinResults::loadResults(), MainWidget::MainWidget(), MapWindow::MapWindow(), setCurrentInversedTitle(), setCurrentTitle(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), NAModelsPlot::setParamX(), NAModelsPlot::setParamY(), SpectrumRotateStation::setResultGraph(), HVRotateStation::setResultGraph(), SignalViewer::setSignals(), MonoStation::WinResults::setStations(), DinverDCGui::RefractionViewer::setTitles(), DinverDCGui::EllipticityViewer::setTitles(), DinverDCGui::DispersionViewer::setTitles(), DinverDCGui::MagnetoTelluricViewer::setTitles(), DinverDCGui::AutocorrViewer::setTitles(), DinverDCGui::GroundModelViewer::setTitles(), SignalViewer::SignalViewer(), ChronogramWindow::updateLabels(), GraphicWindow::updateLabels(), and PtMotionResults::updateSignals().
{_title=s;}
void SciFigs::Axis::setTitleInversedScale | ( | QString | s | ) | [inline] |
Referenced by TFAResults::createObjects(), DampingResults::createObjects(), ArrayGui::ArrayResponse::createObjects(), SciFigs::CurveBrowser::initLayer(), setCurrentInversedTitle(), setCurrentTitle(), SciFigs::GraphicSheetMenu::setFrequencyTitles(), MonoStation::StationResults::setGraph(), HVRotateStation::setResultGraph(), SpectrumRotateStation::setResultGraph(), DinverDCGui::RefractionViewer::setTitles(), DinverDCGui::EllipticityViewer::setTitles(), DinverDCGui::DispersionViewer::setTitles(), DinverDCGui::GroundModelViewer::setTitles(), DinverDCGui::MagnetoTelluricViewer::setTitles(), DinverDCGui::AutocorrViewer::setTitles(), and PtMotionResults::updateSignals().
{_titleInversedScale=s;}
void SciFigs::Axis::setUnitFactor | ( | double | s | ) | [inline] |
void SciFigs::Axis::setVisibleRange | ( | double | val1, |
double | val2 | ||
) |
References SciFigs::Scale::autoTicks(), SciFigs::Scale::setMaximum(), SciFigs::Scale::setMinimum(), and TRACE.
Referenced by SciFigs::AxisWindow::checkZoomRects(), SciFigs::AxisWindow::setMapScale(), setProperty(), setRange(), setVisibleRange(), SciFigs::AxisWindow::xml_polish(), SciFigs::AxisWindow::zoomIn(), and SciFigs::AxisWindow::zoomOut().
{ TRACE; if(val1 < val2) { scale().setMinimum(val1); scale().setMaximum(val2); } else { scale().setMinimum(val2); scale().setMaximum(val1); } if(_autoTicks) scale().autoTicks(_numberType); if(_autoPrecision) calculatePrecicion(); setScaleTransformation(width(), height()); }
void SciFigs::Axis::setVisibleRange | ( | bool | zoomed | ) |
Set the minimum and the maximum visible values of the axis. The min and max are swaped if necessary. The scale is always updated.
Use this function, once setMinimum() and setMaximum() have been called separately to update the visible range. In case of zoomed area, do not call this function to avoid current zoom rect to be lost. To know if the axis range has been zoomed call isZoomed();
For instance:
VerticalAxis axis;
bool zoomed=axis.isZoomed();
axis.setMin(25.0);
axis.setVisibleRange(zoomed);
References SciFigs::Scale::globalMinimum(), rangeChanged(), SciFigs::Scale::setGlobalMaximum(), SciFigs::Scale::setGlobalMinimum(), setVisibleRange(), and TRACE.
{ TRACE; if(constScale().globalMaximum() < constScale().globalMinimum()) { double tmp; tmp=constScale().globalMinimum(); scale().setGlobalMinimum(constScale().globalMaximum()); scale().setGlobalMaximum(tmp); } if( !zoomed) setVisibleRange(constScale().globalMinimum(), constScale().globalMaximum()); emit rangeChanged(); }
void SciFigs::Axis::setZoomEnabled | ( | bool | m | ) | [inline] |
Enable or disable the zoom feature according to m value.
Use zoomEnabled() to get the current value.
Referenced by ChronogramWindow::ChronogramWindow(), GraphicWindow::GraphicWindow(), MainWidget::MainWidget(), setProperty(), and SignalViewer::SignalViewer().
{_zoomEnabled=m;}
bool SciFigs::Axis::showLabels | ( | ) | const [inline] |
Referenced by properties().
{return _showLabels;}
void SciFigs::Axis::sizeChanged | ( | ) | [signal] |
Referenced by operator=(), setProperty(), and setRange().
double SciFigs::Axis::sizeInfo | ( | ) | const [inline] |
Referenced by properties(), and setProperty().
{return _sizeInfo;}
SizeType SciFigs::Axis::sizeType | ( | ) | const [inline] |
Referenced by properties(), setProperty(), and sizeTypeString().
{return _sizeType;}
QString SciFigs::Axis::sizeTypeString | ( | ) | const |
References AxisSize, Scaled, sizeType(), TotalSize, and TRACE.
{ TRACE; switch (sizeType()) { case Axis::Scaled: return "Scaled"; break; case Axis::AxisSize: return "AxisSize"; break; case Axis::TotalSize: return "TotalSize"; break; } return "TotalSize"; }
QString SciFigs::Axis::stringLabels | ( | ) | const |
double SciFigs::Axis::tickSize | ( | ) | const [inline] |
Referenced by properties().
{return _tickSize;}
QString SciFigs::Axis::title | ( | ) | const [inline] |
Referenced by currentInversedTitle(), and currentTitle().
{return _title;}
QString SciFigs::Axis::titleInversedScale | ( | ) | const [inline] |
Referenced by currentInversedTitle(), and currentTitle().
{return _titleInversedScale;}
void SciFigs::Axis::trackMouse | ( | QPoint | mouseP | ) | [slot] |
double SciFigs::Axis::unitFactor | ( | ) | const [inline] |
Referenced by properties().
{return _unitFactor;}
double SciFigs::Axis::visibleMaximum | ( | ) | const [inline] |
Return the maximum value of the zoom range.
Use setVisibleRange() to modify it.
Referenced by SciFigs::AxisWindow::checkZoomRects(), and SciFigs::AxisWindow::zoomIn().
{return constScale().maximum();}
double SciFigs::Axis::visibleMinimum | ( | ) | const [inline] |
Return the minimum value of the zoom range.
Use setVisibleRange() to modify it.
Referenced by SciFigs::AxisWindow::checkZoomRects(), and SciFigs::AxisWindow::zoomIn().
{return constScale().minimum();}
virtual XMLMember SciFigs::Axis::xml_member | ( | XML_MEMBER_ARGS | ) | [inline, 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.
{return qobject_member(this, tag, attributes, context);}
virtual bool SciFigs::Axis::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.
{return qobject_setProperty(this, memberID, tag, attributes, content, context);}
virtual const QString& SciFigs::Axis::xml_tagName | ( | ) | const [inline, virtual] |
Implements QGpCoreTools::XMLClass.
{return xmlAxisTag;}
virtual void SciFigs::Axis::xml_writeProperties | ( | XML_WRITEPROPERTIES_ARGS | ) | const [inline, protected, virtual] |
Reimplemented from QGpCoreTools::XMLClass.
{qobject_writeProperties(this, this, s, context);}
bool SciFigs::Axis::zoomEnabled | ( | ) | const [inline] |
Referenced by properties(), and setProperty().
{return _zoomEnabled;}
const QString SciFigs::Axis::xmlAxisTag = "Axis" [static] |
bool SciFigs::Axis::autoLabel [read, write] |
bool SciFigs::Axis::autoPrec [read, write] |
bool SciFigs::Axis::autoPrecision [read, write] |
bool SciFigs::Axis::autoTicks [read, write] |
Return true is auto labeling is on.
Use setAutoTickss() to modify it.
QString SciFigs::Axis::font [read, write] |
Referenced by operator=(), printThickness(), properties(), and SciFigs::AxisWindow::restoreScaleFonts().
int SciFigs::Axis::inversedNumberPrecision [read, write] |
int SciFigs::Axis::inversedNumPrec [read, write] |
QString SciFigs::Axis::inversedTitle [read, write] |
double SciFigs::Axis::label [read, write] |
Referenced by setStringLabels().
double SciFigs::Axis::lineWeight [read, write] |
double SciFigs::Axis::majorTicks [read, write] |
Return the interval for ploting labels and major ticks.
Use setLabel() to modify it.
double SciFigs::Axis::max [read, write] |
double SciFigs::Axis::min [read, write] |
double SciFigs::Axis::minorTicks [read, write] |
Return the interval for ploting minor ticks.
Use setMinorTicks() to modify it.
QString SciFigs::Axis::name [read, write] |
int SciFigs::Axis::numberPrecision [read, write] |
Return the current precision to display numbers.
Use setNumberPrecision() to modify it.
Referenced by SciFigs::ColorPaletteLayer::coordinateTipInfo(), SciFigs::IrregularGrid2DPlot::coordinateTipInfo(), and SciFigs::GraphContentLayer::coordinateTipInfo().
char SciFigs::Axis::numberType [read, write] |
Return the type of numbers used for labels ('f', 'g' or 't').
Use setNumberType() to modify it.
Referenced by SciFigs::ColorPaletteLayer::coordinateTipInfo(), SciFigs::IrregularGrid2DPlot::coordinateTipInfo(), and SciFigs::GraphContentLayer::coordinateTipInfo().
int SciFigs::Axis::numPrec [read, write] |
QString SciFigs::Axis::numType [read, write] |
QString SciFigs::Axis::objectName [read, write] |
Scale::Orientation SciFigs::Axis::orientation [read, write] |
QString SciFigs::Axis::position [read, write] |
double SciFigs::Axis::printLengthInfo [read, write] |
double SciFigs::Axis::printLineWeight [read, write] |
QString SciFigs::Axis::printScaleType [read, write] |
double SciFigs::Axis::printTickLength [read, write] |
bool SciFigs::Axis::reversedScale [read, write] |
Return true if the ploting direction of the axis is reversed, see setReversedScale() for details
ScaleType SciFigs::Axis::scaleType [read, write] |
bool SciFigs::Axis::showLabels [read, write] |
double SciFigs::Axis::sizeInfo [read, write] |
Referenced by SciFigs::AxisWindow::setMapScale().
SizeType SciFigs::Axis::sizeType [read, write] |
Referenced by SciFigs::AxisWindow::setMapScale(), and SciFigs::AxisWindow::zoomIn().
QString SciFigs::Axis::stringLabels [read, write] |
Return the pointer to the current list of names for labels (null if no names are used).
See addStringLabel() and removeStringLabels() to modify the names plotted in place of the normal axis values.
double SciFigs::Axis::tick [read, write] |
double SciFigs::Axis::tickSize [read, write] |
QString SciFigs::Axis::title [read, write] |
double SciFigs::Axis::unitFactor [read, write] |
Referenced by SciFigs::GraphContent::coordinateTipText().
bool SciFigs::Axis::visible [read, write] |
bool SciFigs::Axis::zoomBlocked [read, write] |
bool SciFigs::Axis::zoomEnabled [read, write] |
Return true if the zoom is enabled.
Use setZoomEnabled() to modify it.
Referenced by SciFigs::AxisWindow::checkZoomRects(), SciFigs::AxisWindow::zoomIn(), and SciFigs::AxisWindow::zoomOut().