Logo Search packages:      
Sourcecode: scidavis version File versions  Download package

MultiLayer Class Reference

#include <MultiLayer.h>

Inheritance diagram for MultiLayer:

MyWidget

List of all members.


Detailed Description

An MDI window (MyWidget) 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.

Definition at line 66 of file MultiLayer.h.


Public Types

enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  HorAlignement { HCenter, Left, Right }
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }
enum  VertAlignement { VCenter, Top, Bottom }

Public Slots

void activateGraph (LayerButton *button)
GraphactiveGraph ()
GraphaddLayer (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, bool keepAspect=true, QPrinter::PageSize pageSize=QPrinter::Custom, QPrinter::Orientation orientation=QPrinter::Portrait)
void print ()
void printActiveLayer ()
void printAllLayers (QPainter *painter)

Signals

void closedWindow (MyWidget *)
 Emitted when the window was closed.
void createIntensityTable (const QString &)
void createTable (const QString &, const QString &, QList< Column * >)
void cursorInfo (const QString &)
void drawLineEnded (bool)
void drawTextOff ()
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedPlot ()
void modifiedWindow (QWidget *)
void pasteMarker ()
void resizedWindow (QWidget *)
void setPointerCursor ()
void showAxisDialog (int)
void showCurveContextMenu (int)
void showCurvesDialog ()
void showGeometryDialog ()
void showGraphContextMenu ()
void showImageDialog ()
void showLayerButtonContextMenu ()
void showLineDialog ()
void showMarkerPopupMenu ()
void showPlotDialog (int)
void showRightAxisTitleDialog ()
void showScaleDialog (int)
void showTextDialog ()
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void showTopAxisTitleDialog ()
void showWindowContextMenu ()
void showXAxisTitleDialog ()
void showYAxisTitleDialog ()
void statusChanged (MyWidget *)
 Emitted when the window status changed.
void viewTitleDialog ()

Public Member Functions

LayerButtonaddLayerButton ()
void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
virtual QString birthDate ()
 Return the creation date.
virtual CaptionPolicy captionPolicy ()
 Return the caption policy.
void closeEvent (QCloseEvent *)
 Close event handler.
void copy (ApplicationWindow *parent, MultiLayer *ml)
Folderfolder ()
 Returns the pointer to the parent folder of the window.
QWidgetList graphPtrs ()
Graphlayer (int num)
 MultiLayer (const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
void printCropmarks (bool on)
bool printCropmarksEnabled ()
virtual void restore (const QStringList &)
 Not implemented yet.
bool scaleLayersOnPrint ()
virtual void setBirthDate (const QString &s)
 Set the creation date.
virtual void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window.
void setHidden ()
 Notifies that a window was hidden by a direct user action.
void setMaximized ()
void setMinimized ()
virtual void setName (const QString &s)
 Set the window name.
void setNormal ()
void setOpenMaximized ()
void setScaleLayersOnPrint (bool on)
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized).
virtual void setWindowLabel (const QString &s)
 Set the window label.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized).
virtual QString windowLabel ()
 Return the window label.
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 *)

Protected Slots

void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.

Protected Attributes

bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
QString birthdate
 The creation date.
CaptionPolicy caption_policy
 The caption policy.
FolderparentFolder
 Pointer to the parent folder of the window.
QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.
QString w_label
 The window label.
Status w_status
 The window status.

Private Member Functions

void resizeLayers (const QSize &size, const QSize &oldSize, bool scaleFonts)
void resizeLayers (const QResizeEvent *re)

Private Attributes

Graphactive_graph
bool addTextOn
int bottom_margin
QWidgetList buttonsList
QWidget * canvas
int cols
int colsSpace
QPointer< SelectionMoveResizerd_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

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

Generated by  Doxygen 1.6.0   Back to index