QtiPlot  0.9.8.2
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
Graph Class Reference

A 2D-plotting widget. More...

#include <Graph.h>

Inheritance diagram for Graph:

Public Types

enum  Axis { Left, Right, Bottom, Top }
 
enum  AxisTitlePolicy { Default, ColName, ColComment, NameAndComment }
 
enum  CurveType {
  Line, Scatter, LineSymbols, VerticalBars,
  Area, Pie, VerticalDropLines, Spline,
  HorizontalSteps, Histogram, HorizontalBars, VectXYXY,
  ErrorBars, Box, VectXYAM, VerticalSteps,
  ColorMap, GrayScale, Contour, Function,
  ImagePlot, StackBar, StackColumn
}
 
enum  LegendDisplayMode {
  Auto, ColumnName, ColumnComment, TableName,
  TableLegend, DataSetName
}
 
enum  MarkerType { None = -1, Text = 0, Arrow = 1, Image = 2 }
 
enum  Scale {
  Linear, Log10, Ln, Log2,
  Reciprocal, Probability, Logit
}
 
enum  Ticks { NoTicks = 0, Out = 1, InOut = 2, In = 3 }
 

Public Slots

bool addCurves (Table *w, const QStringList &names, int style=0, double lWidth=1, int sSize=3, int startRow=0, int endRow=-1)
 
void copy (Graph *g)
 
void copyCurves (Graph *g)
 
void copyEnrichments (Graph *g)
 
void copyScaleDraw (Graph *g, int i)
 
void copyScaleWidget (Graph *g, int i)
 
int curveCount ()
 
DataCurveinsertCurve (Table *w, const QString &name, int style, int startRow=0, int endRow=-1)
 
DataCurveinsertCurve (Table *w, int xcol, const QString &name, int style)
 
DataCurveinsertCurve (Table *w, const QString &xColName, const QString &yColName, int style, int startRow=0, int endRow=-1)
 
DataCurveinsertCurve (Table *xt, const QString &xColName, Table *yt, const QString &yColName, int style, int startRow=0, int endRow=-1)
 
void insertCurve (QwtPlotItem *c)
 
void insertPlotItem (QwtPlotItem *i, int type)
 
void reloadCurvesData ()
 
void removeCurve (QwtPlotItem *it)
 
void removeCurve (int index)
 Removes a curve defined by its index. More...
 
void removeCurve (const QString &s)
 Removes a curve defined by its title string s. More...
 
void removeCurves (const QString &s)
 Removes all curves defined by the title/plot association string s. More...
 
void showCurve (int index, bool visible=true)
 Shows/Hides a curve defined by its index. More...
 
void updateCurvesData (Table *w, const QString &yColName)
 
int visibleCurves ()
 
Pie Curves
bool isPiePlot ()
 Returns true if this Graph is a pie plot, false otherwise. More...
 
PieCurveplotPie (Table *w, const QString &name, int startRow=0, int endRow=-1)
 Used when creating a pie plot. More...
 
PieCurveplotPie (Table *w, const QString &name, const QPen &pen, int brush, int size, int firstColor, int startRow=0, int endRow=-1, bool visible=true, double d_start_azimuth=270, double d_view_angle=90, double d_thickness=33, double d_horizontal_offset=0.0, double d_edge_dist=25, bool d_counter_clockwise=false, bool d_auto_labeling=true, bool d_values=false, bool d_percentages=true, bool d_categories=false, bool d_fixed_labels_pos=true)
 Used when restoring a pie plot from a project file. More...
 
void removePie ()
 
QString pieLegendText ()
 
QString savePieCurveLayout ()
 

Signals

void axisDblClicked (int)
 
void axisDivChanged (Graph *, int)
 
void closedGraph ()
 
void currentColorChanged (const QColor &)
 
void currentFontChanged (const QFont &)
 
void cursorInfo (const QString &)
 
void dataRangeChanged ()
 
void drawLineEnded (bool)
 
void enableTextEditor (Graph *)
 
void hiddenPlot (QWidget *)
 
void modifiedGraph ()
 
void selectedCanvas (Graph *)
 
void selectedGraph (Graph *)
 
void selectionChanged (SelectionMoveResizer *)
 
void showAxisDialog (int)
 
void showAxisTitleDialog ()
 
void showContextMenu ()
 
void showCurveContextMenu (QwtPlotItem *)
 
void showFitResults (const QString &)
 
void showMarkerPopupMenu ()
 
void showPlotDialog (int)
 
void updatedLayout (Graph *)
 
void viewLineDialog ()
 
void viewTitleDialog ()
 

Public Member Functions

void activateGraph ()
 
FrameWidgetactiveEnrichment ()
 
LegendWidgetactiveText ()
 
PlotToolInterfaceactiveTool () const
 Return the active tool, or NULL if none is active. More...
 
FrameWidgetadd (FrameWidget *fw, bool copy=true)
 
void addFitCurve (QwtPlotCurve *c)
 
QwtHistogramaddHistogram (Matrix *m)
 Add a matrix histogram to the graph. More...
 
void addLegendItem ()
 
TexWidgetaddTexFormula (const QString &s, const QPixmap &pix)
 
QStringList analysableCurvesList ()
 Returns the names of all the curves suitable for data analysis, as a string list. The list excludes error bars and spectrograms. More...
 
bool antialiasing ()
 
bool autoscaleFonts ()
 
int axesLinewidth () const
 
void axisLabelFormat (int axis, char &f, int &prec) const
 
int axisLabelFormat (int axis)
 
int axisLabelPrecision (int axis)
 
double axisStep (int axis)
 
AxisTitlePolicy axisTitlePolicy ()
 
QRect boundingRect ()
 
void changeCurveIndex (int fromIndex, int toIndex)
 
void clearAxisTitle ()
 
QwtPlotItem * closestCurve (int xpos, int ypos, int &dist, int &point)
 
void copyAxisTitle ()
 
void copyTitle ()
 
void createTable (const QString &curveName)
 Provided for convenience in scripts. More...
 
void createTable (const QwtPlotCurve *curve)
 
PlotCurvecurve (int index)
 get curve by index More...
 
PlotCurvecurve (const QString &title)
 get curve by name More...
 
int curveIndex (QwtPlotItem *c)
 Map curve pointer to index. More...
 
int curveIndex (const QString &title)
 map curve title to index More...
 
QStringList curveNamesList ()
 Returns the names of all the QwtPlotCurve items on the plot, as a string list. More...
 
QString curveRange (QwtPlotCurve *c)
 returns the curve range information as a string: "curve_name [start:end]" More...
 
QList< QwtPlotItem * > curvesList ()
 
QString curveTitle (int index)
 get curve title string by inde (convenience function for scripts) More...
 
void cutAxisTitle ()
 
void cutTitle ()
 
DataCurvedataCurve (int index)
 
void deleteFitCurves ()
 
void deselect ()
 
void deselect (QWidget *)
 
void disableCurveAntialiasing (bool disable, int maxPoints)
 
void disableImageProfilesTool ()
 
void disableTools ()
 
void enableAutoscaling (bool on=true)
 
void enableDouglasPeukerSpeedMode (double tolerance, int maxPoints=3000)
 
void enablePanningMagnifier (bool on=true, int mode=0)
 
bool enableRangeSelectors (const QObject *status_target=NULL, const char *status_slot="")
 
void enableTextEditor ()
 
QList< FrameWidget * > enrichmentsList ()
 
QList< QwtPlotCurve * > fitCurvesList ()
 
QColor frameColor ()
 
FunctionCurvefunctionCurve (int index)
 
double getDouglasPeukerTolerance ()
 
QList< int > getMajorTicksType ()
 
QList< int > getMinorTicksType ()
 
 Graph (int x=0, int y=0, int width=500, int height=400, QWidget *parent=0, Qt::WFlags f=0)
 
Gridgrid ()
 
bool hasActiveTool ()
 Returns true if a plot/data tool is enabled. More...
 
bool hasGridOnTop ()
 
bool hasPanningMagnifierEnabled ()
 
bool hasSeletedItems ()
 
bool hasSynchronizedScaleDivisions ()
 
void hideSelectedAxis ()
 
QPointer< ImageProfilesToolimageProfilesTool ()
 
QList< FrameWidget * > increasingAreaEnrichmentsList ()
 
void insertMarker (QwtPlotMarker *m)
 
void invertScale (int axis)
 Set axis scale. More...
 
bool isAutoscalingEnabled ()
 
bool isCurveAntialiasingDisabled ()
 
bool isCurveAntialiasingEnabled (QwtPlotItem *it)
 
bool isMissingDataGapEnabled ()
 
bool isPrinting ()
 
QwtPlotMagnifier * magnifyTool ()
 
int majorTickLength () const
 
int maxAntialisingSize ()
 
int minorTickLength () const
 
MultiLayermultiLayer () const
 Returns a pointer to the parent MultiLayer object. More...
 
void notifyChanges ()
 
void notifyColorChange (const QColor &c)
 
void notifyFontChange (const QFont &f)
 
int oppositeAxis (int axis)
 
QRectF pageGeometry ()
 
const QColor & paletteBackgroundColor () const
 
QwtPlotItem * plotItem (int index)
 get plotted item by index More...
 
QStringList plotItemsList ()
 Returns the names of all plot items, including spectrograms, as a string list. More...
 
SpectrogramplotSpectrogram (Matrix *m, CurveType type)
 Add a spectrogram to the graph. More...
 
void print (QPainter *, const QRect &rect, const QwtPlotPrintFilter &=QwtPlotPrintFilter())
 Paint the plot into a given rectangle. Paint the contents of a QwtPlot instance into a given rectangle (Qwt modified code). More...
 
void raiseEnrichements ()
 
int range (const QString &curveTitle, double *start, double *end)
 
int range (QwtPlotCurve *c, double *start, double *end)
 
bool rangeSelectorsEnabled ()
 
QPointer< RangeSelectorToolrangeSelectorTool ()
 
void remove (FrameWidget *)
 
void removeAxisTitle ()
 
void restoreCurveLabels (int curveID, const QStringList &lst)
 Used when restoring DataCurve curveID from a project file. More...
 
QwtHistogramrestoreHistogram (Matrix *m, const QStringList &l)
 Restores a histogram from a project file. More...
 
void restoreSpectrogram (ApplicationWindow *app, const QStringList &lst)
 Restores a spectrogram. Used when opening a project file. More...
 
void reverseCurveOrder ()
 
void select (QWidget *l, bool add=false)
 
void selectCanvas ()
 
QwtPlotItem * selectedCurveLabels ()
 
double selectedXEndValue ()
 
double selectedXStartValue ()
 
QPointer< SelectionMoveResizerselectionMoveResizer ()
 
void setActiveText (LegendWidget *l)
 
void setActiveTool (PlotToolInterface *tool)
 Change the active tool, deleting the old one if it exists. More...
 
void setAntialiasing (bool on=true, bool update=true)
 Enables/Disables antialiasing of plot items. More...
 
void setAutoScale ()
 
void setAutoscaleFonts (bool on=true)
 
void setAxesLinewidth (int width)
 
void setAxisStep (int axis, double step)
 
void setAxisTitlePolicy (const AxisTitlePolicy &policy)
 
void setBarsGap (int curve, int gapPercent, int offset)
 Used for VerticalBars, HorizontalBars and Histograms. More...
 
void setCanvasCoordinates (const QRectF &)
 
void setCanvasGeometry (const QRect &canvasRect)
 Adjust plot content to its canvas size. More...
 
void setCanvasGeometry (int x, int y, int w, int h)
 Convenience function for scripts. More...
 
void setCanvasSize (const QSize &size)
 Adjust plot content to its canvas size. More...
 
void setCanvasSize (int w, int h)
 Convenience function for scripts. More...
 
void setCurrentColor (const QColor &c)
 
void setCurrentFont (const QFont &f)
 
void setCurvesList (QList< QwtPlotItem *> lst)
 
void setGridOnTop (bool on=true, bool update=true)
 
void setMajorTicksType (int axis, int type)
 
void setMinorTicksType (int axis, int type)
 
void setPageGeometry (const QRectF &r)
 
void setScale (int axis, double start, double end, double step=0.0, int majorTicks=5, int minorTicks=5, int type=0, bool inverted=false, double left_break=-DBL_MAX, double right_break=DBL_MAX, int pos=50, double stepBeforeBreak=0.0, double stepAfterBreak=0.0, int minTicksBeforeBreak=4, int minTicksAfterBreak=4, bool log10AfterBreak=false, int breakWidth=4, bool breakDecoration=true)
 
