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  HorAlignement { HCenter, Left, Right }
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)
void adjustSize ()
void arrangeLayers (bool fit, bool userSize)
QSize arrangeLayers (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 ()
int verticalAlignement ()
Print and Export



QPixmap canvasPixmap ()
void copyAllLayers ()
void exportImage (const QString &fileName, int quality=100, bool transparent=false)
void exportPDF (const QString &fname)
void exportSVG (const QString &fname)
void exportToFile (const QString &fileName)
void exportVector (const QString &fileName, int res=0, bool color=true)
void print ()
void printActiveLayer ()
void printAllLayers (QPainter *painter)

Signals

void createTable (const QString &, int, int, const QString &)
void currentFontChanged (const QFont &)
void cursorInfo (const QString &)
void drawLineEnded (bool)
void enableTextEditor (Graph *)
void modifiedPlot ()
void pasteMarker ()
void setPointerCursor ()
void showAxisDialog (int)
void showAxisTitleDialog ()
void showCurveContextMenu (QwtPlotCurve *)
void showCurvesDialog ()
void showEnrichementDialog ()
void showGraphContextMenu ()
void showLineDialog ()
void showMarkerPopupMenu ()
void showPlotDialog (int)
void showScaleDialog (int)
void viewTitleDialog ()

Public Member Functions

QWidget * canvas ()
QRect canvasChildrenRect ()
QRect canvasRect ()
void copy (MultiLayer *ml)
Graphlayer (int num)
int layerIndex (Graph *g)
QList< Graph * > layersList ()
 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 printCropmarks (bool on)
bool printCropmarksEnabled ()
bool scaleLayersOnPrint ()
bool scaleLayersOnResize ()
void setNumLayers (int n)
void setScaleLayersOnPrint (bool on)
void setScaleLayersOnResize (bool ok)
virtual QString sizeToString ()
 Size of the widget as a string.
 ~MultiLayer ()

Private Member Functions

LayerButtonaddLayerButton ()
Event Handlers



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

Private Attributes

Graphactive_graph
int bottom_margin
QList< LayerButton * > buttonsList
int colsSpace
QWidget * d_canvas
int d_cols
 Used for resizing of layers.
QPointer< SelectionMoveResizerd_layers_selector
bool d_print_cropmarks
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
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
int top_margin
int vert_align

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:
HCenter 
Left 
Right 
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::addErrorBars(), ApplicationWindow::addFunctionCurve(), ApplicationWindow::addImage(), ApplicationWindow::addInsetLayer(), ApplicationWindow::addRectangle(), Filter::addResultCurve(), Correlation::addResultCurve(), Convolution::addResultCurve(), ApplicationWindow::addTexFormula(), ApplicationWindow::addText(), ApplicationWindow::addTimeStamp(), ApplicationWindow::analysis(), LineProfileTool::calculateLineProfile(), ApplicationWindow::copyActiveLayer(), ApplicationWindow::copyMarker(), ApplicationWindow::copySelection(), Filter::createOutputGraph(), ApplicationWindow::cutSelection(), ApplicationWindow::defineErrorBars(), ApplicationWindow::drawArrow(), ApplicationWindow::drawLine(), ApplicationWindow::dropEvent(), Filter::enableGraphicsDisplay(), ApplicationWindow::extractLayers(), ApplicationWindow::fitLinear(), ApplicationWindow::fitMultiPeak(), MultiPeakFit::generateFitCurve(), Fit::generateFitCurve(), ApplicationWindow::hideCurve(), ApplicationWindow::hideOtherCurves(), ApplicationWindow::intensityTable(), ApplicationWindow::loadImage(), ApplicationWindow::movePoints(), ApplicationWindow::multilayerPlot(), ApplicationWindow::newFunctionPlot(), ApplicationWindow::newGraph(), ApplicationWindow::newLegend(), FFT::output(), Differentiation::output(), ApplicationWindow::pasteSelection(), ApplicationWindow::pixelLineProfile(), ApplicationWindow::plotDoubleYAxis(), ApplicationWindow::plotHistogram(), ApplicationWindow::plotImage(), ApplicationWindow::plotSpectrogram(), ApplicationWindow::removeCurve(), ApplicationWindow::removePoints(), ApplicationWindow::removeWindowFromLists(), ApplicationWindow::setAutoScale(), ApplicationWindow::setBoldFont(), ApplicationWindow::setCurveFullRange(), ApplicationWindow::setFontFamily(), ApplicationWindow::setFontSize(), ApplicationWindow::setItalicFont(), PlotDialog::setMultiLayer(), ApplicationWindow::showAllCurves(), Fit::showConfidenceLimits(), ApplicationWindow::showCursor(), ApplicationWindow::showCurveContextMenu(), ApplicationWindow::showCurveRangeDialog(), ApplicationWindow::showCurveWorksheet(), ApplicationWindow::showDataSetDialog(), ApplicationWindow::showEnrichementDialog(), ApplicationWindow::showExpDecayDialog(), ApplicationWindow::showFilterDialog(), ApplicationWindow::showFitDialog(), ApplicationWindow::showFitPolynomDialog(), ApplicationWindow::showFunctionDialog(), ApplicationWindow::showGraphContextMenu(), ApplicationWindow::showIntegrationDialog(), ApplicationWindow::showInterpolationDialog(), ApplicationWindow::showLineDialog(), ApplicationWindow::showMarkerPopupMenu(), ApplicationWindow::showPlotDialog(), Fit::showPredictionLimits(), ApplicationWindow::showRangeSelectors(), Fit::showResiduals(), ApplicationWindow::showSmoothDialog(), ApplicationWindow::translateCurve(), ApplicationWindow::zoomIn(), ApplicationWindow::zoomOut(), and ApplicationWindow::zoomRectanglePlot().

Graph * MultiLayer::addLayer ( int  x = 0,
int  y = 0,
int  width = 0,
int  height = 0 
) [slot]
LayerButton * MultiLayer::addLayerButton (  )  [private]
void MultiLayer::adjustSize (  )  [slot]

References LayerButton::btnSize(), and d_canvas.

void MultiLayer::arrangeLayers ( bool  fit,
bool  userSize 
) [slot]
QSize MultiLayer::arrangeLayers ( bool  userSize  )  [slot]
int MultiLayer::bottomMargin (  )  [inline, slot]

References bottom_margin.

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

QWidget* MultiLayer::canvas (  )  [inline]
QRect MultiLayer::canvasChildrenRect (  ) 

References Graph::boundingRect(), and graphsList.

Referenced by resizeLayers().

QPixmap MultiLayer::canvasPixmap (  )  [slot]

References d_canvas, graphsList, and Graph::print().

Referenced by copyAllLayers(), and exportImage().

QRect MultiLayer::canvasRect (  )  [inline]
int MultiLayer::colsSpacing (  )  [inline, slot]

References colsSpace.

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

void MultiLayer::confirmRemoveLayer (  )  [slot]
void MultiLayer::connectLayer ( Graph g  )  [slot]
void MultiLayer::copy ( MultiLayer ml  ) 
void MultiLayer::copyAllLayers (  )  [slot]
void MultiLayer::createTable ( const QString &  ,
int  ,
int  ,
const QString &   
) [signal]

Referenced by connectLayer().

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

Referenced by connectLayer().

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

Referenced by connectLayer().

void MultiLayer::drawLineEnded ( bool   )  [signal]

Referenced by connectLayer().

void MultiLayer::enableTextEditor ( Graph  )  [signal]

Referenced by connectLayer().

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_layers_selector, graphsList, Graph::hasSeletedItems(), modifiedPlot(), resizeLayers(), and setActiveLayer().

void MultiLayer::exportImage ( const QString &  fileName,
int  quality = 100,
bool  transparent = false 
) [slot]
void MultiLayer::exportPDF ( const QString &  fname  )  [virtual, slot]

Reimplemented from MdiSubWindow.

References exportVector().

void MultiLayer::exportSVG ( const QString &  fname  )  [slot]
void MultiLayer::exportToFile ( const QString &  fileName  )  [slot]
void MultiLayer::exportVector ( const QString &  fileName,
int  res = 0,
bool  color = true 
) [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::hasSelectedLayers (  )  [slot]
int MultiLayer::horizontalAlignement (  )  [inline, slot]

References hor_align.

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

bool MultiLayer::isEmpty (  )  [slot]
void MultiLayer::keyPressEvent ( QKeyEvent *  e  )  [private]
Graph * MultiLayer::layer ( int  num  ) 
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]

References graphsList.

Referenced by PlotDialog::removeSelectedCurve().

QList<Graph *> MultiLayer::layersList (  )  [inline]
int MultiLayer::leftMargin (  )  [inline, slot]

References left_margin.

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

void MultiLayer::modifiedPlot (  )  [signal]
int MultiLayer::numLayers (  )  [inline]
void MultiLayer::pasteMarker (  )  [signal]
void MultiLayer::print (  )  [virtual, slot]
void MultiLayer::printActiveLayer (  )  [slot]
void MultiLayer::printAllLayers ( QPainter *  painter  )  [slot]
void MultiLayer::printCropmarks ( bool  on  )  [inline]
bool MultiLayer::printCropmarksEnabled (  )  [inline]

References d_print_cropmarks.

Referenced by PlotDialog::setMultiLayer().

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

References active_graph, and removeLayer().

bool MultiLayer::removeLayer ( Graph g  )  [slot]
void MultiLayer::resizeLayers ( QResizeEvent *  re  )  [private]
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().

void MultiLayer::save ( const QString &  fn,
const QString &  geometry,
bool  saveAsTemplate = false 
) [virtual, slot]
bool MultiLayer::scaleLayersOnPrint (  )  [inline]

References d_scale_on_print.

Referenced by PlotDialog::setMultiLayer().

bool MultiLayer::scaleLayersOnResize (  )  [inline]

References d_scale_layers.

void MultiLayer::setActiveLayer ( Graph g  )  [slot]
void MultiLayer::setAlignement ( int  ha,
int  va 
) [slot]
void MultiLayer::setCols ( int  c  )  [slot]
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]
void MultiLayer::setLayerCanvasSize ( int  w,
int  h 
) [slot]
void MultiLayer::setMargins ( int  lm,
int  rm,
int  tm,
int  bm 
) [slot]
void MultiLayer::setNumLayers ( int  n  ) 
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]

