#include <MultiLayer.h>
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.
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) |
Graph * | activeGraph () |
Graph * | addLayer (int x=0, int y=0, int width=0, int height=0) |
void | addTextLayer (const QPoint &pos) |
Finish adding a text layer. | |
void | addTextLayer (int f, const QFont &font, const QColor &textCol, const QColor &backgroundCol) |
Start adding a text layer. | |
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 | layers () |
int | leftMargin () |
void | removeLayer () |
int | rightMargin () |
int | rowsSpacing () |
QString | saveAsTemplate (const QString &geometryInfo) |
QString | saveToString (const QString &geometry) |
void | setActiveGraph (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 | setLayersNumber (int n) |
void | setMargins (int lm, int rm, int tm, int bm) |
void | setRows (int r) |
void | setSpacing (int rgap, int cgap) |
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 | createIntensityTable (const QString &) |
void | createTable (const QString &, int, int, const QString &) |
void | cursorInfo (const QString &) |
void | drawLineEnded (bool) |
void | drawTextOff () |
void | modifiedPlot () |
void | pasteMarker () |
void | setPointerCursor () |
void | showAxisDialog (int) |
void | showCurveContextMenu (int) |
void | showCurvesDialog () |
void | showGeometryDialog () |
void | showGraphContextMenu () |
void | showImageDialog () |
void | showLineDialog () |
void | showMarkerPopupMenu () |
void | showPlotDialog (int) |
void | showRightAxisTitleDialog () |
void | showScaleDialog (int) |
void | showTextDialog () |
void | showTopAxisTitleDialog () |
void | showWindowContextMenu () |
void | showXAxisTitleDialog () |
void | showYAxisTitleDialog () |
void | viewTitleDialog () |
Public Member Functions | |
LayerButton * | addLayerButton () |
void | copy (MultiLayer *ml) |
QWidgetList | graphPtrs () |
Graph * | layer (int num) |
MultiLayer (const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0) | |
void | printCropmarks (bool on) |
bool | printCropmarksEnabled () |
bool | scaleLayersOnPrint () |
void | setHidden () |
Notifies that a window was hidden by a direct user action. | |
void | setOpenMaximized () |
void | setScaleLayersOnPrint (bool on) |
Event Handlers | |
void | changeEvent (QEvent *) |
Catches parent changes (in order to gain access to the title bar). | |
void | contextMenuEvent (QContextMenuEvent *) |
bool | eventFilter (QObject *object, QEvent *) |
Filters other object's events (customizes title bar's context menu). | |
bool | focusNextPrevChild (bool next) |
void | keyPressEvent (QKeyEvent *) |
void | mousePressEvent (QMouseEvent *) |
void | releaseLayer () |
void | wheelEvent (QWheelEvent *) |
Private Member Functions | |
void | resizeLayers (const QSize &size, const QSize &oldSize, bool scaleFonts) |
void | resizeLayers (const QResizeEvent *re) |
Private Attributes | |
Graph * | active_graph |
bool | addTextOn |
int | bottom_margin |
QWidgetList | buttonsList |
QWidget * | canvas |
int | cols |
int | colsSpace |
QPointer < SelectionMoveResizer > | d_layers_selector |
QSize | d_max_size |
Stores the size of the widget in the Qt::WindowMaximized state. | |
QSize | d_normal_size |
Stores the size of the widget in Qt::WindowNoState (normal state). | |
int | d_open_maximized |
bool | d_print_cropmarks |
bool | d_scale_on_print |
QColor | defaultTextMarkerBackground |
QColor | defaultTextMarkerColor |
QFont | defaultTextMarkerFont |
int | defaultTextMarkerFrame |
Used when adding text markers on new layers. | |
int | graph_height |
int | graph_width |
int | graphs |
Used for resizing of layers. | |
QWidgetList | graphsList |
int | hor_align |
int | l_canvas_height |
int | l_canvas_width |
QHBoxLayout * | layerButtonsBox |
int | left_margin |
int | right_margin |
int | rows |
int | rowsSpace |
int | top_margin |
int | vert_align |
MultiLayer::MultiLayer | ( | const QString & | label, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 , |
|||
Qt::WFlags | f = 0 | |||
) |
void MultiLayer::activateGraph | ( | LayerButton * | button | ) | [slot] |
Graph* MultiLayer::activeGraph | ( | ) | [inline, slot] |
Graph * MultiLayer::addLayer | ( | int | x = 0 , |
|
int | y = 0 , |
|||
int | width = 0 , |
|||
int | height = 0 | |||
) | [slot] |
LayerButton * MultiLayer::addLayerButton | ( | ) |
void MultiLayer::addTextLayer | ( | const QPoint & | pos | ) | [slot] |
Finish adding a text layer.
An empty Graph is created and added to me. Legend, title and axes are removed and a new LegendMarker is added with a placeholder text.
void MultiLayer::addTextLayer | ( | int | f, | |
const QFont & | font, | |||
const QColor & | textCol, | |||
const QColor & | backgroundCol | |||
) | [slot] |
Start adding a text layer.
This works by having canvas grab the mouse, remembering that we are in the midst of adding text in addTextOn and dispatching the next mouse click to addTextLayer(const QPoint&) in eventFilter().
void MultiLayer::adjustSize | ( | ) | [slot] |
void MultiLayer::arrangeLayers | ( | bool | fit, | |
bool | userSize | |||
) | [slot] |
QSize MultiLayer::arrangeLayers | ( | bool | userSize | ) | [slot] |
int MultiLayer::bottomMargin | ( | ) | [inline, slot] |
QPixmap MultiLayer::canvasPixmap | ( | ) | [slot] |
void MultiLayer::changeEvent | ( | QEvent * | event | ) | [virtual] |
int MultiLayer::colsSpacing | ( | ) | [inline, slot] |
void MultiLayer::confirmRemoveLayer | ( | ) | [slot] |
void MultiLayer::connectLayer | ( | Graph * | g | ) | [slot] |
void MultiLayer::contextMenuEvent | ( | QContextMenuEvent * | e | ) |
void MultiLayer::copy | ( | MultiLayer * | ml | ) |
void MultiLayer::copyAllLayers | ( | ) | [slot] |
void MultiLayer::createIntensityTable | ( | const QString & | ) | [signal] |
void MultiLayer::createTable | ( | const QString & | , | |
int | , | |||
int | , | |||
const QString & | ||||
) | [signal] |
void MultiLayer::cursorInfo | ( | const QString & | ) | [signal] |
void MultiLayer::drawLineEnded | ( | bool | ) | [signal] |
void MultiLayer::drawTextOff | ( | ) | [signal] |
bool MultiLayer::eventFilter | ( | QObject * | object, | |
QEvent * | e | |||
) |
void MultiLayer::exportImage | ( | const QString & | fileName, | |
int | quality = 100 , |
|||
bool | transparent = false | |||
) | [slot] |
void MultiLayer::exportPDF | ( | const QString & | fname | ) | [virtual, slot] |
Reimplemented from MyWidget.
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] |
bool MultiLayer::focusNextPrevChild | ( | bool | next | ) |
int MultiLayer::getCols | ( | ) | [inline, slot] |
int MultiLayer::getRows | ( | ) | [inline, slot] |
QWidgetList MultiLayer::graphPtrs | ( | ) | [inline] |
int MultiLayer::horizontalAlignement | ( | ) | [inline, slot] |
bool MultiLayer::isEmpty | ( | ) | [slot] |
void MultiLayer::keyPressEvent | ( | QKeyEvent * | e | ) |
Graph * MultiLayer::layer | ( | int | num | ) |
QSize MultiLayer::layerCanvasSize | ( | ) | [inline, slot] |
int MultiLayer::layers | ( | ) | [inline, slot] |
int MultiLayer::leftMargin | ( | ) | [inline, slot] |
void MultiLayer::modifiedPlot | ( | ) | [signal] |
void MultiLayer::mousePressEvent | ( | QMouseEvent * | e | ) |
void MultiLayer::pasteMarker | ( | ) | [signal] |
void MultiLayer::print | ( | ) | [virtual, slot] |
Reimplemented from MyWidget.
void MultiLayer::printActiveLayer | ( | ) | [slot] |
void MultiLayer::printAllLayers | ( | QPainter * | painter | ) | [slot] |
void MultiLayer::printCropmarks | ( | bool | on | ) | [inline] |
bool MultiLayer::printCropmarksEnabled | ( | ) | [inline] |
void MultiLayer::releaseLayer | ( | ) |
void MultiLayer::removeLayer | ( | ) | [slot] |
void MultiLayer::resizeLayers | ( | const QSize & | size, | |
const QSize & | oldSize, | |||
bool | scaleFonts | |||
) | [private] |
void MultiLayer::resizeLayers | ( | const QResizeEvent * | re | ) | [private] |
int MultiLayer::rightMargin | ( | ) | [inline, slot] |
int MultiLayer::rowsSpacing | ( | ) | [inline, slot] |
QString MultiLayer::saveAsTemplate | ( | const QString & | geometryInfo | ) | [virtual, slot] |
Reimplemented from MyWidget.
QString MultiLayer::saveToString | ( | const QString & | geometry | ) | [virtual, slot] |
Reimplemented from MyWidget.
bool MultiLayer::scaleLayersOnPrint | ( | ) | [inline] |
void MultiLayer::setActiveGraph | ( | 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::setHidden | ( | ) | [virtual] |
void MultiLayer::setLayerCanvasSize | ( | int | w, | |
int | h | |||
) | [slot] |
void MultiLayer::setLayersNumber | ( | int | n | ) | [slot] |
void MultiLayer::setMargins | ( | int | lm, | |
int | rm, | |||
int | tm, | |||
int | bm | |||
) | [slot] |
void MultiLayer::setOpenMaximized | ( | ) | [inline] |
void MultiLayer::setPointerCursor | ( | ) | [signal] |
void MultiLayer::setRows | ( | int | r | ) | [slot] |
void MultiLayer::setScaleLayersOnPrint | ( | bool | on | ) | [inline] |
void MultiLayer::setSpacing | ( | int | rgap, | |
int | cgap | |||
) | [slot] |
void MultiLayer::showAxisDialog | ( | int | ) | [signal] |
void MultiLayer::showCurveContextMenu | ( | int | ) | [signal] |
void MultiLayer::showCurvesDialog | ( | ) | [signal] |
void MultiLayer::showGeometryDialog | ( | ) | [signal] |
void MultiLayer::showGraphContextMenu | ( | ) | [signal] |
void MultiLayer::showImageDialog | ( | ) | [signal] |
void MultiLayer::showLineDialog | ( | ) | [signal] |
void MultiLayer::showMarkerPopupMenu | ( | ) | [signal] |
void MultiLayer::showPlotDialog | ( | int | ) | [signal] |
void MultiLayer::showRightAxisTitleDialog | ( | ) | [signal] |
void MultiLayer::showScaleDialog | ( | int | ) | [signal] |
void MultiLayer::showTextDialog | ( | ) | [signal] |
void MultiLayer::showTopAxisTitleDialog | ( | ) | [signal] |
void MultiLayer::showWindowContextMenu | ( | ) | [signal] |
void MultiLayer::showXAxisTitleDialog | ( | ) | [signal] |
void MultiLayer::showYAxisTitleDialog | ( | ) | [signal] |
int MultiLayer::topMargin | ( | ) | [inline, slot] |
int MultiLayer::verticalAlignement | ( | ) | [inline, slot] |
void MultiLayer::viewTitleDialog | ( | ) | [signal] |
void MultiLayer::wheelEvent | ( | QWheelEvent * | e | ) |
Graph* MultiLayer::active_graph [private] |
bool MultiLayer::addTextOn [private] |
int MultiLayer::bottom_margin [private] |
QWidgetList MultiLayer::buttonsList [private] |
QWidget* MultiLayer::canvas [private] |
int MultiLayer::cols [private] |
int MultiLayer::colsSpace [private] |
QPointer<SelectionMoveResizer> MultiLayer::d_layers_selector [private] |
QSize MultiLayer::d_max_size [private] |
Stores the size of the widget in the Qt::WindowMaximized state.
QSize MultiLayer::d_normal_size [private] |
Stores the size of the widget in Qt::WindowNoState (normal state).
int MultiLayer::d_open_maximized [private] |
bool MultiLayer::d_print_cropmarks [private] |
bool MultiLayer::d_scale_on_print [private] |
QColor MultiLayer::defaultTextMarkerBackground [private] |
QColor MultiLayer::defaultTextMarkerColor [private] |
QFont MultiLayer::defaultTextMarkerFont [private] |
int MultiLayer::defaultTextMarkerFrame [private] |
Used when adding text markers on new layers.
int MultiLayer::graph_height [private] |
int MultiLayer::graph_width [private] |
int MultiLayer::graphs [private] |
Used for resizing of layers.
QWidgetList MultiLayer::graphsList [private] |
int MultiLayer::hor_align [private] |
int MultiLayer::l_canvas_height [private] |
int MultiLayer::l_canvas_width [private] |
QHBoxLayout* MultiLayer::layerButtonsBox [private] |
int MultiLayer::left_margin [private] |
int MultiLayer::right_margin [private] |
int MultiLayer::rows [private] |
int MultiLayer::rowsSpace [private] |
int MultiLayer::top_margin [private] |
int MultiLayer::vert_align [private] |