Graph Class Reference

A 2D-plotting widget. More...

#include <Graph.h>

List of all members.

Public Types

enum  Axis { Left, Right, Bottom, Top }
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 { ColumnName, ColumnComment, TableName, TableLegend }
enum  MarkerType { None = -1, Text = 0, Arrow = 1, Image = 2 }
enum  Scale { Linear, Log10 }
enum  Ticks { NoTicks = 0, Out = 1, InOut = 2, In = 3 }

Public Slots

void activateGraph ()
bool addCurves (Table *w, const QStringList &names, int style=0, double lWidth=1, int sSize=3, int startRow=0, int endRow=-1)
void addFitCurve (QwtPlotCurve *c)
QwtHistogramaddHistogram (Matrix *m)
 Add a matrix histogram to the graph.
QStringList analysableCurvesList ()
 Returns the names of all the curves suitable for data analysis, as a string list. The list excludes error bars and spectrograms.
bool antialiasing ()
bool autoscaleFonts ()
double axisStep (int axis)
void clearAxisTitle ()
void copy (Graph *g)
void copyAxisTitle ()
void copyCurves (Graph *g)
void copyTitle ()
void createTable (const QwtPlotCurve *curve)
void createTable (const QString &curveName)
 Provided for convenience in scripts.
QwtPlotCurve * curve (const QString &title)
 get curve by name
QwtPlotCurve * curve (int index)
 get curve by index
int curveCount ()
int curveIndex (const QString &title)
 map curve title to index
int curveIndex (QwtPlotItem *c)
 Map curve pointer to index.
QStringList curveNamesList ()
 Returns the names of all the QwtPlotCurve items on the plot, as a string list.
QString curveTitle (int index)
 get curve title string by inde (convenience function for scripts)
void cutAxisTitle ()
void cutTitle ()
void deleteFitCurves ()
void disableTools ()
void enableAutoscaling (bool on=true)
bool enableRangeSelectors (const QObject *status_target=NULL, const char *status_slot="")
void enableTextEditor ()
QList< QwtPlotCurve * > fitCurvesList ()
static Qt::PenStyle getPenStyle (int style)
static Qt::PenStyle getPenStyle (const QString &s)
void hideSelectedAxis ()
void insertCurve (QwtPlotItem *c)
DataCurveinsertCurve (Table *w, const QString &xColName, const QString &yColName, int style, int startRow=0, int endRow=-1)
DataCurveinsertCurve (Table *w, int xcol, const QString &name, int style)
DataCurveinsertCurve (Table *w, const QString &name, int style, int startRow=0, int endRow=-1)
void insertPlotItem (QwtPlotItem *i, int type)
void invertScale (int axis)
 Set axis scale.
bool isAutoscalingEnabled ()
void notifyChanges ()
void notifyFontChange (const QFont &f)
static int obsoleteSymbolStyle (int type)
static QString penStyleName (Qt::PenStyle style)
QwtPlotItem * plotItem (int index)
 get plotted item by index
QStringList plotItemsList ()
 Returns the names of all plot items, including spectrograms, as a string list.
SpectrogramplotSpectrogram (Matrix *m, CurveType type)
 Add a spectrogram to the graph.
int range (QwtPlotCurve *c, double *start, double *end)
int range (const QString &curveTitle, double *start, double *end)
bool rangeSelectorsEnabled ()
QPointer< RangeSelectorToolrangeSelectorTool ()
void removeAxisTitle ()
void removeCurve (const QString &s)
 Removes a curve defined by its title string s.
void removeCurve (int index)
 Removes a curve defined by its index.
void removeCurve (QwtPlotItem *it)
void removeCurves (const QString &s)
 Removes all curves defined by the title/plot association string s.
QwtHistogramrestoreHistogram (Matrix *m, const QStringList &l)
 Restores a histogram from a project file.
void restoreSpectrogram (ApplicationWindow *app, const QStringList &lst)
 Restores a spectrogram. Used when opening a project file.
double selectedXEndValue ()
double selectedXStartValue ()
void setAntialiasing (bool on=true, bool update=true)
 Enables/Disables antialiasing of plot items.
void setAutoScale ()
void setAutoscaleFonts (bool on=true)
void setBarsGap (int curve, int gapPercent, int offset)
 Used for VerticalBars, HorizontalBars and Histograms.
void setCanvasCoordinates (const QRectF &)
void setCurrentFont (const QFont &f)
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 showAxisContextMenu (int axis)
void showAxisDialog ()
void showAxisTitleMenu ()
void showCurve (int index, bool visible=true)
 Shows/Hides a curve defined by its index.
void showGrid (int axis)
 Convenience function enabling the grid for a user defined axis.
void showGrid ()
 Convenience function enabling the grid for QwtScaleDraw::Left and Bottom Scales.
void showGrids ()
static void showPlotErrorMessage (QWidget *parent, const QStringList &emptyColumns)
void showScaleDialog ()
void showTitleContextMenu ()
void updateCurveNames (const QString &oldName, const QString &newName, bool updateTableName=true)
void updateCurvesData (Table *w, const QString &yColName)
void updatePlot ()
void updateScale ()
void updateSecondaryAxis (int axis, bool changeFormat=false)
bool validCurvesDataSize ()
int visibleCurves ()
Line Markers

void addArrow (QStringList list, int fileVersion)
 Used when opening a project file.
ArrowMarkeraddArrow (ArrowMarker *mrk)
bool arrowMarkerSelected ()
bool drawArrow ()
void drawLine (bool on, bool arrow=false)
 Draws a line/arrow depending on the value of "arrow".
bool drawLineActive ()
QList< QwtPlotMarker * > linesList ()
void remove (ArrowMarker *arrow)
Error Bars

QwtErrorPlotCurveaddErrorBars (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)
QwtErrorPlotCurveaddErrorBars (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)
DataCurvemasterCurve (const QString &xColName, const QString &yColName)
 Returns a valid master curve for a plot association.
DataCurvemasterCurve (QwtErrorPlotCurve *er)
 Returns a valid master curve for the error bars curve.
void updateErrorBars (QwtErrorPlotCurve *er, bool xErr, double width, int cap, const QColor &c, bool plus, bool minus, bool through)
User-defined Functions

FunctionCurveaddFunction (const QStringList &formulas, double start, double end, int points=100, const QString &var="x", int type=0, const QString &title=QString::null)
QString generateFunctionName (const QString &name=tr("F"))
 Returns an unique function name.
FunctionCurveinsertFunctionCurve (const QString &formula, int points, int fileVersion)
 Used when reading from a project file with version < 0.9.5.
void modifyFunctionCurve (int curve, int type, const QStringList &formulas, const QString &var, double start, double end, int points, const QMap< QString, double > &constants)
Image Markers

ImageWidgetaddImage (const QImage &image)
ImageWidgetaddImage (const QString &fileName)
ImageWidgetaddImage (ImageWidget *i)
bool imageMarkerSelected ()
void insertImageMarker (const QStringList &lst, int fileVersion)
Texts

LegendWidgetaddText (LegendWidget *)
LegendWidgetaddTimeStamp ()
void insertLegend (const QStringList &lst, int fileVersion)
LegendWidgetinsertText (const QStringList &list, int fileVersion)
 Used when opening a project file.
