KiCad PCB EDA Suite
|
Plot layer implementing a y-scale ruler. More...
#include <mathplot.h>
Public Member Functions | |
mpScaleY (const wxString &name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true) | |
virtual bool | IsHorizontal () const override |
virtual void | Plot (wxDC &dc, mpWindow &w) override |
Layer plot handler. More... | |
virtual bool | HasBBox () const override |
Check whether this layer has a bounding box. More... | |
void | SetAlign (int align) |
Set Y axis alignment. More... | |
void | SetTicks (bool ticks) |
Set Y axis ticks or grid. More... | |
bool | GetTicks () const |
Get Y axis ticks or grid. More... | |
virtual double | TransformToPlot (double x) const override |
virtual double | TransformFromPlot (double xplot) const override |
void | SetMasterScale (mpScaleY *masterScale) |
void | SetNameAlign (int align) |
void | SetDataRange (double minV, double maxV) |
void | GetDataRange (double &minV, double &maxV) const |
void | ExtendDataRange (double minV, double maxV) |
void | ResetDataRange () |
double | AbsMaxValue () const |
double | AbsVisibleMaxValue () const |
std::vector< TickLabel > & | TickLabels () |
virtual bool | IsInfo () const |
Check whether the layer is an info box. More... | |
virtual double | GetMinX () const |
Get inclusive left border of bounding box. More... | |
virtual double | GetMaxX () const |
Get inclusive right border of bounding box. More... | |
virtual double | GetMinY () const |
Get inclusive bottom border of bounding box. More... | |
virtual double | GetMaxY () const |
Get inclusive top border of bounding box. More... | |
const wxString & | GetName () const |
Get layer name. More... | |
const wxFont & | GetFont () const |
Get font set for this layer. More... | |
const wxPen & | GetPen () const |
Get pen set for this layer. More... | |
void | SetContinuity (bool continuity) |
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points). More... | |
bool | GetContinuity () const |
Gets the 'continuity' property of the layer. More... | |
void | ShowName (bool show) |
Shows or hides the text label with the name of the layer (default is visible). More... | |
virtual void | SetName (wxString name) |
Set layer name. More... | |
void | SetFont (wxFont &font) |
Set layer font. More... | |
void | SetPen (wxPen pen) |
Set layer pen. More... | |
void | SetDrawOutsideMargins (bool drawModeOutside) |
Set Draw mode: inside or outside margins. More... | |
bool | GetDrawOutsideMargins () |
Get Draw mode: inside or outside margins. More... | |
wxBitmap | GetColourSquare (int side=16) const |
Get a small square bitmap filled with the colour of the pen used in the layer. More... | |
mpLayerType | GetLayerType () const |
Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value. More... | |
bool | IsVisible () const |
Checks whether the layer is visible or not. More... | |
void | SetVisible (bool show) |
Sets layer visibility. More... | |
const wxBrush & | GetBrush () const |
Get brush set for this layer. More... | |
void | SetBrush (wxBrush brush) |
Set layer brush. More... | |
Protected Member Functions | |
virtual void | getVisibleDataRange (mpWindow &w, double &minV, double &maxV) override |
virtual void | recalculateTicks (wxDC &dc, mpWindow &w) override |
void | computeLabelExtents (wxDC &dc, mpWindow &w) |
void | computeSlaveTicks (mpWindow &w) |
void | updateTickLabels (wxDC &dc, mpWindow &w) |
int | tickCount () const |
virtual int | labelCount () const |
virtual const wxString | formatLabel (double value, int nDigits) |
virtual void | formatLabels () |
virtual double | getTickPos (int n) const |
virtual double | getLabelPos (int n) const |
virtual wxString | getLabel (int n) const |
Protected Attributes | |
mpScaleY * | m_masterScale |
int | m_flags |
bool | m_ticks |
std::vector< double > | m_tickValues |
std::vector< TickLabel > | m_tickLabels |
double | m_offset |
double | m_scale |
double | m_absVisibleMaxV |
int | m_nameFlags |
double | m_minV |
double | m_maxV |
bool | m_rangeSet |
int | m_maxLabelHeight |
int | m_maxLabelWidth |
wxFont | m_font |
wxPen | m_pen |
wxBrush | m_brush |
wxString | m_name |
bool | m_continuous |
bool | m_showName |
bool | m_drawOutsideMargins |
mpLayerType | m_type |
bool | m_visible |
Plot layer implementing a y-scale ruler.
If align is set to mpALIGN_CENTER, the ruler is fixed at X=0 in the coordinate system. If the align is set to mpALIGN_TOP or mpALIGN_BOTTOM, the axis is always drawn respectively at top or bottom of the window. A label is plotted at the top-right hand of the ruler. The scale numbering automatically adjusts to view and zoom factor.
Definition at line 943 of file mathplot.h.
mpScaleY::mpScaleY | ( | const wxString & | name = wxT( "Y" ) , |
int | flags = mpALIGN_CENTER , |
||
bool | ticks = true |
||
) |
name | Label to plot by the ruler |
flags | Set position of the scale respect to the window. |
ticks | Select ticks or grid. Give true (default) for drawing axis ticks, false for drawing the grid |
Definition at line 1407 of file mathplot.cpp.
References mpALIGN_BORDER_LEFT, mpLAYER_AXIS, and name.
|
inlineinherited |
|
inlineinherited |
Definition at line 771 of file mathplot.h.
|
protected |
|
protected |
Definition at line 1009 of file mathplot.cpp.
References getVisibleDataRange(), mpScaleBase::m_absVisibleMaxV, m_masterScale, mpScaleBase::m_maxV, mpScaleBase::m_minV, mpScaleBase::m_offset, mpScaleBase::m_scale, mpScaleBase::m_tickLabels, mpScaleBase::m_tickValues, TransformFromPlot(), and TransformToPlot().
Referenced by recalculateTicks().
|
inlineinherited |
Definition at line 740 of file mathplot.h.
Referenced by mpFXY::UpdateScales().
|
inlineprotectedvirtualinherited |
Definition at line 812 of file mathplot.h.
|
inlineprotectedvirtualinherited |
|
inlineinherited |
|
inherited |
Get a small square bitmap filled with the colour of the pen used in the layer.
Useful to create legends or similar reference to the layers.
side | side length in pixels |
Definition at line 75 of file mathplot.cpp.
References mpLayer::m_pen, and square().
|
inlineinherited |
Gets the 'continuity' property of the layer.
Definition at line 258 of file mathplot.h.
|
inlineinherited |
Definition at line 734 of file mathplot.h.
Referenced by mpScaleX::recalculateTicks(), mpScaleXLog::recalculateTicks(), and recalculateTicks().
|
inlineinherited |
Get Draw mode: inside or outside margins.
Definition at line 285 of file mathplot.h.
|
inlineinherited |
|
inlineprotectedvirtualinherited |
Definition at line 825 of file mathplot.h.
Referenced by mpScaleBase::computeLabelExtents(), and Plot().
|
inlineprotectedvirtualinherited |
Definition at line 820 of file mathplot.h.
Referenced by mpScaleXBase::Plot(), and Plot().
|
inlineinherited |
Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value.
Definition at line 294 of file mathplot.h.
Referenced by mpInfoLegend::Plot().
|
inlinevirtualinherited |
Get inclusive right border of bounding box.
Reimplemented in mpFXYVector, mpMovableObject, and mpBitmapLayer.
Definition at line 180 of file mathplot.h.
Referenced by mpFXY::UpdateScales().
|
inlinevirtualinherited |
Get inclusive top border of bounding box.
Reimplemented in mpFXYVector, mpMovableObject, and mpBitmapLayer.
Definition at line 190 of file mathplot.h.
Referenced by mpFXY::UpdateScales().
|
inlinevirtualinherited |
Get inclusive left border of bounding box.
Reimplemented in mpFXYVector, mpMovableObject, and mpBitmapLayer.
Definition at line 175 of file mathplot.h.
Referenced by mpFXY::UpdateScales().
|
inlinevirtualinherited |
Get inclusive bottom border of bounding box.
Reimplemented in mpFXYVector, mpMovableObject, and mpBitmapLayer.
Definition at line 185 of file mathplot.h.
Referenced by mpFXY::UpdateScales().
|
inlineinherited |
Get layer name.
Definition at line 238 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::GetLabelX(), SIM_PLOT_PANEL::GetLabelY1(), SIM_PLOT_PANEL::GetLabelY2(), SIM_PLOT_PANEL::GetLabelY3(), mpInfoLegend::Plot(), mpText::Plot(), and SIMULATOR_FRAME::updateCursors().
|
inlineinherited |
Get pen set for this layer.
Definition at line 248 of file mathplot.h.
Referenced by CURSOR::Plot(), mpInfoLegend::Plot(), and SIMULATOR_FRAME::rebuildSignalsGrid().
|
inlineprotectedvirtualinherited |
Definition at line 815 of file mathplot.h.
Referenced by mpScaleXBase::Plot(), and Plot().
|
inline |
Get Y axis ticks or grid.
Definition at line 975 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::IsGridShown().
|
overrideprotectedvirtual |
Reimplemented from mpScaleBase.
Definition at line 996 of file mathplot.cpp.
References mpWindow::GetMarginBottom(), mpWindow::GetMarginTop(), mpWindow::GetScrY(), mpLayer::m_drawOutsideMargins, mpWindow::p2y(), and TransformFromPlot().
Referenced by computeSlaveTicks(), and recalculateTicks().
|
inlineoverridevirtual |
Check whether this layer has a bounding box.
This implementation returns false thus making the ruler invisible to the plot layer bounding box calculation by mpWindow.
Reimplemented from mpScaleBase.
Definition at line 963 of file mathplot.h.
|
inlineoverridevirtual |
|
inlinevirtualinherited |
Check whether the layer is an info box.
The default implementation returns false. It is overridden to true for mpInfoLayer class and its derivative. It is necessary to define mouse actions behaviour over info boxes.
Reimplemented in mpInfoLayer.
Definition at line 170 of file mathplot.h.
|
inlineinherited |
Checks whether the layer is visible or not.
Definition at line 298 of file mathplot.h.
Referenced by mpWindow::IsLayerVisible(), SIM_PLOT_PANEL::IsLegendShown(), and mpInfoLegend::Plot().
|
inlineprotectedvirtualinherited |
Definition at line 807 of file mathplot.h.
Referenced by mpScaleBase::computeLabelExtents(), mpScaleXBase::Plot(), and Plot().
|
overridevirtual |
Layer plot handler.
This implementation will plot the ruler adjusted to the visible area.
Implements mpLayer.
Definition at line 1420 of file mathplot.cpp.
References mpScaleBase::getLabel(), mpScaleBase::getLabelPos(), mpWindow::GetMarginBottom(), mpWindow::GetMarginLeft(), mpWindow::GetMarginRight(), mpWindow::GetMarginTop(), mpWindow::GetPosY(), mpWindow::GetScaleY(), mpWindow::GetScrX(), mpWindow::GetScrY(), mpScaleBase::getTickPos(), mpScaleBase::labelCount(), mpLayer::m_drawOutsideMargins, m_flags, mpLayer::m_font, mpScaleBase::m_maxV, mpScaleBase::m_minV, mpLayer::m_name, mpScaleBase::m_nameFlags, mpScaleBase::m_offset, mpLayer::m_pen, mpScaleBase::m_scale, mpScaleBase::m_tickLabels, m_ticks, mpLayer::m_visible, mpALIGN_BORDER_LEFT, mpALIGN_BORDER_RIGHT, mpALIGN_CENTER, mpALIGN_FAR_RIGHT, mpALIGN_LEFT, mpALIGN_RIGHT, recalculateTicks(), mpScaleBase::tickCount(), tp, TransformToPlot(), mpWindow::x2p(), and Y_BORDER_SEPARATION.
|
overrideprotectedvirtual |
Reimplemented from mpScaleBase.
Definition at line 1059 of file mathplot.cpp.
References std::abs(), computeSlaveTicks(), mpScaleBase::GetDataRange(), getVisibleDataRange(), mpScaleBase::m_absVisibleMaxV, m_masterScale, mpScaleBase::m_tickLabels, mpScaleBase::m_tickValues, and mpScaleBase::updateTickLabels().
Referenced by Plot().
|
inlineinherited |
Definition at line 761 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::ResetScales().
|
inline |
Set Y axis alignment.
align | alignment (choose between mpALIGN_BORDER_LEFT, mpALIGN_LEFT, mpALIGN_CENTER, mpALIGN_RIGHT, mpALIGN_BORDER_RIGHT) |
Definition at line 967 of file mathplot.h.
|
inlineinherited |
Set layer brush.
brush | brush, will be copied to internal class member |
Definition at line 310 of file mathplot.h.
|
inlineinherited |
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points).
Definition at line 253 of file mathplot.h.
Referenced by TRACE::TRACE().
|
inlineinherited |
Definition at line 727 of file mathplot.h.
|
inlineinherited |
Set Draw mode: inside or outside margins.
Default is outside, which allows the layer to draw up to the mpWindow border.
drawModeOutside | The draw mode to be set |
Definition at line 281 of file mathplot.h.
Referenced by CURSOR::CURSOR(), and TRACE::TRACE().
|
inlineinherited |
Set layer font.
font | Font, will be copied to internal class member |
Definition at line 272 of file mathplot.h.
|
inline |
Definition at line 981 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::AddTrace(), SIM_PLOT_PANEL::prepareDCAxes(), and SIM_PLOT_PANEL::updateAxes().
|
inlinevirtualinherited |
Set layer name.
name | Name, will be copied to internal class member |
Reimplemented in TRACE.
Definition at line 267 of file mathplot.h.
References name.
Referenced by SIM_PLOT_PANEL::prepareDCAxes(), TRACE::SetName(), and SIM_PLOT_PANEL::updateAxes().
|
inlineinherited |
Definition at line 711 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::prepareDCAxes(), and SIM_PLOT_PANEL::updateAxes().
|
inlineinherited |
Set layer pen.
pen | Pen, will be copied to internal class member |
Definition at line 277 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::UpdateTraceStyle().
|
inline |
Set Y axis ticks or grid.
ticks | true to plot axis ticks, false to plot grid. |
Definition at line 971 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::ShowGrid().
|
inlineinherited |
Sets layer visibility.
show | visibility bool. |
Definition at line 302 of file mathplot.h.
Referenced by mpWindow::SetLayerVisible(), SIM_PLOT_PANEL::ShowLegend(), and SIM_PLOT_PANEL::SIM_PLOT_PANEL().
|
inlineinherited |
Shows or hides the text label with the name of the layer (default is visible).
Definition at line 262 of file mathplot.h.
Referenced by TRACE::TRACE().
|
inlineprotectedinherited |
Definition at line 802 of file mathplot.h.
Referenced by mpScaleXBase::Plot(), and Plot().
|
inlineinherited |
Definition at line 791 of file mathplot.h.
|
overridevirtual |
Reimplemented from mpScaleBase.
Definition at line 2863 of file mathplot.cpp.
References mpScaleBase::m_offset, and mpScaleBase::m_scale.
Referenced by computeSlaveTicks(), and getVisibleDataRange().
|
overridevirtual |
Reimplemented from mpScaleBase.
Definition at line 2857 of file mathplot.cpp.
References mpScaleBase::m_offset, and mpScaleBase::m_scale.
Referenced by computeSlaveTicks(), and Plot().
|
protectedinherited |
Definition at line 952 of file mathplot.cpp.
References mpScaleBase::computeLabelExtents(), and mpScaleBase::formatLabels().
Referenced by mpScaleX::recalculateTicks(), mpScaleXLog::recalculateTicks(), and recalculateTicks().
|
protectedinherited |
Definition at line 834 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleBase::mpScaleBase(), mpScaleX::recalculateTicks(), and recalculateTicks().
|
protectedinherited |
Definition at line 316 of file mathplot.h.
|
protectedinherited |
Definition at line 318 of file mathplot.h.
Referenced by CURSOR::Plot(), mpFXY::Plot(), and mpMovableObject::Plot().
|
protectedinherited |
Definition at line 320 of file mathplot.h.
Referenced by mpScaleXBase::getVisibleDataRange(), getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), and Plot().
|
protected |
Definition at line 1002 of file mathplot.h.
Referenced by Plot().
|
protectedinherited |
Definition at line 314 of file mathplot.h.
Referenced by mpInfoCoords::Plot(), mpInfoLegend::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), Plot(), mpText::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
protected |
Definition at line 998 of file mathplot.h.
Referenced by computeSlaveTicks(), and recalculateTicks().
|
protectedinherited |
Definition at line 840 of file mathplot.h.
Referenced by mpScaleBase::computeLabelExtents(), mpScaleBase::mpScaleBase(), and mpScaleXBase::Plot().
|
protectedinherited |
Definition at line 841 of file mathplot.h.
Referenced by mpScaleBase::computeLabelExtents(), and mpScaleBase::mpScaleBase().
|
protectedinherited |
Definition at line 838 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleBase::mpScaleBase(), mpScaleXBase::Plot(), Plot(), mpScaleXLog::TransformFromPlot(), and mpScaleXLog::TransformToPlot().
|
protectedinherited |
Definition at line 838 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleBase::mpScaleBase(), mpScaleXBase::Plot(), Plot(), mpScaleXLog::TransformFromPlot(), and mpScaleXLog::TransformToPlot().
|
protectedinherited |
Definition at line 317 of file mathplot.h.
Referenced by mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
protectedinherited |
Definition at line 836 of file mathplot.h.
Referenced by mpScaleBase::mpScaleBase(), mpScaleXBase::Plot(), and Plot().
|
protectedinherited |
Definition at line 833 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleBase::mpScaleBase(), mpScaleXBase::Plot(), Plot(), mpScaleX::TransformFromPlot(), TransformFromPlot(), mpScaleX::TransformToPlot(), and TransformToPlot().
|
protectedinherited |
Definition at line 315 of file mathplot.h.
Referenced by mpLayer::GetColourSquare(), mpInfoLayer::Plot(), mpInfoCoords::Plot(), mpInfoLegend::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), Plot(), mpText::Plot(), and mpMovableObject::Plot().
|
protectedinherited |
Definition at line 839 of file mathplot.h.
Referenced by mpScaleBase::mpScaleBase().
|
protectedinherited |
Definition at line 833 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleBase::mpScaleBase(), mpScaleXBase::Plot(), Plot(), mpScaleX::TransformFromPlot(), TransformFromPlot(), mpScaleX::TransformToPlot(), and TransformToPlot().
|
protectedinherited |
Definition at line 319 of file mathplot.h.
Referenced by mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
protectedinherited |
Definition at line 831 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleXBase::Plot(), Plot(), mpScaleX::recalculateTicks(), mpScaleXLog::recalculateTicks(), and recalculateTicks().
|
protected |
Definition at line 1003 of file mathplot.h.
Referenced by Plot().
|
protectedinherited |
Definition at line 830 of file mathplot.h.
Referenced by computeSlaveTicks(), mpScaleX::recalculateTicks(), mpScaleXLog::recalculateTicks(), and recalculateTicks().
|
protectedinherited |
Definition at line 321 of file mathplot.h.
Referenced by mpInfoLayer::mpInfoLayer().
|
protectedinherited |
Definition at line 322 of file mathplot.h.
Referenced by CURSOR::Plot(), mpInfoLayer::Plot(), mpInfoCoords::Plot(), mpInfoLegend::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), Plot(), mpText::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().