void setSynchronizedScaleDivisions (bool on)
 
void setTickLength (int minLength, int majLength)
 
void showAxisContextMenu (int axis)
 
void showAxisDialog ()
 
void showAxisTitleMenu ()
 
void showGrid ()
 Convenience function enabling the grid for QwtScaleDraw::Left and Bottom Scales. More...
 
void showGrid (int axis)
 Convenience function enabling the grid for a user defined axis. More...
 
void showGrids ()
 
void showMissingDataGap (bool on=true, bool update=true)
 
void showScaleDialog ()
 
void showTitleContextMenu ()
 
Spectrogramspectrogram (Matrix *m)
 Returns a pointer to the spectrogram which data source is matrix m (the pointer can be NULL) More...
 
int speedModeMaxPoints ()
 
QList< LegendWidget * > textsList ()
 
void updateCurveLabels ()
 
void updateCurveNames (const QString &oldName, const QString &newName, bool updateTableName=true)
 
void updateDataCurves ()
 
void updateLayout ()
 Adjust plot content to its current size. Must be reimplemented because the base implementation adds a mask causing an ugly drawing artefact. More...
 
void updateOppositeScaleDiv (int axis)
 
void updatePlot ()
 
void updateScale ()
 
void updateSecondaryAxis (int axis, bool changeFormat=false)
 
bool validCurvesDataSize ()
 
 ~Graph ()
 
Customizing plot curves
void setCurveStyle (int index, int s)
 
void setCurveFullRange (int curveIndex)
 
void setCurveLineColor (int curveIndex, int colorIndex)
 
void setCurveLineColor (int curveIndex, QColor qColor)
 
void setCurveLineStyle (int curveIndex, Qt::PenStyle style)
 
void setCurveLineWidth (int curveIndex, double width)
 
void setGrayScale ()
 
void setIndexedColors ()
 
Error Bars
ErrorBarsCurveaddErrorBars (const QString &xColName, const QString &yColName, Table *errTable, const QString &errColName, int type=1, double width=1, int cap=8, const QColor &color=QColor(Qt::black), bool through=true, bool minus=true, bool plus=true)
 
ErrorBarsCurveaddErrorBars (const QString &yColName, Table *errTable, const QString &errColName, int type=1, double width=1, int cap=8, const QColor &color=QColor(Qt::black), bool through=true, bool minus=true, bool plus=true)
 
ErrorBarsCurveaddErrorBars (DataCurve *c, Table *errTable, const QString &errColName, int type=1, double width=1, int cap=8, const QColor &color=QColor(Qt::black), bool through=true, bool minus=true, bool plus=true)
 
void updateErrorBars (ErrorBarsCurve *er, bool xErr, double width, int cap, const QColor &c, bool plus, bool minus, bool through)
 
void loadErrorBars (QList< ErrorBarsCurve *> errBars, QList< int > mcIndexes)
 Used when restoring project files. More...
 
DataCurvemasterCurve (ErrorBarsCurve *er)
 Returns a valid master curve for the error bars curve. More...
 
DataCurvemasterCurve (const QString &xColName, const QString &yColName)
 Returns a valid master curve for a plot association. More...
 
Event Handlers
bool mousePressed (QEvent *)
 
void contextMenuEvent (QContextMenuEvent *)
 
void closeEvent (QCloseEvent *e)
 
bool focusNextPrevChild (bool next)
 
Zoom
void zoomed (const QwtDoubleRect &)
 
void zoom (bool on)
 
void zoomOut ()
 
bool zoomOn ()
 
Texts
LegendWidgetaddText (LegendWidget *)
 
LegendWidgetinsertText (const QStringList &list, int fileVersion)
 Used when opening a project file. More...
 
LegendWidgetaddTimeStamp ()
 
void removeLegendItem (int index)
 
void insertLegend (const QStringList &lst, int fileVersion)
 
LegendWidgetnewLegend (const QString &text=QString())
 
QString legendText (bool layerSpec=false, int fromIndex=0)
 Creates a new legend text using the curves titles. More...
 
Obsolete functions provided to keep existing Python scripts working
LegendWidgetlegend ()
 
void setLegend (const QString &)
 
void removeLegend ()
 
Line Markers
ArrowMarkeraddArrow (ArrowMarker *mrk)
 
void remove (ArrowMarker *arrow)
 
void addArrow (QStringList list, int fileVersion)
 Used when opening a project file. More...
 
QList< ArrowMarker * > arrowsList ()
 
int numArrows ()
 
void drawLine (bool on, bool arrow=false)
 Draws a line/arrow depending on the value of "arrow". More...
 
bool drawArrow ()
 
bool drawLineActive ()
 
bool arrowMarkerSelected ()
 
Image Markers
ImageWidgetaddImage (ImageWidget *i)
 
ImageWidgetaddImage (const QString &fileName)
 
ImageWidgetaddImage (const QImage &image)
 
void insertImageMarker (const QStringList &lst, int fileVersion)
 
bool imageMarkerSelected ()
 
Common to all Markers
void removeMarker ()
 
void updateMarkersBoundingRect (bool rescaleEvent=true)
 Keep the markers on screen each time the scales are modified by adding/removing curves. More...
 
void setSelectedArrow (ArrowMarker *mrk, bool add=false)
 Set the selected arrow. More...
 
ArrowMarkerselectedArrow ()
 
bool markerSelected ()
 
void deselectMarker ()
 Reset any selection states on markers. More...
 
Axes
QwtScaleWidget * currentScale ()
 
QwtScaleWidget * selectedScale ()
 
QRect axisTitleRect (const QwtScaleWidget *scale)
 
bool axisTitleSelected ()
 
ScaleDraw::ScaleType axisType (int axis)
 
void setXAxisTitle (const QString &text)
 
void setYAxisTitle (const QString &text)
 
void setRightAxisTitle (const QString &text)
 
void setTopAxisTitle (const QString &text)
 
QString axisTitleString (int axis)
 
void setAxisTitleString (int axis, const QString &text)
 
void setAxisTitle (int axis, const QString &text)
 
void updateAxesTitles ()
 
void updateAxisTitle (int axis)
 
void setScaleTitle (int axis, const QString &text)
 TODO: eliminate this function in version 0.9.1 (used only when restoring project files) More...
 
QFont axisTitleFont (int axis)
 
void setAxisTitleFont (int axis, const QFont &fnt)
 
void setAxisFont (int axis, const QFont &fnt)
 
void initFonts (const QFont &scaleTitleFnt, const QFont &numbersFnt)
 
QColor axisTitleColor (int axis)
 
void setAxisTitleColor (int axis, const QColor &c)
 
int axisTitleAlignment (int axis)
 
void setAxisTitleAlignment (int axis, int align)
 
int axisTitleDistance (int axis)
 
void setAxisTitleDistance (int axis, int dist)
 
QColor axisColor (int axis)
 
void setAxisColor (int axis, const QColor &color)
 
QColor axisLabelsColor (int axis)
 
void setAxisLabelsColor (int axis, const QColor &color)
 
void showAxis (int axis, int type, const QString &formatInfo, Table *table, bool axisOn, int majTicksType, int minTicksType, bool labelsOn, const QColor &c, int format, int prec, int rotation, int baselineDist, const QString &formula, const QColor &labelsColor, int spacing=4, bool backbone=true, const ScaleDraw::ShowTicksPolicy &showTicks=ScaleDraw::ShowAll, const QString &prefix=QString::null, const QString &suffix=QString::null)
 
void enableAxis (int axis, bool on=true)
 
void enableAxisLabels (int axis, bool on=true)
 
int labelsRotation (int axis)
 
void setAxisLabelRotation (int axis, int rotation)
 
void loadAxesLinewidth (int width)
 used when opening a project file More...
 
void drawAxesBackbones (bool yes)
 
bool axesBackbones ()
 
void loadAxesOptions (const QStringList &lst)
 used when opening a project file More...
 
void setAxisMargin (int axis, int margin)
 
void setMajorTicksType (const QList< int > &lst)
 
void setMajorTicksType (const QStringList &lst)
 
void setMinorTicksType (const QList< int > &lst)
 
void setMinorTicksType (const QStringList &lst)
 
void setAxisTicksLength (int axis, int majTicksType, int minTicksType, int minLength, int majLength)
 
void setTicksLength (int minLength, int majLength)
 
void changeTicksLength (int minLength, int majLength)
 
void setLabelsNumericFormat (const QStringList &l)
 Used for restoring project files. More...
 
void setLabelsNumericFormat (int axis, int format, int prec=6, const QString &formula=QString())
 
void setLabelsDateTimeFormat (int axis, int type, const QString &formatInfo)
 
void setLabelsDayFormat (int axis, int format)
 
void setLabelsMonthFormat (int axis, int format)
 
void recoverObsoleteDateTimeScale (int axis, int type, const QString &origin, const QString &format)
 
QString axisFormatInfo (int axis)
 
void setLabelsTextFormat (int axis, int type, const QString &name, const QStringList &lst)
 
void setLabelsTextFormat (int axis, int type, const QString &labelsColName, Table *table)
 
QString axisFormula (int axis)
 
void setAxisFormula (int axis, const QString &)
 
Canvas Frame
void setCanvasFrame (int width=1, const QColor &color=QColor(Qt::black))
 
QColor canvasFrameColor ()
 
int canvasFrameWidth ()
 
Canvas Image Background
QString canvasBackgroundFileName ()
 
void setCanvasBackgroundImage (const QString &fn=QString(), bool update=true)
 
QPixmap backgroundPixmap ()
 
Plot Title
void setTitleFont (const QFont &fnt)
 
void setTitleColor (const QColor &c)
 
void setTitleAlignment (int align)
 
bool titleSelected ()
 
void selectTitle (bool select=true)
 
void clearTitle ()
 Sets the title to an "almost empty" string: " ", thus keeping the QwtText object visible. More...
 
void removeTitle ()
 Sets title to an empty string and hides the text label. More...
 
void initTitle (bool on, const QFont &fnt)
 
Border and background
void setFrame (int width=1, const QColor &color=Qt::black)
 
void setBackgroundColor (const QColor &color)
 
User-defined Functions
void modifyFunctionCurve (int curve, int type, const QStringList &formulas, const QString &var, double start, double end, int points, const QMap< QString, double > &constants)
 
FunctionCurveaddFunction (const QStringList &formulas, double start, double end, int points=100, const QString &var="x", int type=0, const QString &title=QString::null)
 
FunctionCurveinsertFunctionCurve (const QString &formula, int points, int fileVersion)
 Used when reading from a project file with version < 0.9.5. More...
 
QString generateFunctionName (const QString &name=tr("F"))
 Returns an unique function name. More...
 
Vector Curves
VectorCurveplotVectors (Table *w, const QStringList &colList, int style, int startRow=0, int endRow=-1)
 
void updateVectorsLayout (int curve, const QColor &color, double width, int arrowLength, int arrowAngle, bool filled, int position, const QString &xEndColName=QString(), const QString &yEndColName=QString())
 
Box Plots
BoxCurveopenBoxDiagram (Table *w, const QStringList &l, int fileVersion)
 
void plotBox (Table *w, const QStringList &names, int startRow=0, int endRow=-1)
 
BoxCurveboxCurve (int index)
 
Resizing
void resizeEvent (QResizeEvent *e)
 
void scaleFonts (double factor)
 
Waterfall
bool isWaterfallPlot ()
 
int waterfallXOffset ()
 
int waterfallYOffset ()
 
void setWaterfallOffset (int x, int y, bool update=false)
 
void setWaterfallXOffset (int)
 
void setWaterfallYOffset (int)
 
void setWaterfallSideLines (bool on=true)
 
void setWaterfallFillColor (const QColor &)
 
void updateWaterfallFill (bool on)
 

Static Public Member Functions

static Qt::PenStyle getPenStyle (const QString &s)
 
static Qt::PenStyle getPenStyle (int style)
 
static int obsoleteSymbolStyle (int type)
 
static QString penStyleName (Qt::PenStyle style)
 
static void showPlotErrorMessage (QWidget *parent, const QStringList &emptyColumns)
 

Private Slots

void selectorDeleted ()
 

Private Member Functions

QwtDoubleInterval axisBoundingInterval (int axis)
 Finds bounding interval of the plot data. More...
 
void deselectCurves ()
 