QString legendText (bool layerSpec=false)
 Creates a new legend text using the curves titles.
LegendWidgetnewLegend (const QString &text=QString())
void removeLegendItem (int index)
Axes

bool axesBackbones ()
QColor axisColor (int axis)
QString axisFormatInfo (int axis)
QString axisFormula (int axis)
QColor axisLabelsColor (int axis)
int axisTitleAlignment (int axis)
QColor axisTitleColor (int axis)
int axisTitleDistance (int axis)
QFont axisTitleFont (int axis)
QRect axisTitleRect (const QwtScaleWidget *scale)
bool axisTitleSelected ()
QString axisTitleString (int axis)
ScaleDraw::ScaleType axisType (int axis)
void changeTicksLength (int minLength, int majLength)
QwtScaleWidget * currentScale ()
void drawAxesBackbones (bool yes)
void enableAxis (int axis, bool on=true)
void enableAxisLabels (int axis, bool on=true)
void initFonts (const QFont &scaleTitleFnt, const QFont &numbersFnt)
int labelsRotation (int axis)
void loadAxesLinewidth (int width)
 used when opening a project file
void loadAxesOptions (const QString &s)
 used when opening a project file
QwtScaleWidget * selectedScale ()
void setAxisColor (int axis, const QColor &color)
void setAxisFont (int axis, const QFont &fnt)
void setAxisFormula (int axis, const QString &)
void setAxisLabelRotation (int axis, int rotation)
void setAxisLabelsColor (int axis, const QColor &color)
void setAxisMargin (int axis, int margin)
void setAxisTicksLength (int axis, int majTicksType, int minTicksType, int minLength, int majLength)
void setAxisTitle (int axis, const QString &text)
void setAxisTitleAlignment (int axis, int align)
void setAxisTitleColor (int axis, const QColor &c)
void setAxisTitleDistance (int axis, int dist)
void setAxisTitleFont (int axis, const QFont &fnt)
void setLabelsDateTimeFormat (int axis, int type, const QString &formatInfo)
void setLabelsDayFormat (int axis, int format)
void setLabelsMonthFormat (int axis, int format)
void setLabelsNumericFormat (int axis, int format, int prec=6, const QString &formula=QString())
void setLabelsNumericFormat (const QStringList &l)
 Used for restoring project files.
void setLabelsTextFormat (int axis, int type, const QString &labelsColName, Table *table)
void setLabelsTextFormat (int axis, int type, const QString &name, const QStringList &lst)
void setMajorTicksType (const QStringList &lst)
void setMajorTicksType (const QList< int > &lst)
void setMinorTicksType (const QStringList &lst)
void setMinorTicksType (const QList< int > &lst)
void setRightAxisTitle (const QString &text)
void setScaleTitle (int axis, const QString &text)
 TODO: eliminate this function in version 0.9.1 (used only when restoring project files).
void setTicksLength (int minLength, int majLength)
void setTopAxisTitle (const QString &text)
void setXAxisTitle (const QString &text)
void setYAxisTitle (const QString &text)
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)
Canvas Frame

QColor canvasFrameColor ()
int canvasFrameWidth ()
void setCanvasFrame (int width=1, const QColor &color=QColor(Qt::black))
Plot Title

void clearTitle ()
 Sets the title to an "almost empty" string: " ", thus keeping the QwtText object visible.
void initTitle (bool on, const QFont &fnt)
void removeTitle ()
 Sets title to an empty string and hides the text label.
void selectTitle (bool select=true)
void setTitleAlignment (int align)
void setTitleColor (const QColor &c)
void setTitleFont (const QFont &fnt)
bool titleSelected ()
Event Handlers

void closeEvent (QCloseEvent *e)
void contextMenuEvent (QContextMenuEvent *)
bool focusNextPrevChild (bool next)
Output: Copy/Export/Print

void copyImage ()
static QSize customPrintSize (const QSizeF &customSize, int unit, int dpi)
void draw (QPaintDevice *, const QSize &size, 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)
void exportSVG (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 exportToFile (const QString &fileName)
 Provided for convenience in scripts.
void exportVector (const QString &fileName, int res=0, bool color=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
QPixmap graphPixmap (const QSize &size=QSize(), double scaleFontsFactor=1.0)
bool isExportingTeX ()
void print ()
void printCropmarks (bool on)
void setEscapeTeXStringsMode (bool on=true)
void setScaleOnPrint (bool on)
void setTeXExportingMode (bool on=true)
Common to all Markers

void deselectMarker ()
 Reset any selection states on markers.
bool markerSelected ()
void removeMarker ()
QwtPlotMarker * selectedMarker ()
void setSelectedMarker (QwtPlotMarker *mrk, bool add=false)
 Set the selected marker.
void updateMarkersBoundingRect ()
 Keep the markers on screen each time the scales are modified by adding/removing curves.
Curves Layout

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

bool isPiePlot ()
 Returns true if this Graph is a pie plot, false otherwise.
QString pieLegendText ()
QwtPieCurveplotPie (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.
QwtPieCurveplotPie (Table *w, const QString &name, int startRow=0, int endRow=-1)
 Used when creating a pie plot.
void removePie ()
QString savePieCurveLayout ()
Obsolete functions provided to keep existing Python scripts working

LegendWidgetlegend ()
void removeLegend ()
void setLegend (const QString &)
Box Plots

BoxCurveopenBoxDiagram (Table *w, const QStringList &l, int fileVersion)
void plotBoxDiagram (Table *w, const QStringList &names, int startRow=0, int endRow=-1)
Vector Curves

VectorCurveplotVectorCurve (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())
Resizing

void resizeEvent (QResizeEvent *e)
void scaleFonts (double factor)
Saving to File

QString saveAxesBaseline ()
QString saveAxesColors ()
QString saveAxesFormulas ()
QString saveAxesLabelsType ()
QString saveAxesTitleAlignement ()
QString saveAxesTitleColors ()
QString saveCanvas ()
QString saveCurveLayout (int index)
QString saveCurves ()
QString saveEnabledAxes ()
QString saveEnabledTickLabels ()
QString saveFonts ()
QString saveLabelsFormat ()
QString saveLabelsRotation ()
QString saveMarkers ()
QString saveScale ()
QString saveScaleTitles ()
QString saveTicksType ()
QString saveTitle ()
QString saveToString (bool saveAsTemplate=false)
Modifing insertCurve Data

QString selectedCurveTitle ()
Border and background

void setBackgroundColor (const QColor &color)
void setFrame (int width=1, const QColor &color=Qt::black)
Customizing plot curves

void setCurveFullRange (int curveIndex)
void setCurveLineColor (int curveIndex, int colorIndex)
void setCurveLineStyle (int curveIndex, Qt::PenStyle style)
void setCurveLineWidth (int curveIndex, double width)
void setCurveStyle (int index, int s)
void setGrayScale ()
void setIndexedColors ()
Zoom

void zoom (bool on)
void zoomed (const QwtDoubleRect &)
bool zoomOn ()
void zoomOut ()

Signals

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

Public Member Functions

FrameWidgetactiveEnrichment ()
LegendWidgetactiveText ()
PlotToolInterfaceactiveTool () const
 Return the active tool, or NULL if none is active.
FrameWidgetadd (FrameWidget *fw, bool copy=true)
void addLegendItem ()
TexWidgetaddTexFormula (const QString &s, const QPixmap &pix)
void adjustGeometryToCanvas (const QRect &canvasRect)
 Adjust plot content to its canvas size.
int axesLinewidth () const
int axisLabelFormat (int axis)
void axisLabelFormat (int axis, char &f, int &prec) const
int axisLabelPrecision (int axis)
QRect boundingRect ()
void changeCurveIndex (int fromIndex, int toIndex)
QwtPlotItem * closestCurve (int xpos, int ypos, int &dist, int &point)
QList< QwtPlotItem * > curvesList ()
void deselect (QWidget *)
void deselect ()
void enableDouglasPeukerSpeedMode (double tolerance, int maxPoints)
void enablePanningMagnifier (bool on=true)
QList< FrameWidget * > enrichmentsList ()
QColor frameColor ()
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.
bool hasPanningMagnifierEnabled ()
bool hasSeletedItems ()
void insertMarker (QwtPlotMarker *m)
bool isPrinting ()
int majorTickLength () const
int minorTickLength () const
MultiLayermultiLayer ()
 Returns a pointer to the parent MultiLayer object.
const QColor & paletteBackgroundColor () const
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).
void raiseEnrichements ()
void remove (FrameWidget *)
void restoreCurveLabels (int curveID, const QStringList &lst)
 Used when restoring DataCurve curveID from a project file.
void select (QWidget *l, bool add=false)
QwtPlotItem * selectedCurveLabels ()
void setActiveText (LegendWidget *l)
void setActiveTool (PlotToolInterface *tool)
 Change the active tool, deleting the old one if it exists.
void setAxesLinewidth (int width)
void setMajorTicksType (int axis, int type)
void setMinorTicksType (int axis, int type)
void setTickLength (int minLength, int majLength)
int speedModeMaxPoints ()
QList< LegendWidget * > textsList ()
void updateCurveLabels ()
void updateLayout ()
 Adjust plot content to its current size. Must be reimplemented because the base implementation adds a mask causing an ugly drawing artefact.
 ~Graph ()

Static Public Member Functions

static QString escapeTeXSpecialCharacters (const QString &)
static QString texSuperscripts (const QString &)

Private Member Functions

QwtDoubleInterval axisBoundingInterval (int axis)
 Finds bounding interval of the plot data.
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 *)
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).
void showEvent (QShowEvent *event)
QList< FrameWidget * > stackingOrderEnrichmentsList ()