References d_scale_layers.

void MultiLayer::setSpacing ( int  rgap,
int  cgap 
) [slot]
void MultiLayer::showAxisDialog ( int   )  [signal]

Referenced by connectLayer().

void MultiLayer::showAxisTitleDialog (  )  [signal]

Referenced by connectLayer().

void MultiLayer::showCurveContextMenu ( QwtPlotCurve *   )  [signal]

Referenced by connectLayer().

void MultiLayer::showCurvesDialog (  )  [signal]

Referenced by addLayerButton().

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

Referenced by connectLayer().

void MultiLayer::showLineDialog (  )  [signal]

Referenced by connectLayer().

void MultiLayer::showMarkerPopupMenu (  )  [signal]

Referenced by connectLayer().

void MultiLayer::showPlotDialog ( int   )  [signal]

Referenced by connectLayer().

void MultiLayer::showScaleDialog ( int   )  [signal]

Referenced by connectLayer().

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().

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

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

Referenced by LayerDialog::swapLayers().

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

References top_margin.

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

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

References vert_align.

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

void MultiLayer::viewTitleDialog (  )  [signal]

Referenced by connectLayer().

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

References graphsList, and modifiedPlot().


Member Data Documentation

int MultiLayer::colsSpace [private]
QWidget* MultiLayer::d_canvas [private]
int MultiLayer::d_cols [private]

Used for resizing of layers.

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

int MultiLayer::d_rows [private]

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

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

int MultiLayer::graph_height [private]

Referenced by MultiLayer().

int MultiLayer::graph_width [private]

Referenced by MultiLayer().

QList<Graph *> MultiLayer::graphsList [private]
int MultiLayer::hor_align [private]
QHBoxLayout* MultiLayer::layerButtonsBox [private]

Referenced by addLayerButton(), and MultiLayer().

int MultiLayer::left_margin [private]
int MultiLayer::right_margin [private]
int MultiLayer::rowsSpace [private]
int MultiLayer::top_margin [private]
int MultiLayer::vert_align [private]

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

Generated on Tue Nov 3 10:48:56 2009 for QtiPlot by  doxygen 1.6.1