MultiLayer Class Reference

#include <MultiLayer.h>

Inheritance diagram for MultiLayer:

MdiSubWindow

List of all members.


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.

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 ()
int horizontalAlignement ()
bool isEmpty ()
QSize layerCanvasSize ()
int leftMargin ()
void removeLayer ()
int rightMargin ()
int rowsSpacing ()
QString saveAsTemplate (const QString &geometryInfo)
QString saveToString (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, bool keepAspect=true, QPrinter::PageSize pageSize=QPrinter::Custom)
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 drawTextOff ()
void enableTextEditor (Graph *)
void modifiedPlot ()
void pasteMarker ()
void setPointerCursor ()
void showAxisDialog (int)
void showAxisTitleDialog ()
void showCurveContextMenu (QwtPlotCurve *)
void showCurvesDialog ()
void showGraphContextMenu ()
void showImageDialog ()
void showLineDialog ()
void showMarkerPopupMenu ()
void showPlotDialog (int)
void showScaleDialog (int)
void showTextDialog ()
void viewTitleDialog ()

Public Member Functions

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)

Private Member Functions

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

Private Attributes

Graphactive_graph
int bottom_margin
QList< LayerButton * > buttonsList
QWidget * canvas
int colsSpace
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


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 
)


Member Function Documentation

void MultiLayer::activateGraph ( LayerButton button  )  [slot]

References active_graph, buttonsList, and graphsList.

Referenced by addLayerButton().

Graph* MultiLayer::activeLayer (  )  [inline, slot]

References active_graph.

Referenced by FunctionDialog::acceptFunction(), FunctionDialog::acceptParametric(), FunctionDialog::acceptPolar(), ApplicationWindow::addErrorBars(), ApplicationWindow::addFunctionCurve(), ApplicationWindow::addImage(), Filter::addResultCurve(), Correlation::addResultCurve(), Convolution::addResultCurve(), ApplicationWindow::addText(), ApplicationWindow::addTimeStamp(), ApplicationWindow::analysis(), LineProfileTool::calculateLineProfile(), ApplicationWindow::copyActiveLayer(), ApplicationWindow::copyMarker(), ApplicationWindow::copySelection(), Filter::createOutputGraph(), ApplicationWindow::cutSelection(), ApplicationWindow::defineErrorBars(), ApplicationWindow::drawArrow(), ApplicationWindow::drawLine(), Filter::enableGraphicsDisplay(), 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::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::showExpDecayDialog(), ApplicationWindow::showFilterDialog(), ApplicationWindow::showFitDialog(), ApplicationWindow::showFitPolynomDialog(), ApplicationWindow::showFunctionDialog(), ApplicationWindow::showGraphContextMenu(), ApplicationWindow::showImageDialog(), ApplicationWindow::showIntegrationDialog(), ApplicationWindow::showInterpolationDialog(), ApplicationWindow::showLineDialog(), ApplicationWindow::showMarkerPopupMenu(), ApplicationWindow::showPlotDialog(), Fit::showPredictionLimits(), ApplicationWindow::showRangeSelectors(), Fit::showResiduals(), ApplicationWindow::showSmoothDialog(), ApplicationWindow::showTextDialog(), ApplicationWindow::translateCurveHor(), ApplicationWindow::translateCurveVert(), ApplicationWindow::zoomIn(), and ApplicationWindow::zoomOut().

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

QPixmap MultiLayer::canvasPixmap (  )  [slot]

References 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::drawTextOff (  )  [signal]

Referenced by connectLayer().

void MultiLayer::enableTextEditor ( Graph  )  [signal]

Referenced by connectLayer().

bool MultiLayer::eventFilter ( QObject *  object,
QEvent *  e 
) [private]

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,
bool  keepAspect = true,
QPrinter::PageSize  pageSize = QPrinter::Custom 
) [slot]

void MultiLayer::findBestLayout ( int &  rows,
int &  cols 
) [slot]

References graphsList.

Referenced by arrangeLayers().

bool MultiLayer::focusNextPrevChild ( bool  next  )  [private]

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

int MultiLayer::getRows (  )  [inline, 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  ) 

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]

void MultiLayer::removeLayer (  )  [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().

QString MultiLayer::saveAsTemplate ( const QString &  geometryInfo  )  [virtual, slot]

Reimplemented from MdiSubWindow.

References saveToString().

QString MultiLayer::saveToString ( 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]

References d_cols.

Referenced by LayerDialog::update().

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]

References d_rows.

Referenced by LayerDialog::update().

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::showGraphContextMenu (  )  [signal]

Referenced by connectLayer().

void MultiLayer::showImageDialog (  )  [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().

void MultiLayer::showTextDialog (  )  [signal]

Referenced by connectLayer().

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

QWidget* MultiLayer::canvas [private]

int MultiLayer::colsSpace [private]

int MultiLayer::d_cols [private]

Used for resizing of layers.

Referenced by addLayer(), arrangeLayers(), getCols(), saveToString(), 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 Sun Jun 15 21:32:24 2008 for QtiPlot by  doxygen 1.5.6