Private Attributes

bool autoScaleFonts
CanvasPickercp
FrameWidgetd_active_enrichment
 Pointer to the currently selected text/legend.
PlotToolInterfaced_active_tool
 The currently active tool, or NULL for default (pointer).
bool d_antialiasing
 Render hint for plot items.
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.
QList< QwtPlotItem * > d_curves
 List storing pointers to the curves on the plot.
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.
Gridd_grid
 Pointer to the grid.
bool d_is_exporting_tex
bool d_is_printing
 Flag telling if we are performing a print operation.
QList< QwtPlotMarker * > d_lines
 Arrows/lines on plot.
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.
int d_min_tick_length
 Axes tick lengths.
QwtPlotPanner * d_panner
PlotToolInterfaced_peak_fit_tool
bool d_print_cropmarks
QPointer< RangeSelectorToold_range_selector
 The current curve selection, or NULL if none is active.
bool d_scale_on_print
QwtPlotMarker * d_selected_marker
 Pointer to the currently selected line/image.
int d_speed_mode_points
bool d_tex_escape_strings
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.
QwtPlotZoomer * d_zoomer [2]
bool drawArrowOn
bool drawAxesBackbone
bool drawLineOn
ScalePickerscalePicker
TitlePickertitlePicker

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

Enumerator:
Left 
Right 
Bottom 
Top 
Enumerator:
Line 
Scatter 
LineSymbols 
VerticalBars 
Area 
Pie 
VerticalDropLines 
Spline 
HorizontalSteps 
Histogram 
HorizontalBars 
VectXYXY 
ErrorBars 
Box 
VectXYAM 
VerticalSteps 
ColorMap 
GrayScale 
Contour 
Function 
ImagePlot 
StackBar 
StackColumn 
Enumerator:
ColumnName 
ColumnComment 
TableName 
TableLegend 
Enumerator:
None 
Text 
Arrow 
Image 
Enumerator:
Linear 
Log10 
Enumerator:
NoTicks 
Out 
InOut 
In 

Constructor & Destructor Documentation

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

Member Function Documentation

void Graph::activateGraph (  )  [slot]
FrameWidget* Graph::activeEnrichment (  )  [inline]
LegendWidget * Graph::activeText (  ) 
PlotToolInterface* Graph::activeTool (  )  const [inline]
FrameWidget * Graph::add ( FrameWidget fw,
bool  copy = true 
)
void Graph::addArrow ( QStringList  list,
int  fileVersion 
) [slot]
ArrowMarker * Graph::addArrow ( ArrowMarker mrk  )  [slot]
bool Graph::addCurves ( Table w,
const QStringList &  names,
int  style = 0,
double  lWidth = 1,
int  sSize = 3,
int  startRow = 0,
int  endRow = -1 
) [slot]
QwtErrorPlotCurve * 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 
) [slot]
QwtErrorPlotCurve * 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 
) [slot]
void Graph::addFitCurve ( QwtPlotCurve *  c  )  [slot]
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 
) [slot]
QwtHistogram * Graph::addHistogram ( Matrix m  )  [slot]

Add a matrix histogram to the graph.

References addLegendItem(), insertCurve(), QwtHistogram::loadData(), and updatePlot().

Referenced by CurvesDialog::addCurve(), and ApplicationWindow::plotHistogram().

ImageWidget * Graph::addImage ( const QImage &  image  )  [slot]

References d_enrichments, and modifiedGraph().

ImageWidget * Graph::addImage ( const QString &  fileName  )  [slot]

References d_enrichments, and modifiedGraph().

ImageWidget * Graph::addImage ( ImageWidget i  )  [slot]
void Graph::addLegendItem (  ) 
TexWidget * Graph::addTexFormula ( const QString &  s,
const QPixmap &  pix 
)

References d_enrichments, and modifiedGraph().

Referenced by TexWidget::restore().

LegendWidget * Graph::addText ( LegendWidget t  )  [slot]
LegendWidget * Graph::addTimeStamp (  )  [slot]
void Graph::adjustGeometryToCanvas ( const QRect &  cr  ) 

Adjust plot content to its canvas size.

Parameters:
cr The new geometry of the canvas.

References autoScaleFonts, and scaleFonts().

QStringList Graph::analysableCurvesList (  )  [slot]
bool Graph::antialiasing (  )  [inline, slot]
bool Graph::arrowMarkerSelected (  )  [slot]
bool Graph::autoscaleFonts (  )  [inline, slot]
bool Graph::axesBackbones (  )  [inline, slot]

References drawAxesBackbone.

Referenced by AxesDialog::setGraph().

int Graph::axesLinewidth (  )  const
QwtDoubleInterval Graph::axisBoundingInterval ( int  axis  )  [private]

Finds bounding interval of the plot data.

Referenced by setScale().

QColor Graph::axisColor ( int  axis  )  [slot]
void Graph::axisDblClicked ( int   )  [signal]

Referenced by Graph(), and showScaleDialog().

void Graph::axisDivChanged ( Graph ,
int   
) [signal]

Referenced by setScale().

QString Graph::axisFormatInfo ( int  axis  )  [slot]
QString Graph::axisFormula ( int  axis  )  [slot]
int Graph::axisLabelFormat ( int  axis  ) 
void Graph::axisLabelFormat ( int  axis,
char &  f,
int &  prec 
) const
Returns:
the number format for the major scale labels of a specified axis
Parameters:
axis axis index
Return values:
f format character
prec precision

References ScaleDraw::labelFormat().

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

int Graph::axisLabelPrecision ( int  axis  ) 
QColor Graph::axisLabelsColor ( int  axis  )  [slot]
double Graph::axisStep ( int  axis  )  [inline, slot]

References d_user_step.

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

int Graph::axisTitleAlignment ( int  axis  )  [slot]
QColor Graph::axisTitleColor ( int  axis  )  [slot]
int Graph::axisTitleDistance ( int  axis  )  [slot]
QFont Graph::axisTitleFont ( int  axis  )  [slot]
QRect Graph::axisTitleRect ( const QwtScaleWidget *  scale  )  [slot]
bool Graph::axisTitleSelected (  )  [slot]
QString Graph::axisTitleString ( int  axis  )  [inline, slot]
ScaleDraw::ScaleType Graph::axisType ( int  axis  )  [slot]
QRect Graph::boundingRect (  ) 
QColor Graph::canvasFrameColor (  )  [slot]
int Graph::canvasFrameWidth (  )  [slot]

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

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

References d_curves, and modifiedGraph().

Referenced by CurvesDialog::shiftCurveBy().

void Graph::changeTicksLength ( int  minLength,
int  majLength 
) [slot]
void Graph::clearAxisTitle (  )  [slot]
void Graph::clearTitle (  )  [slot]

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

References modifiedGraph().

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

void Graph::closedGraph (  )  [signal]

Referenced by closeEvent().

void Graph::closeEvent ( QCloseEvent *  e  )  [slot]

References closedGraph().

QwtPlotItem * Graph::closestCurve ( int  xpos,
int  ypos,
int &  dist,
int &  point 
)
void Graph::contextMenuEvent ( QContextMenuEvent *  e  )  [slot]
void Graph::copy ( Graph g  )  [slot]
void Graph::copyAxisTitle (  )  [slot]
void Graph::copyCurves ( Graph g  )  [slot]
void Graph::copyImage (  )  [slot]
void Graph::copyTitle (  )  [slot]

Referenced by showTitleContextMenu().

void Graph::createTable ( const QString &  ,
int  ,
int  ,
const QString &   
) [signal]
void Graph::createTable ( const QwtPlotCurve *  curve  )  [slot]
void Graph::createTable ( const QString &  curveName  )  [slot]

Provided for convenience in scripts.

References curve().

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

void Graph::currentFontChanged ( const QFont &   )  [signal]
QwtScaleWidget * Graph::currentScale (  )  [slot]
void Graph::cursorInfo ( const QString &   )  [signal]
QwtPlotCurve* Graph::curve ( const QString &  title  )  [inline, slot]

get curve by name

References curve(), and curveIndex().

Referenced by curve().

QwtPlotCurve * Graph::curve ( int  index  )  [slot]

get curve by index

References d_curves.

Referenced by SmoothCurveDialog::activateCurve(), InterpolationDialog::activateCurve(), FitDialog::activateCurve(), FFTDialog::activateCurve(), ExpDecayDialog::activateCurve(), ApplicationWindow::analysis(), ApplicationWindow::analyzeCurve(), AssociationsDialog::changePlotAssociation(), RangeSelectorTool::clearMultipleSelection(), closestCurve(), RangeSelectorTool::copyMultipleSelection(), createTable(), ApplicationWindow::defineErrorBars(), ApplicationWindow::differentiate(), LegendWidget::drawText(), ExpDecayDialog::fit(), LegendWidget::getCurve(), guessUniqueCurveLayout(), ImportOPJ::importGraphs(), initCurveLayout(), insertFunctionCurve(), insertText(), RangeSelectorTool::keyEventFilter(), DataPickerTool::keyEventFilter(), RangeSelectorTool::mightNeedMultipleSelection(), modifyFunctionCurve(), ApplicationWindow::openGraph(), ApplicationWindow::plotDoubleYAxis(), range(), RangeSelectorTool::RangeSelectorTool(), removeCurve(), removePie(), PieLabel::restore(), restoreCurveLabels(), MultiLayer::reverseWaterfallOrder(), saveCurveLayout(), savePieCurveLayout(), setBarsGap(), setCurveFullRange(), setCurveLineColor(), setCurveLineStyle(), setCurveLineWidth(), setCurveStyle(), FunctionDialog::setCurveToModify(), CurveRangeDialog::setCurveToModify(), Filter::setDataFromCurve(), MultiLayer::setWaterfallFillColor(), MultiLayer::setWaterfallSideLines(), RangeSelectorTool::showSelectionDialog(), MultiLayer::showWaterfallFillDialog(), updateVectorsLayout(), and MultiLayer::updateWaterfallFill().

int Graph::curveCount (  )  [inline, slot]
int Graph::curveIndex ( const QString &  title  )  [inline, slot]

map curve title to index

References plotItemsList().

int Graph::curveIndex ( QwtPlotItem *  c  )  [inline, slot]
QStringList Graph::curveNamesList (  )  [slot]

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

References d_curves.

Referenced by FitDialog::accept(), FitDialog::deleteFitCurves(), ApplicationWindow::dependingPlots(), MultiPeakFit::insertPeakFunctionCurve(), and ApplicationWindow::multilayerDependencies().

QList<QwtPlotItem *> Graph::curvesList (  )  [inline]
QString Graph::curveTitle ( int  index  )  [slot]

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

References plotItem().

QSize Graph::customPrintSize ( const QSizeF &  customSize,
int  unit,
int  dpi 
) [static, slot]
void Graph::cutAxisTitle (  )  [slot]

References copyAxisTitle(), and removeAxisTitle().

Referenced by showAxisTitleMenu().

void Graph::cutTitle (  )  [slot]

References removeTitle().

Referenced by showTitleContextMenu().

void Graph::dataRangeChanged (  )  [signal]

Referenced by enableRangeSelectors().

void Graph::deleteFitCurves (  )  [slot]
void Graph::deselect ( QWidget *  l  ) 

References d_markers_selector.

void Graph::deselect (  ) 
void Graph::deselectCurves (  )  [private]

References curvesList(), and Function.

Referenced by deselect(), and select().

void Graph::deselectMarker (  )  [slot]
void Graph::disableTools (  )  [slot]
void Graph::dragEnterEvent ( QDragEnterEvent *  e  )  [private]
void Graph::draw ( QPaintDevice *  device,
const QSize &  size,
double  fontsFactor = 1.0 
) [slot]

References boundingRect(), print(), and scaleFonts().

Referenced by exportSVG(), and exportTeX().

bool Graph::drawArrow (  )  [inline, slot]
void Graph::drawAxesBackbones ( bool  yes  )  [slot]
void Graph::drawBreak ( QPainter *  painter,
const QRect &  rect,
const QwtScaleMap &  map,
int  axis 
) const [private]
void Graph::drawInwardTicks ( QPainter *  painter,
const QRect &  rect,
const QwtScaleMap &  map,
int  axis,
bool  min,
bool  maj 
) const [private]
void Graph::drawItems ( QPainter *  painter,
const QRect &  rect,
const QwtScaleMap  map[axisCnt],
const QwtPlotPrintFilter &  pfilter 
) const [private, virtual]
void Graph::drawLine ( bool  on,
bool  arrow = false 
) [slot]
bool Graph::drawLineActive (  )  [inline, slot]
void Graph::drawLineEnded ( bool   )  [signal]

Referenced by drawLine().

void Graph::dropEvent ( QDropEvent *  event  )  [private]
void Graph::enableAutoscaling ( bool  on = true  )  [inline, slot]
void Graph::enableAxis ( int  axis,
bool  on = true 
) [slot]
void Graph::enableAxisLabels ( int  axis,
bool  on = true 
) [slot]
void Graph::enableDouglasPeukerSpeedMode ( double  tolerance,
int  maxPoints 
)
void Graph::enablePanningMagnifier ( bool  on = true  ) 
bool Graph::enableRangeSelectors ( const QObject *  status_target = NULL,
const char *  status_slot = "" 
) [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 ApplicationWindow::showRangeSelectors().

void Graph::enableTextEditor ( Graph  )  [signal]
void Graph::enableTextEditor (  )  [slot]
QList<FrameWidget *> Graph::enrichmentsList (  )  [inline]
QString Graph::escapeTeXSpecialCharacters ( const QString &  s  )  [static]
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 
) [slot]
void Graph::exportSVG ( const QString &  fname,
const QSizeF &  customSize = QSizeF(),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
) [slot]
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 
) [slot]
void Graph::exportToFile ( const QString &  fileName  )  [slot]

Provided for convenience in scripts.

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

void Graph::exportVector ( const QString &  fileName,
int  res = 0,
bool  color = true,
const QSizeF &  customSize = QSizeF (),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
) [slot]
QList<QwtPlotCurve *> Graph::fitCurvesList (  )  [inline, slot]
bool Graph::focusNextPrevChild ( bool  next  )  [slot]
QColor Graph::frameColor (  ) 
QString Graph::generateFunctionName ( const QString &  name = tr("F")  )  [slot]

Returns an unique function name.

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

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

double Graph::getDouglasPeukerTolerance (  )  [inline]
QList< int > Graph::getMajorTicksType (  ) 
QList< int > Graph::getMinorTicksType (  ) 
Qt::PenStyle Graph::getPenStyle ( int  style  )  [static, slot]
Qt::PenStyle Graph::getPenStyle ( const QString &  s  )  [static, slot]
QPixmap Graph::graphPixmap ( const QSize &  size = QSize(),
double  scaleFontsFactor = 1.0 
) [slot]

References boundingRect(), print(), and scaleFonts().

Referenced by copyImage(), and exportImage().

Grid* Graph::grid (  )  [inline]
void Graph::guessUniqueCurveLayout ( int &  colorIndex,
int &  symbolIndex 
) [slot]

Tries to guess not already used curve color and symbol style.

References ColorBox::colorIndex(), curve(), d_curves, ErrorBars, QwtErrorPlotCurve::masterCurve(), SymbolBox::symbolIndex(), and PlotCurve::type().

Referenced by CurvesDialog::addCurve(), addFunction(), and initCurveLayout().

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 Spectrogram::selectedLabels().

bool Graph::hasPanningMagnifierEnabled (  )  [inline]
bool Graph::hasSeletedItems (  ) 
void Graph::hiddenPlot ( QWidget *   )  [signal]
void Graph::hideSelectedAxis (  )  [slot]
bool Graph::imageMarkerSelected (  )  [slot]
CurveLayout Graph::initCurveLayout (  )  [static, slot]
CurveLayout Graph::initCurveLayout ( int  style,
int  curves = 0,
bool  guessLayout = true 
) [slot]
void Graph::initFonts ( const QFont &  scaleTitleFnt,
const QFont &  numbersFnt 
) [slot]
void Graph::initTitle ( bool  on,
const QFont &  fnt 
) [slot]
void Graph::insertCurve ( QwtPlotItem *  c  )  [slot]

References d_antialiasing, and d_curves.

DataCurve * Graph::insertCurve ( Table w,
const QString &  xColName,
const QString &  yColName,
int  style,
int  startRow = 0,
int  endRow = -1 
) [slot]
DataCurve * Graph::insertCurve ( Table w,
int  xcol,
const QString &  name,
int  style 
) [slot]
DataCurve * Graph::insertCurve ( Table w,
const QString &  name,
int  style,
int  startRow = 0,
int  endRow = -1 
) [slot]
FunctionCurve * Graph::insertFunctionCurve ( const QString &  formula,
int  points,
int  fileVersion 
) [slot]

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

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

Referenced by ApplicationWindow::openGraph().

void Graph::insertImageMarker ( const QStringList &  lst,
int  fileVersion 
) [slot]
void Graph::insertLegend ( const QStringList &  lst,
int  fileVersion 
) [slot]
void Graph::insertMarker ( QwtPlotMarker *  m  ) 
void Graph::insertPlotItem ( QwtPlotItem *  i,
int  type 
) [slot]
LegendWidget * Graph::insertText ( const QStringList &  list,
int  fileVersion 
) [slot]
void Graph::invertScale ( int  axis  )  [slot]

Set axis scale.

bool Graph::isAutoscalingEnabled (  )  [inline, slot]

References d_auto_scale.

Referenced by copy().

bool Graph::isExportingTeX (  )  [inline, slot]
bool Graph::isPiePlot (  )  [slot]
bool Graph::isPrinting (  )  [inline]

References d_is_printing.

Referenced by ScaleDraw::drawBackbone().

int Graph::labelsRotation ( int  axis  )  [slot]
LegendWidget * Graph::legend (  )  [slot]
QString Graph::legendText ( bool  layerSpec = false  )  [slot]
QList<QwtPlotMarker *> Graph::linesList (  )  [inline, slot]
void Graph::loadAxesLinewidth ( int  width  )  [slot]

used when opening a project file

References setAxesLinewidth().

Referenced by ApplicationWindow::openGraph().

void Graph::loadAxesOptions ( const QString &  s  )  [slot]

used when opening a project file

References drawAxesBackbone.

Referenced by ApplicationWindow::openGraph().

int Graph::majorTickLength (  )  const
bool Graph::markerSelected (  )  [slot]
DataCurve * Graph::masterCurve ( const QString &  xColName,
const QString &  yColName 
) [slot]

Returns a valid master curve for a plot association.

References d_curves, and Function.

DataCurve * Graph::masterCurve ( QwtErrorPlotCurve er  )  [slot]
int Graph::minorTickLength (  )  const
void Graph::modifiedGraph (  )  [signal]
void Graph::modifyFunctionCurve ( int  curve,
int  type,
const QStringList &  formulas,
const QString &  var,
double  start,
double  end,
int  points,
const QMap< QString, double > &  constants 
) [slot]
MultiLayer * Graph::multiLayer (  ) 

Returns a pointer to the parent MultiLayer object.

Referenced by AddWidgetTool::addEquation(), AddWidgetTool::addText(), AddWidgetTool::AddWidgetTool(), ScreenPickerTool::append(), TextDialog::apply(), LineDialog::apply(), AxesDialog::applyAxisFormat(), AxesDialog::applyCanvasFormat(), PlotDialog::applyErrorBarFormat(), PlotDialog::applyLineFormat(), PlotDialog::applySymbolsFormat(), FrameWidget::calculateBottomValue(), FrameWidget::calculateRightValue(), FrameWidget::calculateXValue(), FrameWidget::calculateYValue(), TextEditor::closeEvent(), RangeSelectorTool::copyMultipleSelection(), RangeSelectorTool::copySelectedCurve(), EnrichmentDialog::createImage(), ArrowMarker::displayInfo(), MultiLayer::dragEnterEvent(), dragEnterEvent(), MultiLayer::dropEvent(), dropEvent(), RangeSelectorTool::emitStatusText(), enablePanningMagnifier(), enableTextEditor(), CanvasPicker::eventFilter(), AddWidgetTool::eventFilter(), exportImage(), exportVector(), EnrichmentDialog::frameApplyTo(), FrameWidget::FrameWidget(), LegendWidget::getCurve(), QwtPieCurve::initLabels(), DataPickerTool::keyEventFilter(), ScaleDraw::label(), legendText(), QwtPieCurve::loadData(), Fit::logFitInfo(), Integration::logInfo(), newLegend(), RangeSelectorTool::pasteSelection(), EnrichmentDialog::patternApplyTo(), print(), raiseEnrichements(), EnrichmentDialog::saveImagesInternally(), EnrichmentDialog::setBestSize(), EnrichmentDialog::setCoordinates(), Spectrogram::setDefaultColorMap(), RectangleWidget::setLinkedLayer(), Spectrogram::setMatrix(), FrameWidget::setOriginCoord(), LegendWidget::showTextEditor(), stackingOrderEnrichmentsList(), TextEditor::TextEditor(), EnrichmentDialog::textFormatApplyTo(), EnrichmentDialog::updateForm(), AxesDialog::updateGrid(), and AddWidgetTool::~AddWidgetTool().

LegendWidget * Graph::newLegend ( const QString &  text = QString()  )  [slot]
void Graph::notifyChanges (  )  [slot]
void Graph::notifyFontChange ( const QFont &  f  )  [inline, slot]
int Graph::obsoleteSymbolStyle ( int  type  )  [static, slot]
BoxCurve * Graph::openBoxDiagram ( Table w,
const QStringList &  l,
int  fileVersion 
) [slot]
const QColor & Graph::paletteBackgroundColor (  )  const
QString Graph::penStyleName ( Qt::PenStyle  style  )  [static, slot]
QString Graph::pieLegendText (  )  [slot]

References d_curves.

Referenced by newLegend().

void Graph::plotBoxDiagram ( Table w,
const QStringList &  names,
int  startRow = 0,
int  endRow = -1 
) [slot]
QwtPlotItem * Graph::plotItem ( int  index  )  [slot]
QStringList Graph::plotItemsList (  )  [slot]

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

References d_curves.

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

QwtPieCurve * 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]
QwtPieCurve * Graph::plotPie ( Table w,
const QString &  name,
int  startRow = 0,
int  endRow = -1 
) [slot]
Spectrogram * Graph::plotSpectrogram ( Matrix m,
CurveType  type 
) [slot]
VectorCurve * Graph::plotVectorCurve ( Table w,
const QStringList &  colList,
int  style,
int  startRow = 0,
int  endRow = -1 
) [slot]
void Graph::print (  )  [slot]
void Graph::print ( QPainter *  painter,
const QRect &  plotRect,
const QwtPlotPrintFilter &  pfilter = QwtPlotPrintFilter() 
)
void Graph::printCanvas ( QPainter *  painter,
const QRect &  canvasRect,
const QwtScaleMap  map[axisCnt],
const QwtPlotPrintFilter &  pfilter 
) const [private]

References drawItems().

Referenced by print().

void Graph::printCropmarks ( bool  on  )  [inline, slot]
void Graph::printFrame ( QPainter *  painter,
const QRect &  rect 
) const [private]

References paletteBackgroundColor().

Referenced by print().

void Graph::printScale ( QPainter *  painter,
int  axisId,
int  startDist,
int  endDist,
int  baseDist,
const QRect &  rect 
) const [private, virtual]

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

Parameters:
painter Painter
axisId Axis
startDist Start border distance
endDist End border distance
baseDist Base distance
rect Bounding rectangle

References d_is_exporting_tex, d_tex_escape_strings, escapeTeXSpecialCharacters(), and texSuperscripts().

Referenced by print().

void Graph::raiseEnrichements (  ) 
int Graph::range ( QwtPlotCurve *  c,
double *  start,
double *  end 
) [slot]

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.

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

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 PolynomFitDialog::activateCurve(), InterpolationDialog::activateCurve(), FitDialog::activateCurve(), ExpDecayDialog::activateCurve(), and Filter::setDataFromCurve().

bool Graph::rangeSelectorsEnabled (  )  [slot]
QPointer<RangeSelectorTool> Graph::rangeSelectorTool (  )  [inline, slot]
void Graph::remove ( ArrowMarker arrow  )  [slot]
void Graph::remove ( FrameWidget f  ) 
void Graph::removeAxisTitle (  )  [slot]
void Graph::removeCurve ( const QString &  s  )  [slot]

Removes a curve defined by its title string s.

References curveIndex(), and removeCurve().

void Graph::removeCurve ( int  index  )  [slot]

Removes a curve defined by its index.

References d_curves, and removeCurve().

void Graph::removeCurve ( QwtPlotItem *  it  )  [slot]
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().

void Graph::removeLegend (  )  [slot]
void Graph::removeLegendItem ( int  index  )  [slot]
void Graph::removeMarker (  )  [slot]
void Graph::removePie (  )  [slot]
void Graph::removeTitle (  )  [slot]

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

References modifiedGraph().

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

void Graph::resizeEvent ( QResizeEvent *  e  )  [slot]
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().

QwtHistogram * Graph::restoreHistogram ( Matrix m,
const QStringList &  l 
) [slot]
void Graph::restoreSpectrogram ( ApplicationWindow app,
const QStringList &  lst 
) [slot]
QString Graph::saveAxesBaseline (  )  [slot]

Referenced by saveToString().

QString Graph::saveAxesColors (  )  [slot]

Referenced by saveToString().

QString Graph::saveAxesFormulas (  )  [slot]

References ScaleDraw::formula().

Referenced by saveToString().

QString Graph::saveAxesLabelsType (  )  [slot]
QString Graph::saveAxesTitleAlignement (  )  [slot]