void dragEnterEvent (QDragEnterEvent *)
 
void drawBreak (QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis) const
 
void drawInwardTicks (QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis, bool min, bool maj) const
 
virtual void drawItems (QPainter *painter, const QRect &rect, const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const
 
void dropEvent (QDropEvent *)
 
QString parseAxisTitle (int axis)
 
void printCanvas (QPainter *painter, const QRect &canvasRect, const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const
 
void printFrame (QPainter *painter, const QRect &rect) const
 
virtual void printScale (QPainter *, int axisId, int startDist, int endDist, int baseDist, const QRect &) const
 Paint a scale into a given rectangle. Paint the scale into a given rectangle (modified code from Qwt). More...
 
void showEvent (QShowEvent *event)
 
QList< FrameWidget * > stackingOrderEnrichmentsList () const
 

Private Attributes

bool autoScaleFonts
 
CanvasPickercp
 
FrameWidgetd_active_enrichment
 Pointer to the currently selected text/legend. More...
 
PlotToolInterfaced_active_tool
 The currently active tool, or NULL for default (pointer). More...
 
bool d_antialiasing
 Render hint for plot items. More...
 
bool d_auto_scale
 Flag indicating if the axes limits should be changed in order to show all data each time a curva data change occurs. More...
 
AxisTitlePolicy d_axis_title_policy
 
QStringList d_axis_titles
 
QString d_canvas_bkg_path
 
QPixmap d_canvas_bkg_pix
 
QList< QwtPlotItem * > d_curves
 List storing pointers to the curves on the plot. More...
 
bool d_disable_curve_antialiasing
 
double d_Douglas_Peuker_tolerance
 
QList< FrameWidget * > d_enrichments
 
QList< QwtPlotCurve * > d_fit_curves
 List storing pointers to the curves resulting after a fit session, in case the user wants to delete them later on. More...
 
Gridd_grid
 Pointer to the grid. More...
 
bool d_grid_on_top
 Flag telling if the grid should be drawn on top of data. More...
 
QPointer< ImageProfilesToold_image_profiles_tool
 
bool d_is_printing
 Flag telling if we are performing a print operation. More...
 
QList< ArrowMarker * > d_lines
 Arrows/lines on plot. More...
 
QwtPlotMagnifier * d_magnifier
 
int d_maj_tick_length
 
QPointer< SelectionMoveResizerd_markers_selector
 The markers selected for move/resize operations or NULL if none are selected. More...
 
int d_max_antialising_size
 
int d_min_tick_length
 Axes tick lengths. More...
 
bool d_missing_data_gap
 Flag telling if the curves line should be connected across missing data. More...
 
QRectF d_page_rect
 
QwtPlotPanner * d_panner
 
PlotToolInterfaced_peak_fit_tool
 
QPointer< RangeSelectorToold_range_selector
 The current curve selection, or NULL if none is active. More...
 
ArrowMarkerd_selected_arrow
 Pointer to the currently selected line/image. More...
 
int d_speed_mode_points
 
bool d_synchronize_scales
 
QVector< double > d_user_step
 Stores the step the user specified for the four scale. If step = 0.0, the step will be calculated automatically by the Qwt scale engine. More...
 
int d_waterfall_offset_x
 
int d_waterfall_offset_y
 
QwtPlotZoomer * d_zoomer [2]
 
bool drawArrowOn
 
bool drawAxesBackbone
 
bool drawLineOn
 
ScalePickerscalePicker
 
TitlePickertitlePicker
 

Output: Copy/Export/Print

void print ()
 
void copyImage ()
 
QPixmap graphPixmap (const QSize &size=QSize(), double scaleFontsFactor=1.0, bool transparent=false)
 
void exportToFile (const QString &fileName)
 Provided for convenience in scripts. More...
 
void exportSVG (const QString &fname, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
 
void exportEMF (const QString &fname, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
 
void exportTeX (const QString &fname, bool color=true, bool escapeStrings=true, bool fontSizes=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
 
void exportVector (const QString &fileName, int res=0, bool color=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
 
void exportVector (QPrinter *printer, int res=0, bool color=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
 
void exportImage (const QString &fileName, int quality=100, bool transparent=false, int dpi=0, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0, int compression=0)
 
void draw (QPaintDevice *, const QSize &size, double fontsFactor=1.0)
 
static QSize customPrintSize (const QSizeF &customSize, int unit, int dpi)
 

Curves Layout

CurveLayout initCurveLayout (int style, int curves=0, bool guessLayout=true)
 
void updateCurveLayout (PlotCurve *c, const CurveLayout *cL)
 
void guessUniqueCurveLayout (int &colorIndex, int &symbolIndex)
 Tries to guess not already used curve color and symbol style. More...
 
static CurveLayout initCurveLayout ()
 

Saving/Restoring to/from file

QString saveToString (bool saveAsTemplate=false)
 
QString saveScale ()
 
QString saveScaleTitles ()
 
QString saveFonts ()
 
QString saveMarkers ()
 
QString saveCurveLayout (int index)
 
QString saveAxesTitleColors ()
 
QString saveAxesColors ()
 
QString saveEnabledAxes ()
 
QString saveCanvas ()
 
QString saveTitle ()
 
QString saveAxesTitleAlignement ()
 
QString saveEnabledTickLabels ()
 
QString saveTicksType ()
 
QString saveCurves ()
 
QString saveLabelsFormat ()
 
QString saveLabelsRotation ()
 
QString saveAxesLabelsType ()
 
QString saveAxesBaseline ()
 
QString saveAxesFormulas ()
 
QString saveAxesBackbones ()
 
QString saveTickLabelsSpace ()
 
QString saveLabelsPrefixAndSuffix ()
 
QString saveBackgroundImage ()
 
void restoreBackgroundImage (const QStringList &lst)
 
void restoreSymbolImage (int index, const QStringList &lst)
 
static QString rgbaName (const QColor &color)
 

Detailed Description

A 2D-plotting widget.

Graphs are managed by a MultiLayer, where they are sometimes referred to as "graphs" and sometimes as "layers". Other parts of the code also call them "plots", regardless of the fact that there's also a class Plot. Within the user interface, they are quite consistently called "layers".

Each graph owns a Plot called #d_plot, which handles parts of the curve, axis and marker management (similarly to QwtPlot), as well as the pickers d_zoomer (a QwtPlotZoomer), titlePicker (a TitlePicker), scalePicker (a ScalePicker) and cp (a CanvasPicker), which handle various parts of the user interaction.

Graph contains support for various curve types (see CurveType), some of them relying on Qtiplot-specific QwtPlotCurve subclasses for parts of the functionality.

Note that some of Graph's methods are implemented in analysis.cpp.

Future Plans

Merge with Plot and CanvasPicker. Think about merging in TitlePicker and ScalePicker. On the other hand, things like range selection, peak selection or (re)moving data points could be split out into tool classes like QwtPlotZoomer or SelectionMoveResizer.

What definitely should be split out are plot types like histograms and pie charts (TODO: which others?). We need a generic framework for this in any case so that new plot types can be implemented in plugins, and Graph could do with a little diet. Especially after merging in Plot and CanvasPicker. [ Framework needs to support plug-ins; assigned to ion ]

Member Enumeration Documentation

◆ Axis

Enumerator
Left 
Right 
Bottom 
Top 

◆ AxisTitlePolicy

Enumerator
Default 
ColName 
ColComment 
NameAndComment 

◆ CurveType

Enumerator
Line 
Scatter 
LineSymbols 
VerticalBars 
Area 
Pie 
VerticalDropLines 
Spline 
HorizontalSteps 
Histogram 
HorizontalBars 
VectXYXY 
ErrorBars 
Box 
VectXYAM 
VerticalSteps 
ColorMap 
GrayScale 
Contour 
Function 
ImagePlot 
StackBar 
StackColumn 

◆ LegendDisplayMode

Enumerator
Auto 
ColumnName 
ColumnComment 
TableName 
TableLegend 
DataSetName 

◆ MarkerType

Enumerator
None 
Text 
Arrow 
Image 

◆ Scale

Enumerator
Linear 
Log10 
Ln 
Log2 
Reciprocal 
Probability 
Logit 

◆ Ticks

Enumerator
NoTicks 
Out 
InOut 
In 

Constructor & Destructor Documentation

◆ Graph()

Graph::Graph ( int  x = 0,
int  y = 0,
int  width = 500,
int  height = 400,
QWidget *  parent = 0,
Qt::WFlags  f = 0 
)

◆ ~Graph()

Graph::~Graph ( )

Member Function Documentation

◆ activateGraph()

void Graph::activateGraph ( )

◆ activeEnrichment()

FrameWidget* Graph::activeEnrichment ( )
inline

◆ activeText()

LegendWidget * Graph::activeText ( )

◆ activeTool()

PlotToolInterface* Graph::activeTool ( ) const
inline

◆ add()

FrameWidget * Graph::add ( FrameWidget fw,
bool  copy = true 
)

◆ addArrow() [1/2]

ArrowMarker * Graph::addArrow ( ArrowMarker mrk)

◆ addArrow() [2/2]

void Graph::addArrow ( QStringList  list,
int  fileVersion 
)

◆ addCurves

bool Graph::addCurves ( Table w,
const QStringList &  names,
int  style = 0,
double  lWidth = 1,
int  sSize = 3,
int  startRow = 0,
int  endRow = -1 
)
slot

◆ addErrorBars() [1/3]

ErrorBarsCurve * Graph::addErrorBars ( const QString &  xColName,
const QString &  yColName,
Table errTable,
const QString &  errColName,
int  type = 1,
double  width = 1,
int  cap = 8,
const QColor &  color = QColor(Qt::black),
bool  through = true,
bool  minus = true,
bool  plus = true 
)

◆ addErrorBars() [2/3]

ErrorBarsCurve * Graph::addErrorBars ( const QString &  yColName,
Table errTable,
const QString &  errColName,
int  type = 1,
double  width = 1,
int  cap = 8,
const QColor &  color = QColor(Qt::black),
bool  through = true,
bool  minus = true,
bool  plus = true 
)

◆ addErrorBars() [3/3]

ErrorBarsCurve * Graph::addErrorBars ( DataCurve c,
Table errTable,
const QString &  errColName,
int  type = 1,
double  width = 1,
int  cap = 8,
const QColor &  color = QColor(Qt::black),
bool  through = true,
bool  minus = true,
bool  plus = true 
)

◆ addFitCurve()

void Graph::addFitCurve ( QwtPlotCurve *  c)

◆ addFunction()

FunctionCurve * Graph::addFunction ( const QStringList &  formulas,
double  start,
double  end,
int  points = 100,
const QString &  var = "x",
int  type = 0,
const QString &  title = QString::null 
)

◆ addHistogram()

QwtHistogram * Graph::addHistogram ( Matrix m)

◆ addImage() [1/3]

ImageWidget * Graph::addImage ( ImageWidget i)

◆ addImage() [2/3]

ImageWidget * Graph::addImage ( const QString &  fileName)

References d_enrichments, and modifiedGraph().

◆ addImage() [3/3]

ImageWidget * Graph::addImage ( const QImage &  image)

References d_enrichments, and modifiedGraph().

◆ addLegendItem()

void Graph::addLegendItem ( )

◆ addTexFormula()

TexWidget * Graph::addTexFormula ( const QString &  s,
const QPixmap &  pix 
)

References d_enrichments, and modifiedGraph().

Referenced by TexWidget::restore(), and setCanvasSize().

◆ addText()

LegendWidget * Graph::addText ( LegendWidget t)

◆ addTimeStamp()

LegendWidget * Graph::addTimeStamp ( )

◆ analysableCurvesList()

QStringList Graph::analysableCurvesList ( )

◆ antialiasing()

bool Graph::antialiasing ( )
inline

◆ arrowMarkerSelected()

bool Graph::arrowMarkerSelected ( )

◆ arrowsList()

QList<ArrowMarker *> Graph::arrowsList ( )
inline

◆ autoscaleFonts()

bool Graph::autoscaleFonts ( )
inline

◆ axesBackbones()

bool Graph::axesBackbones ( )
inline

◆ axesLinewidth()

int Graph::axesLinewidth ( ) const

◆ axisBoundingInterval()

QwtDoubleInterval Graph::axisBoundingInterval ( int  axis)
private

Finds bounding interval of the plot data.

Referenced by setScale(), and waterfallYOffset().

◆ axisColor()

QColor Graph::axisColor ( int  axis)

◆ axisDblClicked

void Graph::axisDblClicked ( int  )
signal

◆ axisDivChanged

void Graph::axisDivChanged ( Graph ,
int   
)
signal

Referenced by setScale(), waterfallYOffset(), and zoomed().

◆ axisFormatInfo()

QString Graph::axisFormatInfo ( int  axis)

◆ axisFormula()

QString Graph::axisFormula ( int  axis)

◆ axisLabelFormat() [1/2]

void Graph::axisLabelFormat ( int  axis,
char &  f,
int &  prec 
) const
Returns
the number format for the major scale labels of a specified axis
Parameters
axisaxis index
Return values
fformat character
precprecision

References ScaleDraw::labelFormat().

Referenced by copyScaleDraw(), saveLabelsFormat(), setCurvesList(), AxesDialog::setLabelsNumericFormat(), showAxis(), AxesDialog::showAxisFormatOptions(), and AxesDialog::updateLabelsFormat().

◆ axisLabelFormat() [2/2]

int Graph::axisLabelFormat ( int  axis)

◆ axisLabelPrecision()

int Graph::axisLabelPrecision ( int  axis)

◆ axisLabelsColor()

QColor Graph::axisLabelsColor ( int  axis)

◆ axisStep()

double Graph::axisStep ( int  axis)
inline

◆ axisTitleAlignment()

int Graph::axisTitleAlignment ( int  axis)

Referenced by selectedArrow().

◆ axisTitleColor()

QColor Graph::axisTitleColor ( int  axis)

◆ axisTitleDistance()

int Graph::axisTitleDistance ( int  axis)

◆ axisTitleFont()

QFont Graph::axisTitleFont ( int  axis)

◆ axisTitlePolicy()

AxisTitlePolicy Graph::axisTitlePolicy ( )
inline

References d_axis_title_policy.

Referenced by copy().

◆ axisTitleRect()

QRect Graph::axisTitleRect ( const QwtScaleWidget *  scale)

◆ axisTitleSelected()

bool Graph::axisTitleSelected ( )

◆ axisTitleString()

QString Graph::axisTitleString ( int  axis)

◆ axisType()

ScaleDraw::ScaleType Graph::axisType ( int  axis)

◆ backgroundPixmap()

QPixmap Graph::backgroundPixmap ( )
inline

◆ boundingRect()

QRect Graph::boundingRect ( )

◆ boxCurve()

BoxCurve * Graph::boxCurve ( int  index)

References Box, dataCurve(), and PlotCurve::type().

Referenced by fitCurvesList().

◆ canvasBackgroundFileName()

QString Graph::canvasBackgroundFileName ( )
inline

◆ canvasFrameColor()

QColor Graph::canvasFrameColor ( )

◆ canvasFrameWidth()

int Graph::canvasFrameWidth ( )

◆ changeCurveIndex()

void Graph::changeCurveIndex ( int  fromIndex,
int  toIndex 
)

◆ changeTicksLength()

void Graph::changeTicksLength ( int  minLength,
int  majLength 
)

◆ clearAxisTitle()

void Graph::clearAxisTitle ( )

◆ clearTitle()

void Graph::clearTitle ( )

Sets the title to an "almost empty" string: " ", thus keeping the QwtText object visible.

References modifiedGraph().

Referenced by backgroundPixmap(), ApplicationWindow::clearSelection(), and showTitleContextMenu().

◆ closedGraph

void Graph::closedGraph ( )
signal

Referenced by closeEvent(), and waterfallYOffset().

◆ closeEvent()

void Graph::closeEvent ( QCloseEvent *  e)

References closedGraph().

Referenced by curve().

◆ closestCurve()

QwtPlotItem * Graph::closestCurve ( int  xpos,
int  ypos,
int &  dist,
int &  point 
)

◆ contextMenuEvent()

void Graph::contextMenuEvent ( QContextMenuEvent *  e)

◆ copy

void Graph::copy ( Graph g)
slot

◆ copyAxisTitle()

void Graph::copyAxisTitle ( )

◆ copyCurves

void Graph::copyCurves ( Graph g)
slot

◆ copyEnrichments

void Graph::copyEnrichments ( Graph g)
slot

References add(), addArrow(), arrowsList(), and enrichmentsList().

Referenced by copy(), and setPageGeometry().

◆ copyImage()

void Graph::copyImage ( )

◆ copyScaleDraw

void Graph::copyScaleDraw ( Graph g,
int  i 
)
slot

◆ copyScaleWidget

void Graph::copyScaleWidget ( Graph g,
int  i 
)
slot

◆ copyTitle()

void Graph::copyTitle ( )

◆ createTable() [1/2]

void Graph::createTable ( const QString &  curveName)

Provided for convenience in scripts.

References curve().

Referenced by fitCurvesList(), and ApplicationWindow::showCurveWorksheet().

◆ createTable() [2/2]

void Graph::createTable ( const QwtPlotCurve *  curve)

◆ currentColorChanged

void Graph::currentColorChanged ( const QColor &  )
signal

◆ currentFontChanged

void Graph::currentFontChanged ( const QFont &  )
signal

◆ currentScale()

QwtScaleWidget * Graph::currentScale ( )

◆ cursorInfo

void Graph::cursorInfo ( const QString &  )
signal

Referenced by waterfallYOffset().

◆ curve() [1/2]

PlotCurve * Graph::curve ( int  index)

get curve by index

References d_curves.

Referenced by FFTDialog::accept(), FitDialog::accept(), FunctionDialog::acceptFunction(), FunctionDialog::acceptParametric(), FunctionDialog::acceptPolar(), InterpolationDialog::activateCurve(), SmoothCurveDialog::activateCurve(), IntegrationDialog::activateCurve(), PolynomFitDialog::activateCurve(), ExpDecayDialog::activateCurve(), FitDialog::activateCurve(), FFTDialog::activateDataSet(), ApplicationWindow::analysis(), ImageProfilesTool::append(), AssociationsDialog::changePlotAssociation(), RangeSelectorTool::clearMultipleSelection(), closestCurve(), RangeSelectorTool::copyMultipleSelection(), BaselineDialog::createBaseline(), createTable(), curveIndex(), dataCurve(), ApplicationWindow::differentiate(), LegendWidget::drawText(), FilterDialog::filter(), ExpDecayDialog::fit(), PolynomFitDialog::fit(), functionCurve(), LegendWidget::getCurve(), guessUniqueCurveLayout(), initCurveLayout(), insertFunctionCurve(), insertText(), IntegrationDialog::integrateCurve(), InterpolationDialog::interpolate(), DataPickerTool::keyEventFilter(), RangeSelectorTool::keyEventFilter(), legendText(), RangeSelectorTool::mightNeedMultipleSelection(), modifyFunctionCurve(), ApplicationWindow::openGraph(), parseAxisTitle(), ApplicationWindow::plotDoubleYAxis(), range(), RangeSelectorTool::RangeSelectorTool(), removeCurve(), CurvesDialog::removeCurves(), removePie(), PieLabel::restore(), restoreCurveLabels(), restoreSymbolImage(), saveCurveLayout(), savePieCurveLayout(), saveToString(), setBarsGap(), setCurveFullRange(), setCurveLineColor(), setCurveLineStyle(), setCurveLineWidth(), CurveRangeDialog::setCurvesToModify(), setCurveStyle(), CurveRangeDialog::setCurveToModify(), FunctionDialog::setCurveToModify(), Filter::setDataFromCurve(), setWaterfallFillColor(), setWaterfallSideLines(), ApplicationWindow::showDataSetDialog(), RangeSelectorTool::showSelectionDialog(), MultiLayer::showWaterfallFillDialog(), SmoothCurveDialog::smooth(), updateVectorsLayout(), and updateWaterfallFill().

◆ curve() [2/2]

PlotCurve* Graph::curve ( const QString &  title)
inline

◆ curveCount

int Graph::curveCount ( )
inlineslot

◆ curveIndex() [1/2]

int Graph::curveIndex ( QwtPlotItem *  c)
inline

◆ curveIndex() [2/2]

int Graph::curveIndex ( const QString &  title)
inline

map curve title to index

References curve(), dataCurve(), functionCurve(), and plotItemsList().

◆ curveNamesList()

QStringList Graph::curveNamesList ( )

Returns the names of all the QwtPlotCurve items on the plot, as a string list.

References d_curves.

Referenced by curve(), ApplicationWindow::dependingPlots(), MultiPeakFit::insertPeakFunctionCurve(), and ApplicationWindow::multilayerDependencies().

◆ curveRange()

QString Graph::curveRange ( QwtPlotCurve *  c)

◆ curvesList()

QList<QwtPlotItem *> Graph::curvesList ( )
inline

◆ curveTitle()

QString Graph::curveTitle ( int  index)

get curve title string by inde (convenience function for scripts)

References plotItem().

Referenced by curve().

◆ customPrintSize()

QSize Graph::customPrintSize ( const QSizeF &  customSize,
int  unit,
int  dpi 
)
static

◆ cutAxisTitle()

void Graph::cutAxisTitle ( )

◆ cutTitle()

void Graph::cutTitle ( )

References removeTitle().

Referenced by setAutoscaleFonts(), and showTitleContextMenu().

◆ dataCurve()

DataCurve * Graph::dataCurve ( int  index)

◆ dataRangeChanged

void Graph::dataRangeChanged ( )
signal

◆ deleteFitCurves()

void Graph::deleteFitCurves ( )

References d_fit_curves, and removeCurve().

Referenced by rangeSelectorTool().

◆ deselect() [1/2]

void Graph::deselect ( )

◆ deselect() [2/2]

void Graph::deselect ( QWidget *  l)

References d_markers_selector.

◆ deselectCurves()

void Graph::deselectCurves ( )
private

References curvesList(), and Function.

Referenced by deselect(), select(), and waterfallYOffset().

◆ deselectMarker()

void Graph::deselectMarker ( )

◆ disableCurveAntialiasing()

void Graph::disableCurveAntialiasing ( bool  disable,
int  maxPoints 
)

◆ disableImageProfilesTool()

void Graph::disableImageProfilesTool ( )

References d_image_profiles_tool.

Referenced by backgroundPixmap(), and ~Graph().

◆ disableTools()

void Graph::disableTools ( )

◆ dragEnterEvent()

void Graph::dragEnterEvent ( QDragEnterEvent *  e)
private

References multiLayer().

Referenced by waterfallYOffset().

◆ draw()

void Graph::draw ( QPaintDevice *  device,
const QSize &  size,
double  fontsFactor = 1.0 
)

◆ drawArrow()

bool Graph::drawArrow ( )
inline

◆ drawAxesBackbones()

void Graph::drawAxesBackbones ( bool  yes)

◆ drawBreak()

void Graph::drawBreak ( QPainter *  painter,
const QRect &  rect,
const QwtScaleMap &  map,
int  axis 
) const
private

◆ drawInwardTicks()

void Graph::drawInwardTicks ( QPainter *  painter,
const QRect &  rect,
const QwtScaleMap &  map,
int  axis,
bool  min,
bool  maj 
) const
private

◆ drawItems()

void Graph::drawItems ( QPainter *  painter,
const QRect &  rect,
const QwtScaleMap  map[axisCnt],
const QwtPlotPrintFilter &  pfilter 
) const
privatevirtual

◆ drawLine()

void Graph::drawLine ( bool  on,
bool  arrow = false 
)

Draws a line/arrow depending on the value of "arrow".

References drawArrowOn, drawLineEnded(), and drawLineOn.

Referenced by disableTools(), ApplicationWindow::drawArrow(), ApplicationWindow::drawLine(), CanvasPicker::eventFilter(), and numArrows().

◆ drawLineActive()

bool Graph::drawLineActive ( )
inline

◆ drawLineEnded

void Graph::drawLineEnded ( bool  )
signal

Referenced by drawLine(), and waterfallYOffset().

◆ dropEvent()

void Graph::dropEvent ( QDropEvent *  event)
private

◆ enableAutoscaling()

void Graph::enableAutoscaling ( bool  on = true)
inline

◆ enableAxis()

void Graph::enableAxis ( int  axis,
bool  on = true 
)

◆ enableAxisLabels()

void Graph::enableAxisLabels ( int  axis,
bool  on = true 
)

◆ enableDouglasPeukerSpeedMode()

void Graph::enableDouglasPeukerSpeedMode ( double  tolerance,
int  maxPoints = 3000 
)

◆ enablePanningMagnifier()

void Graph::enablePanningMagnifier ( bool  on = true,
int  mode = 0 
)

◆ enableRangeSelectors()

bool Graph::enableRangeSelectors ( const QObject *  status_target = NULL,
const char *  status_slot = "" 
)

Enables the data range selector tool.

This one is a bit special, because other tools can depend upon an existing selection. Therefore, range selection (like zooming) has to be provided in addition to the generic tool interface.

References d_range_selector, and dataRangeChanged().

Referenced by imageProfilesTool(), and ApplicationWindow::showRangeSelectors().

◆ enableTextEditor() [1/2]

void Graph::enableTextEditor ( )

◆ enableTextEditor [2/2]

void Graph::enableTextEditor ( Graph )
signal

◆ enrichmentsList()

QList<FrameWidget *> Graph::enrichmentsList ( )
inline

◆ exportEMF()

void Graph::exportEMF ( const QString &  fname,
const QSizeF &  customSize = QSizeF(),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
)

◆ exportImage()

void Graph::exportImage ( const QString &  fileName,
int  quality = 100,
bool  transparent = false,
int  dpi = 0,
const QSizeF &  customSize = QSizeF (),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0,
int  compression = 0 
)

◆ exportSVG()

void Graph::exportSVG ( const QString &  fname,
const QSizeF &  customSize = QSizeF(),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
)

◆ exportTeX()

void Graph::exportTeX ( const QString &  fname,
bool  color = true,
bool  escapeStrings = true,
bool  fontSizes = true,
const QSizeF &  customSize = QSizeF(),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
)

◆ exportToFile()

void Graph::exportToFile ( const QString &  fileName)

Provided for convenience in scripts.

References exportEMF(), exportImage(), exportSVG(), exportTeX(), and exportVector().

Referenced by curve().

◆ exportVector() [1/2]

void Graph::exportVector ( const QString &  fileName,
int  res = 0,
bool  color = true,
const QSizeF &  customSize = QSizeF (),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
)

◆ exportVector() [2/2]

void Graph::exportVector ( QPrinter *  printer,
int  res = 0,
bool  color = true,
const QSizeF &  customSize = QSizeF (),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
)

◆ fitCurvesList()

QList<QwtPlotCurve *> Graph::fitCurvesList ( )
inline

◆ focusNextPrevChild()

bool Graph::focusNextPrevChild ( bool  next)

Referenced by curve().

◆ frameColor()

QColor Graph::frameColor ( )

◆ functionCurve()

FunctionCurve * Graph::functionCurve ( int  index)

References curve(), Function, and PlotCurve::type().

Referenced by curveIndex().

◆ generateFunctionName()

QString Graph::generateFunctionName ( const QString &  name = tr("F"))

Returns an unique function name.

References d_curves, Function, and PlotCurve::type().

Referenced by addFunction(), fitCurvesList(), and Fit::insertFitFunctionCurve().

◆ getDouglasPeukerTolerance()

double Graph::getDouglasPeukerTolerance ( )
inline

◆ getMajorTicksType()

QList< int > Graph::getMajorTicksType ( )

◆ getMinorTicksType()

QList< int > Graph::getMinorTicksType ( )

◆ getPenStyle() [1/2]

Qt::PenStyle Graph::getPenStyle ( const QString &  s)
static

◆ getPenStyle() [2/2]

Qt::PenStyle Graph::getPenStyle ( int  style)
static

◆ graphPixmap()

QPixmap Graph::graphPixmap ( const QSize &  size = QSize(),
double  scaleFontsFactor = 1.0,
bool  transparent = false 
)

References boundingRect(), and print().

Referenced by copyImage(), curve(), and exportImage().

◆ grid()

Grid* Graph::grid ( )
inline

◆ guessUniqueCurveLayout()

void Graph::guessUniqueCurveLayout ( int &  colorIndex,
int &  symbolIndex 
)

◆ hasActiveTool()

bool Graph::hasActiveTool ( )

Returns true if a plot/data tool is enabled.

References d_active_tool, d_magnifier, d_panner, d_peak_fit_tool, d_range_selector, drawLineActive(), and zoomOn().

Referenced by activeTool(), and Spectrogram::selectedLabels().

◆ hasGridOnTop()

bool Graph::hasGridOnTop ( )
inline

◆ hasPanningMagnifierEnabled()

bool Graph::hasPanningMagnifierEnabled ( )
inline

◆ hasSeletedItems()

bool Graph::hasSeletedItems ( )

◆ hasSynchronizedScaleDivisions()

bool Graph::hasSynchronizedScaleDivisions ( )
inline

References d_synchronize_scales.

Referenced by copy(), and AxesDialog::updatePlot().

◆ hiddenPlot

void Graph::hiddenPlot ( QWidget *  )
signal

Referenced by waterfallYOffset().

◆ hideSelectedAxis()

void Graph::hideSelectedAxis ( )

◆ imageMarkerSelected()

bool Graph::imageMarkerSelected ( )

◆ imageProfilesTool()

QPointer<ImageProfilesTool> Graph::imageProfilesTool ( )
inline

◆ increasingAreaEnrichmentsList()

QList< FrameWidget * > Graph::increasingAreaEnrichmentsList ( )

◆ initCurveLayout() [1/2]

CurveLayout Graph::initCurveLayout ( int  style,
int  curves = 0,
bool  guessLayout = true 
)

◆ initCurveLayout() [2/2]

CurveLayout Graph::initCurveLayout ( )
static

◆ initFonts()

void Graph::initFonts ( const QFont &  scaleTitleFnt,
const QFont &  numbersFnt 
)

◆ initTitle()

void Graph::initTitle ( bool  on,
const QFont &  fnt 
)

◆ insertCurve [1/5]

DataCurve * Graph::insertCurve ( Table w,
const QString &  name,
int  style,
int  startRow = 0,
int  endRow = -1 
)
slot

◆ insertCurve [2/5]

DataCurve * Graph::insertCurve ( Table w,
int  xcol,
const QString &  name,
int  style 
)
slot

◆ insertCurve [3/5]

DataCurve * Graph::insertCurve ( Table w,
const QString &  xColName,
const QString &  yColName,
int  style,
int  startRow = 0,
int  endRow = -1 
)
slot

◆ insertCurve [4/5]

DataCurve * Graph::insertCurve ( Table xt,
const QString &  xColName,
Table yt,
const QString &  yColName,
int  style,
int  startRow = 0,
int  endRow = -1 
)
slot

◆ insertCurve [5/5]

void Graph::insertCurve ( QwtPlotItem *  c)
slot

References d_antialiasing, and d_curves.

◆ insertFunctionCurve()

FunctionCurve * Graph::insertFunctionCurve ( const QString &  formula,
int  points,
int  fileVersion 
)

Used when reading from a project file with version < 0.9.5.

References addFunction(), curve(), FunctionCurve::Normal, FunctionCurve::Parametric, and FunctionCurve::Polar.

Referenced by fitCurvesList(), and ApplicationWindow::openGraph().

◆ insertImageMarker()

void Graph::insertImageMarker ( const QStringList &  lst,
int  fileVersion 
)

◆ insertLegend()

void Graph::insertLegend ( const QStringList &  lst,
int  fileVersion 
)

◆ insertMarker()

void Graph::insertMarker ( QwtPlotMarker *  m)

◆ insertPlotItem

void Graph::insertPlotItem ( QwtPlotItem *  i,
int  type 
)
slot

◆ insertText()

LegendWidget * Graph::insertText ( const QStringList &  list,
int  fileVersion 
)

◆ invertScale()

void Graph::invertScale ( int  axis)

Set axis scale.

Referenced by curve().

◆ isAutoscalingEnabled()

bool Graph::isAutoscalingEnabled ( )
inline

◆ isCurveAntialiasingDisabled()

bool Graph::isCurveAntialiasingDisabled ( )
inline

References d_disable_curve_antialiasing.

Referenced by copy().

◆ isCurveAntialiasingEnabled()

bool Graph::isCurveAntialiasingEnabled ( QwtPlotItem *  it)

◆ isMissingDataGapEnabled()

bool Graph::isMissingDataGapEnabled ( )
inline

◆ isPiePlot

bool Graph::isPiePlot ( )
slot

◆ isPrinting()

bool Graph::isPrinting ( )
inline

◆ isWaterfallPlot()

bool Graph::isWaterfallPlot ( )
inline

◆ labelsRotation()

int Graph::labelsRotation ( int  axis)

◆ legend()

LegendWidget * Graph::legend ( )

◆ legendText()

QString Graph::legendText ( bool  layerSpec = false,
int  fromIndex = 0 
)

◆ loadAxesLinewidth()

void Graph::loadAxesLinewidth ( int  width)

used when opening a project file

References setAxesLinewidth().

Referenced by ApplicationWindow::openGraph(), and selectedArrow().

◆ loadAxesOptions()

void Graph::loadAxesOptions ( const QStringList &  lst)

used when opening a project file

References drawAxesBackbone.

Referenced by axesBackbones(), and ApplicationWindow::openGraph().

◆ loadErrorBars()

void Graph::loadErrorBars ( QList< ErrorBarsCurve *>  errBars,
QList< int >  mcIndexes 
)

Used when restoring project files.

References dataCurve(), and ErrorBarsCurve::setMasterCurve().

Referenced by curve(), and ApplicationWindow::openGraph().

◆ magnifyTool()

QwtPlotMagnifier* Graph::magnifyTool ( )
inline

◆ majorTickLength()

int Graph::majorTickLength ( ) const

◆ markerSelected()

bool Graph::markerSelected ( )

◆ masterCurve() [1/2]

DataCurve * Graph::masterCurve ( ErrorBarsCurve er)

◆ masterCurve() [2/2]

DataCurve * Graph::masterCurve ( const QString &  xColName,
const QString &  yColName 
)

Returns a valid master curve for a plot association.

References d_curves, and Function.

◆ maxAntialisingSize()

int Graph::maxAntialisingSize ( )
inline

References d_max_antialising_size, and setCurrentColor().

Referenced by copy().

◆ minorTickLength()

int Graph::minorTickLength ( ) const

◆ modifiedGraph

void Graph::modifiedGraph ( )
signal

◆ modifyFunctionCurve()

void Graph::modifyFunctionCurve ( int  curve,
int  type,
const QStringList &  formulas,
const QString &  var,
double  start,
double  end,
int  points,
const QMap< QString, double > &  constants 
)

◆ mousePressed()

bool Graph::mousePressed ( QEvent *  e)

◆ multiLayer()

MultiLayer * Graph::multiLayer ( ) const

Returns a pointer to the parent MultiLayer object.

Referenced by AddWidgetTool::addEquation(), AddWidgetTool::addText(), AddWidgetTool::AddWidgetTool(), ScreenPickerTool::append(), ImageProfilesTool::append(), TextDialog::apply(), AxesDialog::applyAxisFormat(), PlotDialog::applyBoxWhiskersFormat(), AxesDialog::applyCanvasFormat(), PlotDialog::applyErrorBarFormat(), PlotDialog::applyLabelsFormat(), PlotDialog::applyLineFormat(), PlotDialog::applyPercentileFormat(), PlotDialog::applySymbolsFormat(), FrameWidget::calculateBottomValue(), FrameWidget::calculateRightValue(), FrameWidget::calculateXValue(), FrameWidget::calculateYValue(), ImageProfilesTool::clone(), TextEditor::closeEvent(), ImageProfilesTool::connectPlotLayers(), RangeSelectorTool::copyMultipleSelection(), RangeSelectorTool::copySelectedCurve(), EnrichmentDialog::createImage(), createTable(), deselect(), ArrowMarker::displayInfo(), MultiLayer::dragEnterEvent(), dragEnterEvent(), MultiLayer::dropEvent(), dropEvent(), RangeSelectorTool::emitStatusText(), enablePanningMagnifier(), enableTextEditor(), CanvasPicker::eventFilter(), AddWidgetTool::eventFilter(), exportEMF(), exportImage(), exportVector(), EnrichmentDialog::frameApplyTo(), FrameWidget::FrameWidget(), LegendWidget::getCurve(), guessUniqueCurveLayout(), ImageProfilesTool::ImageProfilesTool(), initCurveLayout(), PieCurve::initLabels(), DataPickerTool::keyEventFilter(), ScaleDraw::labelString(), legendText(), PieCurve::loadData(), Fit::logFitInfo(), Integration::logInfo(), ImageProfilesTool::modifiedMatrix(), newLegend(), FFT::outputGraphs(), ImageWidget::paintEvent(), LegendWidget::parse(), RangeSelectorTool::pasteSelection(), EnrichmentDialog::patternApplyTo(), plotBox(), print(), raiseEnrichements(), resizeEvent(), EnrichmentDialog::saveImagesInternally(), saveToString(), EnrichmentDialog::setBestSize(), EnrichmentDialog::setCoordinates(), Spectrogram::setDefaultColorMap(), setIndexedColors(), PlotDialog::setLabelsFont(), RectangleWidget::setLinkedLayer(), Spectrogram::setMatrix(), FrameWidget::setOriginCoord(), LegendWidget::showTextEditor(), stackingOrderEnrichmentsList(), TextEditor::TextEditor(), EnrichmentDialog::textFormatApplyTo(), EnrichmentDialog::updateForm(), AxesDialog::updateGrid(), updateWaterfallFill(), and AddWidgetTool::~AddWidgetTool().

◆ newLegend()

LegendWidget * Graph::newLegend ( const QString &  text = QString())

◆ notifyChanges()

void Graph::notifyChanges ( )

◆ notifyColorChange()

void Graph::notifyColorChange ( const QColor &  c)
inline

◆ notifyFontChange()

void Graph::notifyFontChange ( const QFont &  f)
inline

◆ numArrows()

int Graph::numArrows ( )
inline

References d_lines, and drawLine().

◆ obsoleteSymbolStyle()

int Graph::obsoleteSymbolStyle ( int  type)
static

◆ openBoxDiagram()

BoxCurve * Graph::openBoxDiagram ( Table w,
const QStringList &  l,
int  fileVersion 
)

◆ oppositeAxis()

int Graph::oppositeAxis ( int  axis)

◆ pageGeometry()

QRectF Graph::pageGeometry ( )
inline

◆ paletteBackgroundColor()

const QColor & Graph::paletteBackgroundColor ( ) const

◆ parseAxisTitle()

QString Graph::parseAxisTitle ( int  axis)
private

◆ penStyleName()

QString Graph::penStyleName ( Qt::PenStyle  style)
static

◆ pieLegendText

QString Graph::pieLegendText ( )
slot

References d_curves.

Referenced by newLegend(), and setPageGeometry().

◆ plotBox()

void Graph::plotBox ( Table w,
const QStringList &  names,
int  startRow = 0,
int  endRow = -1 
)

◆ plotItem()

QwtPlotItem * Graph::plotItem ( int  index)

◆ plotItemsList()

QStringList Graph::plotItemsList ( )

Returns the names of all plot items, including spectrograms, as a string list.

References d_curves.

Referenced by curve(), curveIndex(), plotSpectrogram(), CurvesDialog::setGraph(), CurvesDialog::shiftCurveBy(), and CurvesDialog::showCurveRange().

◆ plotPie [1/2]

PieCurve * Graph::plotPie ( Table w,
const QString &  name,
int  startRow = 0,
int  endRow = -1 
)
slot

◆ plotPie [2/2]

PieCurve * Graph::plotPie ( Table w,
const QString &  name,
const QPen &  pen,
int  brush,
int  size,
int  firstColor,
int  startRow = 0,
int  endRow = -1,
bool  visible = true,
double  d_start_azimuth = 270,
double  d_view_angle = 90,
double  d_thickness = 33,
double  d_horizontal_offset = 0.0,
double  d_edge_dist = 25,
bool  d_counter_clockwise = false,
bool  d_auto_labeling = true,
bool  d_values = false,
bool  d_percentages = true,
bool  d_categories = false,
bool  d_fixed_labels_pos = true 
)
slot

◆ plotSpectrogram()

Spectrogram * Graph::plotSpectrogram ( Matrix m,
CurveType  type 
)

◆ plotVectors()

VectorCurve * Graph::plotVectors ( Table w,
const QStringList &  colList,
int  style,
int  startRow = 0,
int  endRow = -1 
)

◆ print() [1/2]

void Graph::print ( QPainter *  painter,
const QRect &  plotRect,
const QwtPlotPrintFilter &  pfilter = QwtPlotPrintFilter() 
)

Paint the plot into a given rectangle. Paint the contents of a QwtPlot instance into a given rectangle (Qwt modified code).

Parameters
painterPainter
plotRectBounding rectangle
pfilterPrint filter

References boundingRect(), d_curves, d_is_printing, deselect(), LegendWidget::font(), FrameWidget::isOnTop(), FrameWidget::print(), printCanvas(), printFrame(), printScale(), LegendWidget::setFont(), VectorCurve::setVectorPen(), stackingOrderEnrichmentsList(), PlotCurve::type(), VectorCurve::vectorPen(), VectXYAM, and VectXYXY.

Referenced by MultiLayer::canvasPixmap(), MultiLayer::draw(), MultiLayer::exportVector(), MultiLayer::printActiveLayer(), and MultiLayer::printAllLayers().

◆ print() [2/2]

void Graph::print ( )

◆ printCanvas()

void Graph::printCanvas ( QPainter *  painter,
const QRect &  canvasRect,
const QwtScaleMap  map[axisCnt],
const QwtPlotPrintFilter &  pfilter 
) const
private

References drawItems().

Referenced by print(), and waterfallYOffset().

◆ printFrame()

void Graph::printFrame ( QPainter *  painter,
const QRect &  rect 
) const
private

References paletteBackgroundColor().

Referenced by print(), and waterfallYOffset().

◆ printScale()

void Graph::printScale ( QPainter *  painter,
int  axisId,
int  startDist,
int  endDist,
int  baseDist,
const QRect &  rect 
) const
privatevirtual

Paint a scale into a given rectangle. Paint the scale into a given rectangle (modified code from Qwt).

Parameters
painterPainter
axisIdAxis
startDistStart border distance
endDistEnd border distance
baseDistBase distance
rectBounding rectangle

Referenced by print(), and waterfallYOffset().

◆ raiseEnrichements()

void Graph::raiseEnrichements ( )

◆ range() [1/2]

int Graph::range ( const QString &  curveTitle,
double *  start,
double *  end 
)

Set start and end to selected X range of curve "curveTitle" or, if there's no selection, to the curve's total range.

Returns
the number of selected or total points

References curve().

Referenced by InterpolationDialog::activateCurve(), IntegrationDialog::activateCurve(), PolynomFitDialog::activateCurve(), ExpDecayDialog::activateCurve(), FitDialog::activateCurve(), fitCurvesList(), and Filter::setDataFromCurve().

◆ range() [2/2]

int Graph::range ( QwtPlotCurve *  c,
double *  start,
double *  end 
)

Set start and end to selected X range of curve "curve" or, if there's no selection, to the curve's total range.

Returns
the number of selected or total points

References d_range_selector.

◆ rangeSelectorsEnabled()

bool Graph::rangeSelectorsEnabled ( )

◆ rangeSelectorTool()

QPointer<RangeSelectorTool> Graph::rangeSelectorTool ( )
inline

◆ recoverObsoleteDateTimeScale()

void Graph::recoverObsoleteDateTimeScale ( int  axis,
int  type,
const QString &  origin,
const QString &  format 
)

◆ reloadCurvesData

void Graph::reloadCurvesData ( )
slot

References d_curves, Function, and PlotCurve::type().

Referenced by setPageGeometry().

◆ remove() [1/2]

void Graph::remove ( FrameWidget f)

◆ remove() [2/2]

void Graph::remove ( ArrowMarker arrow)

◆ removeAxisTitle()

void Graph::removeAxisTitle ( )

◆ removeCurve [1/3]

void Graph::removeCurve ( QwtPlotItem *  it)
slot

◆ removeCurve [2/3]

void Graph::removeCurve ( int  index)
slot

Removes a curve defined by its index.

References d_curves, and removeCurve().

◆ removeCurve [3/3]

void Graph::removeCurve ( const QString &  s)
slot

Removes a curve defined by its title string s.

References curveIndex(), and removeCurve().

◆ removeCurves

void Graph::removeCurves ( const QString &  s)
slot

Removes all curves defined by the title/plot association string s.

References d_curves, Function, and removeCurve().

Referenced by ApplicationWindow::removeCurves(), and setPageGeometry().

◆ removeLegend()

void Graph::removeLegend ( )

◆ removeLegendItem()

void Graph::removeLegendItem ( int  index)

◆ removeMarker()

void Graph::removeMarker ( )

◆ removePie

void Graph::removePie ( )
slot

◆ removeTitle()

void Graph::removeTitle ( )

Sets title to an empty string and hides the text label.

References modifiedGraph().

Referenced by backgroundPixmap(), cutTitle(), Graph(), and showTitleContextMenu().

◆ resizeEvent()

void Graph::resizeEvent ( QResizeEvent *  e)

◆ restoreBackgroundImage()

void Graph::restoreBackgroundImage ( const QStringList &  lst)

◆ restoreCurveLabels()

void Graph::restoreCurveLabels ( int  curveID,
const QStringList &  lst 
)

Used when restoring DataCurve curveID from a project file.

References curve(), and DataCurve::restoreLabels().

Referenced by ApplicationWindow::openGraph(), and selectionMoveResizer().

◆ restoreHistogram()

QwtHistogram * Graph::restoreHistogram ( Matrix m,
const QStringList &  l 
)

◆ restoreSpectrogram()

void Graph::restoreSpectrogram ( ApplicationWindow app,
const QStringList &  lst 
)

◆ restoreSymbolImage()

void Graph::restoreSymbolImage ( int  index,
const QStringList &  lst 
)

References curve(), and d_curves.

Referenced by ApplicationWindow::openGraph(), and setAxisStep().

◆ reverseCurveOrder()

void Graph::reverseCurveOrder ( )

◆ rgbaName()

QString Graph::rgbaName ( const QColor &  color)
static

Referenced by saveCurveLayout(), and setAxisStep().

◆ saveAxesBackbones()

QString Graph::saveAxesBackbones ( )

References drawAxesBackbone.

Referenced by saveToString(), and setAxisStep().

◆ saveAxesBaseline()

QString Graph::saveAxesBaseline ( )

Referenced by saveToString(), and setAxisStep().

◆ saveAxesColors()

QString Graph::saveAxesColors ( )

Referenced by saveToString(), and setAxisStep().

◆ saveAxesFormulas()

QString Graph::saveAxesFormulas ( )

References ScaleDraw::formula().

Referenced by saveToString(), and setAxisStep().

◆ saveAxesLabelsType()

QString Graph::saveAxesLabelsType ( )

◆ saveAxesTitleAlignement()

QString Graph::saveAxesTitleAlignement ( )

Referenced by saveToString(), and setAxisStep().

◆ saveAxesTitleColors()

QString Graph::saveAxesTitleColors ( )

Referenced by saveToString(), and setAxisStep().

◆ saveBackgroundImage()

QString Graph::saveBackgroundImage ( )

References d_canvas_bkg_path, and d_canvas_bkg_pix.

Referenced by saveToString(), and setAxisStep().

◆ saveCanvas()

QString Graph::saveCanvas ( )

References canvasFrameColor().

Referenced by saveToString(), and setAxisStep().

◆ saveCurveLayout()

QString Graph::saveCurveLayout ( int  index)

◆ saveCurves()

QString Graph::saveCurves ( )

◆ saveEnabledAxes()

QString Graph::saveEnabledAxes ( )

Referenced by saveToString(), and setAxisStep().

◆ saveEnabledTickLabels()

QString Graph::saveEnabledTickLabels ( )

Referenced by saveToString(), and setAxisStep().

◆ saveFonts()

QString Graph::saveFonts ( )

Referenced by saveToString(), and setAxisStep().

◆ saveLabelsFormat()

QString Graph::saveLabelsFormat ( )

◆ saveLabelsPrefixAndSuffix()

QString Graph::saveLabelsPrefixAndSuffix ( )

◆ saveLabelsRotation()

QString Graph::saveLabelsRotation ( )

References labelsRotation().

Referenced by saveToString(), and setAxisStep().

◆ saveMarkers()

QString Graph::saveMarkers ( )

◆ savePieCurveLayout

QString Graph::savePieCurveLayout ( )
slot

◆ saveScale()

QString Graph::saveScale ( )

References d_user_step, and ScaleEngine::type().

Referenced by saveToString(), and setAxisStep().

◆ saveScaleTitles()

QString Graph::saveScaleTitles ( )

References axisTitleString().

Referenced by saveToString(), and setAxisStep().

◆ saveTickLabelsSpace()

QString Graph::saveTickLabelsSpace ( )

◆ saveTicksType()

QString Graph::saveTicksType ( )

◆ saveTitle()

QString Graph::saveTitle ( )

Referenced by saveToString(), and setAxisStep().

◆ saveToString()

QString Graph::saveToString ( bool  saveAsTemplate = false)

◆ scaleFonts()

void Graph::scaleFonts ( double  factor)

◆ select()

void Graph::select ( QWidget *  l,
bool  add = false 
)

◆ selectCanvas()

void Graph::selectCanvas ( )

◆ selectedArrow()

ArrowMarker* Graph::selectedArrow ( )
inline

◆ selectedCanvas

void Graph::selectedCanvas ( Graph )
signal

Referenced by selectCanvas(), and waterfallYOffset().

◆ selectedCurveLabels()

QwtPlotItem * Graph::selectedCurveLabels ( )

◆ selectedGraph

void Graph::selectedGraph ( Graph )
signal

◆ selectedScale()

QwtScaleWidget * Graph::selectedScale ( )

◆ selectedXEndValue()

double Graph::selectedXEndValue ( )

◆ selectedXStartValue()

double Graph::selectedXStartValue ( )

◆ selectionChanged

void Graph::selectionChanged ( SelectionMoveResizer )
signal

◆ selectionMoveResizer()

QPointer<SelectionMoveResizer> Graph::selectionMoveResizer ( )
inline

◆ selectorDeleted

void Graph::selectorDeleted ( )
privateslot

References d_markers_selector, and selectionChanged().

Referenced by select(), and waterfallYOffset().

◆ selectTitle()

void Graph::selectTitle ( bool  select = true)

◆ setActiveText()

void Graph::setActiveText ( LegendWidget l)
inline

References add(), d_active_enrichment, and select().

Referenced by TextEditor::closeEvent().

◆ setActiveTool()

void Graph::setActiveTool ( PlotToolInterface tool)

◆ setAntialiasing()

void Graph::setAntialiasing ( bool  on = true,
bool  update = true 
)

◆ setAutoScale()

void Graph::setAutoScale ( )

◆ setAutoscaleFonts()

void Graph::setAutoscaleFonts ( bool  on = true)
inline

◆ setAxesLinewidth()

void Graph::setAxesLinewidth ( int  width)

◆ setAxisColor()

void Graph::setAxisColor ( int  axis,
const QColor &  color 
)

◆ setAxisFont()

void Graph::setAxisFont ( int  axis,
const QFont &  fnt 
)

◆ setAxisFormula()

void Graph::setAxisFormula ( int  axis,
const QString &  formula 
)

◆ setAxisLabelRotation()

void Graph::setAxisLabelRotation ( int  axis,
int  rotation 
)

◆ setAxisLabelsColor()

void Graph::setAxisLabelsColor ( int  axis,
const QColor &  color 
)

◆ setAxisMargin()

void Graph::setAxisMargin ( int  axis,
int  margin 
)

◆ setAxisStep()

void Graph::setAxisStep ( int  axis,
double  step 
)
inline

◆ setAxisTicksLength()

void Graph::setAxisTicksLength ( int  axis,
int  majTicksType,
int  minTicksType,
int  minLength,
int  majLength 
)

◆ setAxisTitle()

void Graph::setAxisTitle ( int  axis,
const QString &  text 
)

◆ setAxisTitleAlignment()

void Graph::setAxisTitleAlignment ( int  axis,
int  align 
)

◆ setAxisTitleColor()

void Graph::setAxisTitleColor ( int  axis,
const QColor &  c 
)

◆ setAxisTitleDistance()

void Graph::setAxisTitleDistance ( int  axis,
int  dist 
)

◆ setAxisTitleFont()

void Graph::setAxisTitleFont ( int  axis,
const QFont &  fnt 
)

◆ setAxisTitlePolicy()

void Graph::setAxisTitlePolicy ( const AxisTitlePolicy policy)
inline

◆ setAxisTitleString()

void Graph::setAxisTitleString ( int  axis,
const QString &  text 
)

◆ setBackgroundColor()

void Graph::setBackgroundColor ( const QColor &  color)

◆ setBarsGap()

void Graph::setBarsGap ( int  curve,
int  gapPercent,
int  offset 
)

◆ setCanvasBackgroundImage()

void Graph::setCanvasBackgroundImage ( const QString &  fn = QString(),
bool  update = true 
)

◆ setCanvasCoordinates()

void Graph::setCanvasCoordinates ( const QRectF &  r)

◆ setCanvasFrame()

void Graph::setCanvasFrame ( int  width = 1,
const QColor &  color = QColor(Qt::black) 
)

◆ setCanvasGeometry() [1/2]

void Graph::setCanvasGeometry ( const QRect &  cr)

◆ setCanvasGeometry() [2/2]

void Graph::setCanvasGeometry ( int  x,
int  y,
int  w,
int  h 
)
inline

Convenience function for scripts.

References setCanvasGeometry(), and setCanvasSize().

Referenced by setCanvasGeometry().

◆ setCanvasSize() [1/2]

void Graph::setCanvasSize ( const QSize &  size)

Adjust plot content to its canvas size.

Parameters
crThe new size of the canvas.

References autoScaleFonts, scaleFonts(), and updateMarkersBoundingRect().

Referenced by PlotDialog::applyCanvasSize(), MultiLayer::arrangeLayers(), PlotDialog::resizeLayerToFitImage(), and setCanvasGeometry().

◆ setCanvasSize() [2/2]

void Graph::setCanvasSize ( int  w,
int  h 
)
inline

Convenience function for scripts.

References add(), addLegendItem(), addTexFormula(), boundingRect(), copy(), raiseEnrichements(), setCanvasSize(), and updateCurveLabels().

Referenced by setCanvasSize().

◆ setCurrentColor()

void Graph::setCurrentColor ( const QColor &  c)

◆ setCurrentFont()

void Graph::setCurrentFont ( const QFont &  f)

◆ setCurveFullRange()

void Graph::setCurveFullRange ( int  curveIndex)

◆ setCurveLineColor() [1/2]

void Graph::setCurveLineColor ( int  curveIndex,
int  colorIndex 
)

References curve(), ColorBox::defaultColor(), and modifiedGraph().

Referenced by curve().

◆ setCurveLineColor() [2/2]

void Graph::setCurveLineColor ( int  curveIndex,
QColor  qColor 
)

References curve(), and modifiedGraph().

◆ setCurveLineStyle()

void Graph::setCurveLineStyle ( int  curveIndex,
Qt::PenStyle  style 
)

References curve(), and modifiedGraph().

Referenced by curve().

◆ setCurveLineWidth()

void Graph::setCurveLineWidth ( int  curveIndex,
double  width 
)

References curve(), and modifiedGraph().

Referenced by curve().

◆ setCurvesList()

void Graph::setCurvesList ( QList< QwtPlotItem *>  lst)
inline

◆ setCurveStyle()

void Graph::setCurveStyle ( int  index,
int  s 
)

◆ setFrame()

void Graph::setFrame ( int  width = 1,
const QColor &  color = Qt::black 
)

◆ setGrayScale()

void Graph::setGrayScale ( )

◆ setGridOnTop()

void Graph::setGridOnTop ( bool  on = true,
bool  update = true 
)

◆ setIndexedColors()

void Graph::setIndexedColors ( )

◆ setLabelsDateTimeFormat()

void Graph::setLabelsDateTimeFormat ( int  axis,
int  type,
const QString &  formatInfo 
)

◆ setLabelsDayFormat()

void Graph::setLabelsDayFormat ( int  axis,
int  format 
)

◆ setLabelsMonthFormat()

void Graph::setLabelsMonthFormat ( int  axis,
int  format 
)

◆ setLabelsNumericFormat() [1/2]

void Graph::setLabelsNumericFormat ( const QStringList &  l)

Used for restoring project files.

References ScaleDraw::formula().

Referenced by axesBackbones(), copyScaleDraw(), ApplicationWindow::openGraph(), and showAxis().

◆ setLabelsNumericFormat() [2/2]

void Graph::setLabelsNumericFormat ( int  axis,
int  format,
int  prec = 6,
const QString &  formula = QString() 
)

◆ setLabelsTextFormat() [1/2]

void Graph::setLabelsTextFormat ( int  axis,
int  type,
const QString &  name,
const QStringList &  lst 
)

◆ setLabelsTextFormat() [2/2]

void Graph::setLabelsTextFormat ( int  axis,
int  type,
const QString &  labelsColName,
Table table 
)

◆ setLegend()

void Graph::setLegend ( const QString &  s)

References legend(), and LegendWidget::setText().

Referenced by setAxisStep().

◆ setMajorTicksType() [1/3]

void Graph::setMajorTicksType ( int  axis,
int  type 
)

◆ setMajorTicksType() [2/3]

void Graph::setMajorTicksType ( const QList< int > &  lst)

◆ setMajorTicksType() [3/3]

void Graph::setMajorTicksType ( const QStringList &  lst)

References setMajorTicksType().

◆ setMinorTicksType() [1/3]

void Graph::setMinorTicksType ( int  axis,
int  type 
)

◆ setMinorTicksType() [2/3]

void Graph::setMinorTicksType ( const QList< int > &  lst)

◆ setMinorTicksType() [3/3]

void Graph::setMinorTicksType ( const QStringList &  lst)

References setMinorTicksType().

◆ setPageGeometry()

void Graph::setPageGeometry ( const QRectF &  r)
inline

◆ setRightAxisTitle()

void Graph::setRightAxisTitle ( const QString &  text)

References modifiedGraph(), and setAxisTitle().

Referenced by selectedArrow().

◆ setScale()

void Graph::setScale ( int  axis,
double  start,
double  end,
double  step = 0.0,
int  majorTicks = 5,
int  minorTicks = 5,
int  type = 0,
bool  inverted = false,
double  left_break = -DBL_MAX,
double  right_break = DBL_MAX,
int  pos = 50,
double  stepBeforeBreak = 0.0,
double  stepAfterBreak = 0.0,
int  minTicksBeforeBreak = 4,
int  minTicksAfterBreak = 4,
bool  log10AfterBreak = false,
int  breakWidth = 4,
bool  breakDecoration = true 
)

◆ setScaleTitle()

void Graph::setScaleTitle ( int  axis,
const QString &  text 
)

TODO: eliminate this function in version 0.9.1 (used only when restoring project files)

References setAxisTitle().

Referenced by ApplicationWindow::openGraph(), and selectedArrow().

◆ setSelectedArrow()

void Graph::setSelectedArrow ( ArrowMarker mrk,
bool  add = false 
)

Set the selected arrow.

Parameters
mrkkey of the arrow to be selected.
addwhether the arrow is to be added to an existing selection. If add is false (the default) or there is no existing selection, a new SelectionMoveResizer is created and stored in d_markers_selector.

References d_lines, d_markers_selector, d_selected_arrow, ScalePicker::deselect(), ArrowMarker::editable(), modifiedGraph(), scalePicker, and selectTitle().

Referenced by drawLineActive(), and CanvasPicker::selectMarker().

◆ setSynchronizedScaleDivisions()

void Graph::setSynchronizedScaleDivisions ( bool  on)
inline

◆ setTickLength()

void Graph::setTickLength ( int  minLength,
int  majLength 
)

◆ setTicksLength()

void Graph::setTicksLength ( int  minLength,
int  majLength 
)

◆ setTitleAlignment()

void Graph::setTitleAlignment ( int  align)

◆ setTitleColor()

void Graph::setTitleColor ( const QColor &  c)

◆ setTitleFont()

void Graph::setTitleFont ( const QFont &  fnt)

◆ setTopAxisTitle()

void Graph::setTopAxisTitle ( const QString &  text)

References modifiedGraph(), and setAxisTitle().

Referenced by selectedArrow().

◆ setWaterfallFillColor()

void Graph::setWaterfallFillColor ( const QColor &  c)

◆ setWaterfallOffset()

void Graph::setWaterfallOffset ( int  x,
int  y,
bool  update = false 
)

◆ setWaterfallSideLines()

void Graph::setWaterfallSideLines ( bool  on = true)

◆ setWaterfallXOffset()

void Graph::setWaterfallXOffset ( int  offset)

◆ setWaterfallYOffset()

void Graph::setWaterfallYOffset ( int  offset)

◆ setXAxisTitle()

void Graph::setXAxisTitle ( const QString &  text)

◆ setYAxisTitle()

void Graph::setYAxisTitle ( const QString &  text)

◆ showAxis()

void Graph::showAxis ( int  axis,
int  type,
const QString &  formatInfo,
Table table,
bool  axisOn,
int  majTicksType,
int  minTicksType,
bool  labelsOn,
const QColor &  c,
int  format,
int  prec,
int  rotation,
int  baselineDist,
const QString &  formula,
const QColor &  labelsColor,
int  spacing = 4,
bool  backbone = true,
const ScaleDraw::ShowTicksPolicy showTicks = ScaleDraw::ShowAll,
const QString &  prefix = QString::null,
const QString &  suffix = QString::null 
)

◆ showAxisContextMenu()

void Graph::showAxisContextMenu ( int  axis)

◆ showAxisDialog() [1/2]

void Graph::showAxisDialog ( )

◆ showAxisDialog [2/2]

void Graph::showAxisDialog ( int  )
signal

◆ showAxisTitleDialog

void Graph::showAxisTitleDialog ( )
signal

◆ showAxisTitleMenu()

void Graph::showAxisTitleMenu ( )

◆ showContextMenu

void Graph::showContextMenu ( )
signal

◆ showCurve

void Graph::showCurve ( int  index,
bool  visible = true 
)
slot

◆ showCurveContextMenu

void Graph::showCurveContextMenu ( QwtPlotItem *  )
signal

◆ showEvent()

void Graph::showEvent ( QShowEvent *  event)
private

References updateCurveLabels().

Referenced by waterfallYOffset().

◆ showFitResults

void Graph::showFitResults ( const QString &  )
signal

Referenced by waterfallYOffset().

◆ showGrid() [1/2]

void Graph::showGrid ( )

Convenience function enabling the grid for QwtScaleDraw::Left and Bottom Scales.

Referenced by setAutoscaleFonts(), showGrids(), and ApplicationWindow::zoomRectanglePlot().

◆ showGrid() [2/2]

void Graph::showGrid ( int  axis)

Convenience function enabling the grid for a user defined axis.

References d_grid, and modifiedGraph().

◆ showGrids()

void Graph::showGrids ( )

◆ showMarkerPopupMenu

void Graph::showMarkerPopupMenu ( )
signal

◆ showMissingDataGap()

void Graph::showMissingDataGap ( bool  on = true,
bool  update = true 
)

◆ showPlotDialog

void Graph::showPlotDialog ( int  )
signal

Referenced by Graph(), and waterfallYOffset().

◆ showPlotErrorMessage()

void Graph::showPlotErrorMessage ( QWidget *  parent,
const QStringList &  emptyColumns 
)
static

◆ showScaleDialog()

void Graph::showScaleDialog ( )

◆ showTitleContextMenu()

void Graph::showTitleContextMenu ( )

◆ spectrogram()

Spectrogram * Graph::spectrogram ( Matrix m)

Returns a pointer to the spectrogram which data source is matrix m (the pointer can be NULL)

References d_curves, and Spectrogram::matrix().

Referenced by hasGridOnTop(), and plotSpectrogram().

◆ speedModeMaxPoints()

int Graph::speedModeMaxPoints ( )
inline

◆ stackingOrderEnrichmentsList()

QList< FrameWidget * > Graph::stackingOrderEnrichmentsList ( ) const
private

◆ textsList()

QList< LegendWidget * > Graph::textsList ( )

References d_enrichments.

Referenced by activeTool(), and MultiLayer::setFonts().

◆ titleSelected()

bool Graph::titleSelected ( )

◆ updateAxesTitles()

void Graph::updateAxesTitles ( )

◆ updateAxisTitle()

void Graph::updateAxisTitle ( int  axis)

◆ updateCurveLabels()

void Graph::updateCurveLabels ( )

References curvesList(), and Function.

Referenced by resizeEvent(), setCanvasSize(), and showEvent().

◆ updateCurveLayout()

void Graph::updateCurveLayout ( PlotCurve c,
const CurveLayout cL 
)

◆ updateCurveNames()

void Graph::updateCurveNames ( const QString &  oldName,
const QString &  newName,
bool  updateTableName = true 
)

◆ updateCurvesData

void Graph::updateCurvesData ( Table w,
const QString &  yColName 
)
slot

◆ updateDataCurves()

void Graph::updateDataCurves ( )

◆ updatedLayout

void Graph::updatedLayout ( Graph )
signal

Referenced by updateLayout(), and waterfallYOffset().

◆ updateErrorBars()

void Graph::updateErrorBars ( ErrorBarsCurve er,
bool  xErr,
double  width,
int  cap,
const QColor &  c,
bool  plus,
bool  minus,
bool  through 
)

◆ updateLayout()

void Graph::updateLayout ( )

Adjust plot content to its current size. Must be reimplemented because the base implementation adds a mask causing an ugly drawing artefact.

References updatedLayout().

Referenced by AxesDialog::applyAxisFormatToLayer(), copy(), insertText(), ApplicationWindow::openGraph(), resizeEvent(), MultiLayer::resizeLayers(), TexWidget::restore(), MultiLayer::setCommonLayerAxes(), setCurvesList(), showAxis(), and Spectrogram::showColorScale().

◆ updateMarkersBoundingRect()

void Graph::updateMarkersBoundingRect ( bool  rescaleEvent = true)

◆ updateOppositeScaleDiv()

void Graph::updateOppositeScaleDiv ( int  axis)

◆ updatePlot()

void Graph::updatePlot ( )

◆ updateScale()

void Graph::updateScale ( )

◆ updateSecondaryAxis()

void Graph::updateSecondaryAxis ( int  axis,
bool  changeFormat = false 
)

◆ updateVectorsLayout()

void Graph::updateVectorsLayout ( int  curve,
const QColor &  color,
double  width,
int  arrowLength,
int  arrowAngle,
bool  filled,
int  position,
const QString &  xEndColName = QString(),
const QString &  yEndColName = QString() 
)

◆ updateWaterfallFill()

void Graph::updateWaterfallFill ( bool  on)

References curve(), d_curves, modifiedGraph(), and multiLayer().

Referenced by waterfallYOffset().

◆ validCurvesDataSize()

bool Graph::validCurvesDataSize ( )

◆ viewLineDialog

void Graph::viewLineDialog ( )
signal

Referenced by Graph(), and waterfallYOffset().

◆ viewTitleDialog

void Graph::viewTitleDialog ( )
signal

◆ visibleCurves

int Graph::visibleCurves ( )
slot

◆ waterfallXOffset()

int Graph::waterfallXOffset ( )
inline

◆ waterfallYOffset()

int Graph::waterfallYOffset ( )
inline

◆ zoom()

void Graph::zoom ( bool  on)

◆ zoomed()

void Graph::zoomed ( const QwtDoubleRect &  )

◆ zoomOn()

bool Graph::zoomOn ( )

◆ zoomOut()

void Graph::zoomOut ( )

Member Data Documentation

◆ autoScaleFonts

bool Graph::autoScaleFonts
private

◆ cp

CanvasPicker* Graph::cp
private

Referenced by deselectMarker(), Graph(), remove(), and ~Graph().

◆ d_active_enrichment

FrameWidget* Graph::d_active_enrichment
private

◆ d_active_tool

PlotToolInterface* Graph::d_active_tool
private

The currently active tool, or NULL for default (pointer).

Referenced by activeTool(), disableTools(), Graph(), hasActiveTool(), setActiveTool(), updatePlot(), and ~Graph().

◆ d_antialiasing

bool Graph::d_antialiasing
private

◆ d_auto_scale

bool Graph::d_auto_scale
private

Flag indicating if the axes limits should be changed in order to show all data each time a curva data change occurs.

Referenced by addCurves(), copy(), enableAutoscaling(), Graph(), isAutoscalingEnabled(), saveToString(), updatePlot(), and updateScale().

◆ d_axis_title_policy

AxisTitlePolicy Graph::d_axis_title_policy
private

◆ d_axis_titles

QStringList Graph::d_axis_titles
private

◆ d_canvas_bkg_path

QString Graph::d_canvas_bkg_path
private

◆ d_canvas_bkg_pix

QPixmap Graph::d_canvas_bkg_pix
private

◆ d_curves

QList<QwtPlotItem*> Graph::d_curves
private

◆ d_disable_curve_antialiasing

bool Graph::d_disable_curve_antialiasing
private

◆ d_Douglas_Peuker_tolerance

double Graph::d_Douglas_Peuker_tolerance
private

◆ d_enrichments

QList<FrameWidget*> Graph::d_enrichments
private

◆ d_fit_curves

QList<QwtPlotCurve *> Graph::d_fit_curves
private

List storing pointers to the curves resulting after a fit session, in case the user wants to delete them later on.

Referenced by addFitCurve(), copyCurves(), deleteFitCurves(), fitCurvesList(), and removeCurve().

◆ d_grid

Grid* Graph::d_grid
private

Pointer to the grid.

Referenced by Graph(), grid(), setAxesLinewidth(), setAxisColor(), setGridOnTop(), showAxis(), and showGrid().

◆ d_grid_on_top

bool Graph::d_grid_on_top
private

Flag telling if the grid should be drawn on top of data.

Referenced by copy(), Graph(), hasGridOnTop(), saveToString(), and setGridOnTop().

◆ d_image_profiles_tool

QPointer<ImageProfilesTool> Graph::d_image_profiles_tool
private

◆ d_is_printing

bool Graph::d_is_printing
private

Flag telling if we are performing a print operation.

Referenced by drawItems(), Graph(), isPrinting(), and print().

◆ d_lines

QList<ArrowMarker*> Graph::d_lines
private

◆ d_magnifier

QwtPlotMagnifier* Graph::d_magnifier
private

◆ d_maj_tick_length

int Graph::d_maj_tick_length
private

◆ d_markers_selector

QPointer<SelectionMoveResizer> Graph::d_markers_selector
private

The markers selected for move/resize operations or NULL if none are selected.

Referenced by deselect(), deselectMarker(), hasSeletedItems(), remove(), removeMarker(), select(), selectionMoveResizer(), selectorDeleted(), setSelectedArrow(), and ~Graph().

◆ d_max_antialising_size

int Graph::d_max_antialising_size
private

◆ d_min_tick_length

int Graph::d_min_tick_length
private

Axes tick lengths.

Referenced by drawInwardTicks(), Graph(), minorTickLength(), and setTickLength().

◆ d_missing_data_gap

bool Graph::d_missing_data_gap
private

Flag telling if the curves line should be connected across missing data.

Referenced by copy(), Graph(), isMissingDataGapEnabled(), saveToString(), and showMissingDataGap().

◆ d_page_rect

QRectF Graph::d_page_rect
private

◆ d_panner

QwtPlotPanner* Graph::d_panner
private

◆ d_peak_fit_tool

PlotToolInterface * Graph::d_peak_fit_tool
private

◆ d_range_selector

QPointer<RangeSelectorTool> Graph::d_range_selector
private

◆ d_selected_arrow

ArrowMarker* Graph::d_selected_arrow
private

◆ d_speed_mode_points

int Graph::d_speed_mode_points
private

◆ d_synchronize_scales

bool Graph::d_synchronize_scales
private

◆ d_user_step

QVector<double> Graph::d_user_step
private

Stores the step the user specified for the four scale. If step = 0.0, the step will be calculated automatically by the Qwt scale engine.

Referenced by axisStep(), Graph(), recoverObsoleteDateTimeScale(), saveScale(), setAutoScale(), setAxisStep(), setScale(), updateOppositeScaleDiv(), and updatePlot().

◆ d_waterfall_offset_x

int Graph::d_waterfall_offset_x
private

◆ d_waterfall_offset_y

int Graph::d_waterfall_offset_y
private

◆ d_zoomer

QwtPlotZoomer* Graph::d_zoomer[2]
private

◆ drawArrowOn

bool Graph::drawArrowOn
private

Referenced by drawArrow(), drawLine(), and Graph().

◆ drawAxesBackbone

bool Graph::drawAxesBackbone
private

◆ drawLineOn

bool Graph::drawLineOn
private

Referenced by drawLine(), drawLineActive(), and Graph().

◆ scalePicker

ScalePicker* Graph::scalePicker
private

◆ titlePicker

TitlePicker* Graph::titlePicker
private

The documentation for this class was generated from the following files: