Public Types | Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes

MultiLayer Class Reference

An MDI window (MdiSubWindow) managing one or more Graph objects. More...

#include <MultiLayer.h>

Inheritance diagram for MultiLayer:
MdiSubWindow

List of all members.

Public Types

enum  AlignPolicy { AlignLayers = 0, AlignCanvases }
enum  HorAlignement { HCenter, Left, Right }
enum  SizePolicy { Expanding = 0, UserSize }
enum  VertAlignement { VCenter, Top, Bottom }

Public Slots

void activateGraph (LayerButton *button)
GraphactiveLayer ()
GraphaddLayer (int x=0, int y=0, int width=0, int height=0, bool=false)
void adjustSize ()
QSize arrangeLayers (bool userSize)
bool arrangeLayers (bool fit, bool userSize)
int bottomMargin ()
int colsSpacing ()
void confirmRemoveLayer ()
void connectLayer (Graph *g)
void findBestLayout (int &rows, int &cols)
int getCols ()
int getRows ()
bool hasSelectedLayers ()
int horizontalAlignement ()
bool isEmpty ()
GraphlayerAt (const QPoint &pos)
 Returns the layer at the given position; returns 0 if there is no such layer.
QSize layerCanvasSize ()
int leftMargin ()
bool removeActiveLayer ()
bool removeLayer (Graph *g)
int rightMargin ()
int rowsSpacing ()
void save (const QString &fn, const QString &geometry, bool=false)
void setActiveLayer (Graph *g)
void setAlignement (int ha, int va)
void setCols (int c)
void setFonts (const QFont &titleFnt, const QFont &scaleFnt, const QFont &numbersFnt, const QFont &legendFnt)
void setGraphGeometry (int x, int y, int w, int h)
void setLayerCanvasSize (int w, int h)
void setMargins (int lm, int rm, int tm, int bm)
void setRows (int r)
void setSpacing (int rgap, int cgap)
bool swapLayers (int src, int dest)
int topMargin ()
void updateLayerAxes (Graph *g, int axis)
void updateLayersLayout (Graph *)
int verticalAlignement ()
Print and Export

QPixmap canvasPixmap (const QSize &size=QSize(), double scaleFontsFactor=1.0, bool transparent=false)
void exportToFile (const QString &fileName)
void exportImage (QTextDocument *document, int quality=100, bool transparent=false, int dpi=0, 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)
void exportSVG (const QString &fname, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
void exportPDF (const QString &fname)
void exportVector (const QString &fileName, int res=0, bool color=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
void draw (QPaintDevice *, const QSizeF &customSize, int unit, int res, 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 copyAllLayers ()
void print ()
void print (QPrinter *)
void printAllLayers (QPainter *painter)
void printActiveLayer ()
Waterfall Plots

void showWaterfallOffsetDialog ()
void reverseWaterfallOrder ()
void showWaterfallFillDialog ()
void setWaterfallFillColor (const QColor &)
void updateWaterfallFill (bool on)
void setWaterfallSideLines (bool on=true)
void changeWaterfallXOffset (int)
void changeWaterfallYOffset (int)
void updateWaterfallLayout ()
void updateWaterfallScales (Graph *g, int axis)

Signals

void currentFontChanged (const QFont &)
void cursorInfo (const QString &)
void drawLineEnded (bool)
void modifiedPlot ()
void pasteMarker ()
void setPointerCursor ()
void showCurvesDialog ()
void showEnrichementDialog ()
void showLineDialog ()
void showMarkerPopupMenu ()

Public Member Functions

AlignPolicy alignPolicy ()
QWidget * canvas ()
QRect canvasChildrenRect ()
QRect canvasRect ()
void copy (MultiLayer *ml)
void createWaterfallBox ()
bool hasLinkedXLayerAxes ()
bool isWaterfallPlot ()
Graphlayer (int num)
int layerIndex (Graph *g)
QList< Graph * > layersList ()
void linkXLayerAxes (bool link=true)
 MultiLayer (ApplicationWindow *parent=0, int layers=1, int rows=1, int cols=1, const QString &label="", const char *name=0, Qt::WFlags f=0)
int numLayers ()
void plotProfiles (Matrix *m)
void printCropmarks (bool on)
bool printCropmarksEnabled ()
bool scaleLayersOnPrint ()
bool scaleLayersOnResize ()
void setAlignPolicy (const AlignPolicy &policy)
void setCommonLayerAxes (bool verticalAxis=true, bool horizontalAxis=true)
void setEqualSizedLayers ()
void setNumLayers (int n)
void setScaleLayersOnPrint (bool on)
void setScaleLayersOnResize (bool ok)
void setSizePolicy (const SizePolicy &policy)
void setWaterfallLayout (bool on=true)
void setWaterfallOffset (int x, int y, bool update=false)
bool sideLinesEnabled ()
SizePolicy sizePolicy ()
virtual QString sizeToString ()
 Size of the widget as a string.
QList< Graph * > stackOrderedLayersList ()
QHBoxLayout * toolBox ()
int waterfallXOffset ()
int waterfallYOffset ()
 ~MultiLayer ()

Private Member Functions

LayerButtonaddLayerButton ()
Event Handlers

void dropEvent (QDropEvent *)
void dragEnterEvent (QDragEnterEvent *)
void wheelEvent (QWheelEvent *)
void keyPressEvent (QKeyEvent *)
bool eventFilter (QObject *object, QEvent *)
 Filters other object's events (customizes title bar's context menu).
void releaseLayer ()
void resizeLayers (QResizeEvent *)

Private Attributes

Graphactive_graph
int bottom_margin
QList< LayerButton * > buttonsList
int colsSpace
QPushButton * d_add_layer_btn
AlignPolicy d_align_policy
QWidget * d_canvas
QSize d_canvas_size
int d_cols
 Used for resizing of layers.
bool d_is_waterfall_plot
QPointer< SelectionMoveResizerd_layers_selector
bool d_link_x_axes
bool d_print_cropmarks
QPushButton * d_remove_layer_btn
int d_rows
bool d_scale_layers
 Flag telling if layers should be rescaled on the plot window is resized by the user.
bool d_scale_on_print
bool d_side_lines
 Flag telling if we need to draw side lines for curves in a waterfall plot.
SizePolicy d_size_policy
QColor d_waterfall_fill_color
int d_waterfall_offset_x
int d_waterfall_offset_y
int graph_height
int graph_width
QList< Graph * > graphsList
int hor_align
int l_canvas_height
int l_canvas_width
QHBoxLayout * layerButtonsBox
int left_margin
int right_margin
int rowsSpace
QHBoxLayout * toolbuttonsBox
int top_margin
int vert_align
QHBoxLayout * waterfallBox

Detailed Description

An MDI window (MdiSubWindow) managing one or more Graph objects.

Note that several parts of the code, as well as the user interface, refer to MultiLayer as "graph" or "plot", practically guaranteeing confusion with the classes Graph and Plot.

Future Plans

Manage any QWidget instead of only Graph. This would allow 3D graphs to be added as well, so you could produce mixed 2D/3D arrangements. It would also allow text labels to be added directly instead of having to complicate things by wrapping them up in a Graph (see documentation of ImageMarker for details) (see documentation of ImageMarker for details).

The main problem to be figured out for this is how Graph would interface with the rest of the project. A possible solution is outlined in the documentation of ApplicationWindow: If MultiLayer exposes its parent Project to the widgets it manages, they could handle things like creating tables by calling methods of Project instead of sending signals.


Member Enumeration Documentation

Enumerator:
AlignLayers 
AlignCanvases 
Enumerator:
HCenter 
Left 
Right 
Enumerator:
Expanding 
UserSize 
Enumerator:
VCenter 
Top 
Bottom 

Constructor & Destructor Documentation

MultiLayer::MultiLayer ( ApplicationWindow parent = 0,
int  layers = 1,
int  rows = 1,
int  cols = 1,
const QString &  label = "",
const char *  name = 0,
Qt::WFlags  f = 0 
)
MultiLayer::~MultiLayer (  ) 

References d_layers_selector, and graphsList.


Member Function Documentation

void MultiLayer::activateGraph ( LayerButton button  )  [slot]
Graph* MultiLayer::activeLayer (  )  [inline, slot]

References active_graph.

Referenced by FunctionDialog::acceptFunction(), FunctionDialog::acceptParametric(), FunctionDialog::acceptPolar(), ApplicationWindow::addEllipse(), ApplicationWindow::addErrorBars(), ApplicationWindow::addFunctionCurve(), ApplicationWindow::addImage(), ApplicationWindow::addInsetLayer(), ApplicationWindow::addRectangle(), ApplicationWindow::addTexFormula(), ApplicationWindow::addText(), ApplicationWindow::addTimeStamp(), ApplicationWindow::analysis(), ApplicationWindow::baselineDialog(), LineProfileTool::calculateLineProfile(), ApplicationWindow::copyActiveLayer(), ApplicationWindow::copyMarker(), ApplicationWindow::copySelection(), Filter::createOutputGraph(), ApplicationWindow::custom2DPlotTools(), ApplicationWindow::cutSelection(), ApplicationWindow::defineErrorBars(), ApplicationWindow::drawArrow(), ApplicationWindow::drawLine(), ApplicationWindow::dropEvent(), ApplicationWindow::extractLayers(), ApplicationWindow::fitLinear(), ApplicationWindow::fitMultiPeak(), ApplicationWindow::fitSlope(), ApplicationWindow::hideCurve(), ApplicationWindow::hideOtherCurves(), ApplicationWindow::intensityTable(), ApplicationWindow::loadImage(), ApplicationWindow::movePoints(), ApplicationWindow::multilayerPlot(), ApplicationWindow::newFunctionPlot(), ApplicationWindow::newGraph(), ApplicationWindow::newLegend(), ApplicationWindow::pasteSelection(), ApplicationWindow::pixelLineProfile(), PlotWizard::plot2D(), ApplicationWindow::plotDoubleYAxis(), ApplicationWindow::plotHistogram(), ApplicationWindow::plotImage(), ApplicationWindow::plotSpectrogram(), ApplicationWindow::raiseActiveEnrichment(), ApplicationWindow::removeCurve(), ApplicationWindow::removePoints(), ApplicationWindow::removeWindowFromLists(), ApplicationWindow::setAutoScale(), ApplicationWindow::setBoldFont(), ApplicationWindow::setCurveFullRange(), ApplicationWindow::setFontFamily(), ApplicationWindow::setFontSize(), ApplicationWindow::setItalicFont(), PlotDialog::setMultiLayer(), ApplicationWindow::showAllCurves(), ApplicationWindow::showCursor(), ApplicationWindow::showCurveContextMenu(), ApplicationWindow::showCurveRangeDialog(), ApplicationWindow::showCurveWorksheet(), ApplicationWindow::showDataSetDialog(), ApplicationWindow::showEnrichementDialog(), ApplicationWindow::showExpDecayDialog(), ApplicationWindow::showFilterDialog(), ApplicationWindow::showFitDialog(), ApplicationWindow::showFitPolynomDialog(), ApplicationWindow::showGraphContextMenu(), ApplicationWindow::showIntegrationDialog(), ApplicationWindow::showInterpolationDialog(), ApplicationWindow::showLineDialog(), ApplicationWindow::showMarkerPopupMenu(), ApplicationWindow::showMatrixValuesDialog(), ApplicationWindow::showPlotDialog(), ApplicationWindow::showRangeSelectors(), ApplicationWindow::showSmoothDialog(), ApplicationWindow::subtractReferenceData(), ApplicationWindow::subtractStraightLine(), ApplicationWindow::translateCurve(), ApplicationWindow::zoomIn(), ApplicationWindow::zoomOut(), and ApplicationWindow::zoomRectanglePlot().

LayerButton * MultiLayer::addLayerButton (  )  [private]
void MultiLayer::adjustSize (  )  [slot]

References LayerButton::btnSize(), and d_canvas.

AlignPolicy MultiLayer::alignPolicy (  )  [inline]

References d_align_policy.

Referenced by copy(), and LayerDialog::setMultiLayer().

int MultiLayer::bottomMargin (  )  [inline, slot]

References bottom_margin.

Referenced by copy(), and LayerDialog::setMultiLayer().

QRect MultiLayer::canvasChildrenRect (  ) 
QPixmap MultiLayer::canvasPixmap ( const QSize &  size = QSize(),
double  scaleFontsFactor = 1.0,
bool  transparent = false 
) [slot]
QRect MultiLayer::canvasRect (  )  [inline]
void MultiLayer::changeWaterfallXOffset ( int  offset  )  [slot]
void MultiLayer::changeWaterfallYOffset ( int  offset  )  [slot]
int MultiLayer::colsSpacing (  )  [inline, slot]

References colsSpace.

Referenced by copy(), and LayerDialog::setMultiLayer().

void MultiLayer::confirmRemoveLayer (  )  [slot]
void MultiLayer::copyAllLayers (  )  [slot]
void MultiLayer::currentFontChanged ( const QFont &   )  [signal]

Referenced by connectLayer().

void MultiLayer::cursorInfo ( const QString &   )  [signal]

Referenced by connectLayer().

void MultiLayer::dragEnterEvent ( QDragEnterEvent *  e  )  [private]

References Graph::multiLayer().

void MultiLayer::draw ( QPaintDevice *  device,
const QSizeF &  customSize,
int  unit,
int  res,
double  fontsFactor = 1.0 
) [slot]
void MultiLayer::drawLineEnded ( bool   )  [signal]

Referenced by connectLayer().

void MultiLayer::dropEvent ( QDropEvent *  event  )  [private]
bool MultiLayer::eventFilter ( QObject *  object,
QEvent *  e 
) [private]

Filters other object's events (customizes title bar's context menu).

Reimplemented from MdiSubWindow.

References active_graph, d_canvas, d_canvas_size, d_is_waterfall_plot, d_layers_selector, Graph::deselect(), graphsList, Graph::hasSeletedItems(), modifiedPlot(), resizeLayers(), and setActiveLayer().

void MultiLayer::exportImage ( QTextDocument *  document,
int  quality = 100,
bool  transparent = false,
int  dpi = 0,
const QSizeF &  customSize = QSizeF (),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
) [slot]
void MultiLayer::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 MultiLayer::exportPDF ( const QString &  fname  )  [virtual, slot]

Reimplemented from MdiSubWindow.

References exportVector().

Referenced by ApplicationWindow::exportPDF().

void MultiLayer::exportSVG ( const QString &  fname,
const QSizeF &  customSize = QSizeF(),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
) [slot]
void MultiLayer::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 MultiLayer::exportToFile ( const QString &  fileName  )  [slot]
void MultiLayer::exportVector ( const QString &  fileName,
int  res = 0,
bool  color = true,
const QSizeF &  customSize = QSizeF (),
int  unit = FrameWidget::Pixel,
double  fontsFactor = 1.0 
) [slot]
void MultiLayer::findBestLayout ( int &  rows,
int &  cols 
) [slot]

References graphsList.

Referenced by arrangeLayers().

int MultiLayer::getCols (  )  [inline, slot]
int MultiLayer::getRows (  )  [inline, slot]
bool MultiLayer::hasLinkedXLayerAxes (  )  [inline]
bool MultiLayer::hasSelectedLayers (  )  [slot]
int MultiLayer::horizontalAlignement (  )  [inline, slot]

References hor_align.

Referenced by copy(), and LayerDialog::setMultiLayer().

bool MultiLayer::isWaterfallPlot (  )  [inline]
void MultiLayer::keyPressEvent ( QKeyEvent *  e  )  [private]
Graph * MultiLayer::layerAt ( const QPoint &  pos  )  [slot]

Returns the layer at the given position; returns 0 if there is no such layer.

References graphsList.

Referenced by ApplicationWindow::dropEvent().

QSize MultiLayer::layerCanvasSize (  )  [inline, slot]
int MultiLayer::layerIndex ( Graph g  )  [inline]
int MultiLayer::leftMargin (  )  [inline, slot]

References left_margin.

Referenced by copy(), and LayerDialog::setMultiLayer().

void MultiLayer::modifiedPlot (  )  [signal]
void MultiLayer::pasteMarker (  )  [signal]
void MultiLayer::print (  )  [virtual, slot]
void MultiLayer::print ( QPrinter *  printer  )  [virtual, slot]

Reimplemented from MdiSubWindow.

References printAllLayers().

void MultiLayer::printActiveLayer (  )  [slot]

References active_graph, and Graph::print().

void MultiLayer::printAllLayers ( QPainter *  painter  )  [slot]
void MultiLayer::printCropmarks ( bool  on  )  [inline]
bool MultiLayer::printCropmarksEnabled (  )  [inline]

References d_print_cropmarks.

Referenced by copy(), and PlotDialog::setMultiLayer().

void MultiLayer::releaseLayer (  )  [private]
bool MultiLayer::removeActiveLayer (  )  [slot]

References active_graph, and removeLayer().

int MultiLayer::rightMargin (  )  [inline, slot]

References right_margin.

Referenced by copy(), and LayerDialog::setMultiLayer().

int MultiLayer::rowsSpacing (  )  [inline, slot]

References rowsSpace.

Referenced by copy(), and LayerDialog::setMultiLayer().

bool MultiLayer::scaleLayersOnPrint (  )  [inline]

References d_scale_on_print.

Referenced by copy(), and PlotDialog::setMultiLayer().

bool MultiLayer::scaleLayersOnResize (  )  [inline]
void MultiLayer::setActiveLayer ( Graph g  )  [slot]
void MultiLayer::setAlignement ( int  ha,
int  va 
) [slot]
void MultiLayer::setCols ( int  c  )  [slot]
void MultiLayer::setCommonLayerAxes ( bool  verticalAxis = true,
bool  horizontalAxis = true 
)
void MultiLayer::setFonts ( const QFont &  titleFnt,
const QFont &  scaleFnt,
const QFont &  numbersFnt,
const QFont &  legendFnt 
) [slot]
void MultiLayer::setGraphGeometry ( int  x,
int  y,
int  w,
int  h 
) [slot]

References active_graph, and modifiedPlot().

void MultiLayer::setPointerCursor (  )  [signal]

Referenced by removeLayer(), and setNumLayers().

void MultiLayer::setRows ( int  r  )  [slot]
void MultiLayer::setScaleLayersOnPrint ( bool  on  )  [inline]
void MultiLayer::setScaleLayersOnResize ( bool  ok  )  [inline]
void MultiLayer::setSizePolicy ( const SizePolicy policy  )  [inline]

References d_size_policy.

void MultiLayer::setWaterfallFillColor ( const QColor &  c  )  [slot]
void MultiLayer::setWaterfallLayout ( bool  on = true  ) 
void MultiLayer::setWaterfallOffset ( int  x,
int  y,
bool  update = false 
)
void MultiLayer::showCurvesDialog (  )  [signal]

Referenced by addLayerButton().

void MultiLayer::showEnrichementDialog (  )  [signal]
void MultiLayer::showLineDialog (  )  [signal]

Referenced by connectLayer().

void MultiLayer::showMarkerPopupMenu (  )  [signal]

Referenced by connectLayer().

void MultiLayer::showWaterfallOffsetDialog (  )  [slot]
bool MultiLayer::sideLinesEnabled (  )  [inline]

References d_side_lines.

Referenced by copy().

SizePolicy MultiLayer::sizePolicy (  )  [inline]

References d_size_policy.

Referenced by copy(), and LayerDialog::setMultiLayer().

QString MultiLayer::sizeToString (  )  [virtual]

Size of the widget as a string.

Reimplemented from MdiSubWindow.

References Graph::curvesList(), graphsList, Spectrogram::matrix(), Matrix::numCols(), and Matrix::numRows().

QList< Graph * > MultiLayer::stackOrderedLayersList (  ) 

this list is sorted according to the stack order

References d_canvas.

Referenced by canvasPixmap(), copy(), draw(), exportVector(), setWaterfallFillColor(), setWaterfallSideLines(), and updateWaterfallFill().

bool MultiLayer::swapLayers ( int  src,
int  dest 
) [slot]

References graphsList, layer(), and modifiedPlot().

Referenced by LayerDialog::swapLayers().

QHBoxLayout* MultiLayer::toolBox (  )  [inline]
int MultiLayer::topMargin (  )  [inline, slot]

References top_margin.

Referenced by copy(), and LayerDialog::setMultiLayer().

void MultiLayer::updateLayersLayout ( Graph g  )  [slot]
void MultiLayer::updateWaterfallFill ( bool  on  )  [slot]
void MultiLayer::updateWaterfallScales ( Graph g,
int  axis 
) [slot]

References graphsList.

Referenced by createWaterfallBox().

int MultiLayer::verticalAlignement (  )  [inline, slot]

References vert_align.

Referenced by copy(), and LayerDialog::setMultiLayer().

int MultiLayer::waterfallXOffset (  )  [inline]

References d_waterfall_offset_x.

Referenced by copy().

int MultiLayer::waterfallYOffset (  )  [inline]

References d_waterfall_offset_y.

Referenced by copy().

void MultiLayer::wheelEvent ( QWheelEvent *  e  )  [private]

References graphsList, and modifiedPlot().


Member Data Documentation

QPushButton* MultiLayer::d_add_layer_btn [private]

Referenced by createWaterfallBox(), and MultiLayer().

QSize MultiLayer::d_canvas_size [private]

Referenced by eventFilter(), and resizeLayers().

int MultiLayer::d_cols [private]

Used for resizing of layers.

Referenced by addLayer(), arrangeLayers(), getCols(), save(), setCols(), setCommonLayerAxes(), and setEqualSizedLayers().

QPushButton * MultiLayer::d_remove_layer_btn [private]

Referenced by createWaterfallBox(), and MultiLayer().

Flag telling if layers should be rescaled on the plot window is resized by the user.

Referenced by arrangeLayers(), copy(), resizeLayers(), scaleLayersOnResize(), and setScaleLayersOnResize().

bool MultiLayer::d_side_lines [private]

Flag telling if we need to draw side lines for curves in a waterfall plot.

Referenced by save(), setWaterfallSideLines(), showWaterfallFillDialog(), sideLinesEnabled(), and updateWaterfallFill().

int MultiLayer::graph_height [private]

Referenced by MultiLayer().

int MultiLayer::graph_width [private]

Referenced by MultiLayer().

QHBoxLayout* MultiLayer::layerButtonsBox [private]

Referenced by addLayerButton(), and MultiLayer().

QHBoxLayout * MultiLayer::toolbuttonsBox [private]

Referenced by MultiLayer(), and toolBox().


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