Referenced by saveToString().

QString Graph::saveAxesTitleColors (  )  [slot]

Referenced by saveToString().

QString Graph::saveCanvas (  )  [slot]

References canvasFrameColor().

Referenced by saveToString().

QString Graph::saveCurveLayout ( int  index  )  [slot]
QString Graph::saveCurves (  )  [slot]
QString Graph::saveEnabledAxes (  )  [slot]

Referenced by saveToString().

QString Graph::saveEnabledTickLabels (  )  [slot]

Referenced by saveToString().

QString Graph::saveFonts (  )  [slot]

Referenced by saveToString().

QString Graph::saveLabelsFormat (  )  [slot]

References axisLabelFormat(), and axisLabelPrecision().

Referenced by saveToString().

QString Graph::saveLabelsRotation (  )  [slot]

References labelsRotation().

Referenced by saveToString().

QString Graph::saveMarkers (  )  [slot]
QString Graph::savePieCurveLayout (  )  [slot]
QString Graph::saveScale (  )  [slot]

References d_user_step, and ScaleEngine::type().

Referenced by saveToString().

QString Graph::saveScaleTitles (  )  [slot]

Referenced by saveToString().

QString Graph::saveTicksType (  )  [slot]

References getMajorTicksType(), and getMinorTicksType().

Referenced by saveToString().

QString Graph::saveTitle (  )  [slot]

Referenced by saveToString().

QString Graph::saveToString ( bool  saveAsTemplate = false  )  [slot]
void Graph::scaleFonts ( double  factor  )  [slot]
void Graph::select ( QWidget *  l,
bool  add = false 
)
QwtPlotItem * Graph::selectedCurveLabels (  ) 

References curvesList(), and Function.

Referenced by dragEnterEvent(), and CanvasPicker::eventFilter().

QString Graph::selectedCurveTitle (  )  [slot]
void Graph::selectedGraph ( Graph  )  [signal]

Referenced by activateGraph(), and selectTitle().

QwtPlotMarker* Graph::selectedMarker (  )  [inline, slot]
QwtScaleWidget * Graph::selectedScale (  )  [slot]
double Graph::selectedXEndValue (  )  [slot]
double Graph::selectedXStartValue (  )  [slot]
void Graph::selectTitle ( bool  select = true  )  [slot]
void Graph::setActiveText ( LegendWidget l  )  [inline]

References d_active_enrichment.

Referenced by TextEditor::closeEvent().

void Graph::setActiveTool ( PlotToolInterface tool  ) 
void Graph::setAntialiasing ( bool  on = true,
bool  update = true 
) [slot]
void Graph::setAutoScale (  )  [slot]
void Graph::setAutoscaleFonts ( bool  on = true  )  [inline, slot]
void Graph::setAxesLinewidth ( int  width  ) 
void Graph::setAxisColor ( int  axis,
const QColor &  color 
) [slot]
void Graph::setAxisFont ( int  axis,
const QFont &  fnt 
) [slot]
void Graph::setAxisFormula ( int  axis,
const QString &  formula 
) [slot]
void Graph::setAxisLabelRotation ( int  axis,
int  rotation 
) [slot]
void Graph::setAxisLabelsColor ( int  axis,
const QColor &  color 
) [slot]
void Graph::setAxisMargin ( int  axis,
int  margin 
) [slot]
void Graph::setAxisTicksLength ( int  axis,
int  majTicksType,
int  minTicksType,
int  minLength,
int  majLength 
) [slot]
void Graph::setAxisTitle ( int  axis,
const QString &  text 
) [slot]
void Graph::setAxisTitleAlignment ( int  axis,
int  align 
) [slot]
void Graph::setAxisTitleColor ( int  axis,
const QColor &  c 
) [slot]
void Graph::setAxisTitleDistance ( int  axis,
int  dist 
) [slot]
void Graph::setAxisTitleFont ( int  axis,
const QFont &  fnt 
) [slot]
void Graph::setBackgroundColor ( const QColor &  color  )  [slot]
void Graph::setBarsGap ( int  curve,
int  gapPercent,
int  offset 
) [slot]

Used for VerticalBars, HorizontalBars and Histograms.

References curve(), QwtBarCurve::gap(), QwtBarCurve::offset(), QwtBarCurve::setGap(), and QwtBarCurve::setOffset().

Referenced by PlotDialog::acceptParams(), and ApplicationWindow::openGraph().

void Graph::setCanvasCoordinates ( const QRectF &  r  )  [slot]
void Graph::setCanvasFrame ( int  width = 1,
const QColor &  color = QColor(Qt::black) 
) [slot]
void Graph::setCurrentFont ( const QFont &  f  )  [slot]
void Graph::setCurveFullRange ( int  curveIndex  )  [slot]
void Graph::setCurveLineColor ( int  curveIndex,
int  colorIndex 
) [slot]
void Graph::setCurveLineStyle ( int  curveIndex,
Qt::PenStyle  style 
) [slot]

References curve(), and modifiedGraph().

void Graph::setCurveLineWidth ( int  curveIndex,
double  width 
) [slot]

References curve(), and modifiedGraph().

void Graph::setCurveStyle ( int  index,
int  s 
) [slot]
void Graph::setEscapeTeXStringsMode ( bool  on = true  )  [inline, slot]

References d_tex_escape_strings.

Referenced by MultiLayer::exportTeX().

void Graph::setFrame ( int  width = 1,
const QColor &  color = Qt::black 
) [slot]
void Graph::setGrayScale (  )  [slot]
void Graph::setIndexedColors (  )  [slot]
void Graph::setLabelsDateTimeFormat ( int  axis,
int  type,
const QString &  formatInfo 
) [slot]
void Graph::setLabelsDayFormat ( int  axis,
int  format 
) [slot]
void Graph::setLabelsMonthFormat ( int  axis,
int  format 
) [slot]
void Graph::setLabelsNumericFormat ( int  axis,
int  format,
int  prec = 6,
const QString &  formula = QString() 
) [slot]
void Graph::setLabelsNumericFormat ( const QStringList &  l  )  [slot]

Used for restoring project files.

References ScaleDraw::formula().

Referenced by copy(), ApplicationWindow::openGraph(), and showAxis().

void Graph::setLabelsTextFormat ( int  axis,
int  type,
const QString &  labelsColName,
Table table 
) [slot]
void Graph::setLabelsTextFormat ( int  axis,
int  type,
const QString &  name,
const QStringList &  lst 
) [slot]
void Graph::setLegend ( const QString &  s  )  [slot]
void Graph::setMajorTicksType ( const QStringList &  lst  )  [slot]

References setMajorTicksType().

void Graph::setMajorTicksType ( const QList< int > &  lst  )  [slot]
void Graph::setMajorTicksType ( int  axis,
int  type 
)
void Graph::setMinorTicksType ( const QStringList &  lst  )  [slot]

References setMinorTicksType().

void Graph::setMinorTicksType ( const QList< int > &  lst  )  [slot]
void Graph::setMinorTicksType ( int  axis,
int  type 
)
void Graph::setRightAxisTitle ( const QString &  text  )  [slot]

References modifiedGraph(), and setAxisTitle().

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 
) [slot]
void Graph::setScaleOnPrint ( bool  on  )  [inline, slot]
void Graph::setScaleTitle ( int  axis,
const QString &  text 
) [slot]

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

References setAxisTitle().

Referenced by ApplicationWindow::openGraph().

void Graph::setSelectedMarker ( QwtPlotMarker *  mrk,
bool  add = false 
) [slot]

Set the selected marker.

Parameters:
mrk key of the marker to be selected.
add whether the marker 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_marker, ScalePicker::deselect(), modifiedGraph(), scalePicker, and selectTitle().

Referenced by CanvasPicker::selectMarker().

void Graph::setTeXExportingMode ( bool  on = true  )  [inline, slot]

References d_is_exporting_tex.

Referenced by MultiLayer::exportTeX().

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

References d_maj_tick_length, and d_min_tick_length.

Referenced by setAxisTicksLength().

void Graph::setTicksLength ( int  minLength,
int  majLength 
) [slot]
void Graph::setTitleAlignment ( int  align  )  [slot]

References modifiedGraph().

Referenced by ApplicationWindow::openGraph().

void Graph::setTitleColor ( const QColor &  c  )  [slot]

References modifiedGraph().

Referenced by ApplicationWindow::openGraph().

void Graph::setTitleFont ( const QFont &  fnt  )  [slot]

References modifiedGraph().

Referenced by ApplicationWindow::openGraph().

void Graph::setTopAxisTitle ( const QString &  text  )  [slot]

References modifiedGraph(), and setAxisTitle().

void Graph::setXAxisTitle ( const QString &  text  )  [slot]
void Graph::setYAxisTitle ( const QString &  text  )  [slot]
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 
) [slot]
void Graph::showAxisContextMenu ( int  axis  )  [slot]
void Graph::showAxisDialog ( int   )  [signal]
void Graph::showAxisDialog (  )  [slot]
void Graph::showAxisTitleDialog (  )  [signal]
void Graph::showAxisTitleMenu (  )  [slot]
void Graph::showContextMenu (  )  [signal]

Referenced by contextMenuEvent().

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

Shows/Hides a curve defined by its index.

References modifiedGraph(), and plotItem().

Referenced by ApplicationWindow::hideCurve(), ApplicationWindow::hideOtherCurves(), and ApplicationWindow::showAllCurves().

void Graph::showCurveContextMenu ( QwtPlotItem *   )  [signal]

Referenced by contextMenuEvent().

void Graph::showEvent ( QShowEvent *  event  )  [private]

References updateCurveLabels().

void Graph::showFitResults ( const QString &   )  [signal]
void Graph::showGrid ( int  axis  )  [slot]

Convenience function enabling the grid for a user defined axis.

References d_grid, and modifiedGraph().

void Graph::showGrid (  )  [slot]

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

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

void Graph::showGrids (  )  [slot]
void Graph::showMarkerPopupMenu (  )  [signal]

Referenced by contextMenuEvent(), and Graph().

void Graph::showPlotDialog ( int   )  [signal]

Referenced by Graph().

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

Referenced by CurvesDialog::addCurves().

void Graph::showScaleDialog (  )  [slot]
void Graph::showTitleContextMenu (  )  [slot]
int Graph::speedModeMaxPoints (  )  [inline]
QList< FrameWidget * > Graph::stackingOrderEnrichmentsList (  )  [private]
QString Graph::texSuperscripts ( const QString &  text  )  [static]
QList< LegendWidget * > Graph::textsList (  ) 

References d_enrichments.

Referenced by MultiLayer::setFonts().

bool Graph::titleSelected (  )  [slot]
void Graph::updateCurveLabels (  ) 
void Graph::updateCurveLayout ( PlotCurve c,
const CurveLayout cL 
) [slot]
void Graph::updateCurveNames ( const QString &  oldName,
const QString &  newName,
bool  updateTableName = true 
) [slot]
void Graph::updateCurvesData ( Table w,
const QString &  yColName 
) [slot]
void Graph::updateErrorBars ( QwtErrorPlotCurve er,
bool  xErr,
double  width,
int  cap,
const QColor &  c,
bool  plus,
bool  minus,
bool  through 
) [slot]
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.

Referenced by AxesDialog::applyAxisFormatToLayer(), copy(), ImportOPJ::importGraphs(), insertText(), ApplicationWindow::openGraph(), resizeEvent(), TexWidget::restore(), showAxis(), and Spectrogram::showColorScale().

void Graph::updateMarkersBoundingRect (  )  [slot]
void Graph::updatePlot (  )  [slot]
void Graph::updateScale (  )  [slot]
void Graph::updateSecondaryAxis ( int  axis,
bool  changeFormat = false 
) [slot]
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() 
) [slot]
bool Graph::validCurvesDataSize (  )  [slot]
void Graph::viewLineDialog (  )  [signal]

Referenced by Graph().

void Graph::viewTitleDialog (  )  [signal]
int Graph::visibleCurves (  )  [slot]
void Graph::zoom ( bool  on  )  [slot]
void Graph::zoomed ( const QwtDoubleRect &   )  [slot]

References modifiedGraph(), and updateMarkersBoundingRect().

Referenced by Graph().

bool Graph::zoomOn (  )  [slot]
void Graph::zoomOut (  )  [slot]

References d_zoomer, and updateSecondaryAxis().


Member Data Documentation

bool Graph::autoScaleFonts [private]
CanvasPicker* Graph::cp [private]

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

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

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

bool Graph::d_antialiasing [private]

Render hint for plot items.

Referenced by antialiasing(), Graph(), insertCurve(), insertMarker(), saveToString(), and setAntialiasing().

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 copy(), enableAutoscaling(), Graph(), isAutoscalingEnabled(), updatePlot(), and updateScale().

QList<QwtPlotItem*> Graph::d_curves [private]
QList<FrameWidget*> Graph::d_enrichments [private]
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().

Grid* Graph::d_grid [private]

Pointer to the grid.

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

bool Graph::d_is_exporting_tex [private]
bool Graph::d_is_printing [private]

Flag telling if we are performing a print operation.

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

QList<QwtPlotMarker*> Graph::d_lines [private]
QwtPlotMagnifier* Graph::d_magnifier [private]
int Graph::d_maj_tick_length [private]

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

Referenced by deselect(), deselectMarker(), hasSeletedItems(), remove(), select(), setSelectedMarker(), and ~Graph().

int Graph::d_min_tick_length [private]

Axes tick lengths.

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

QwtPlotPanner* Graph::d_panner [private]
bool Graph::d_print_cropmarks [private]

Referenced by Graph(), print(), and printCropmarks().

bool Graph::d_scale_on_print [private]

Referenced by Graph(), print(), and setScaleOnPrint().

QwtPlotMarker* Graph::d_selected_marker [private]
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(), copy(), Graph(), saveScale(), setAutoScale(), setScale(), updatePlot(), and updateSecondaryAxis().

QwtPlotZoomer* Graph::d_zoomer[2] [private]
bool Graph::drawArrowOn [private]

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

bool Graph::drawAxesBackbone [private]
bool Graph::drawLineOn [private]

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


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

Generated by  doxygen 1.6.2