SciDAVis  1.D4
Public Types | Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes
MultiLayer Class Reference

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

#include <MultiLayer.h>

Inheritance diagram for MultiLayer:
MyWidget

List of all members.

Public Types

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

Public Slots

void activateGraph (LayerButton *button)
GraphactiveGraph ()
GraphaddLayer (int x=0, int y=0, int width=0, int height=0)
void addTextLayer (int f, const QFont &font, const QColor &textCol, const QColor &backgroundCol)
 Start adding a text layer.
void addTextLayer (const QPoint &pos)
 Finish adding a text layer.
void adjustSize ()
QSize arrangeLayers (bool userSize)
void 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 ()
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 exportToFile (const QString &fileName)
void exportImage (const QString &fileName, int quality=100, bool transparent=false)
void exportSVG (const QString &fname)
void exportPDF (const QString &fname)
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 copyAllLayers ()
void print ()
void printAllLayers (QPainter *painter)
void printActiveLayer ()

Signals

void createIntensityTable (const QString &)
void createTable (const QString &, const QString &, QList< Column * >)
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 showLayerButtonContextMenu ()
void showLineDialog ()
void showMarkerPopupMenu ()
void showPlotDialog (int)
void showRightAxisTitleDialog ()
void showScaleDialog (int)
void showTextDialog ()
void showTopAxisTitleDialog ()
void showWindowContextMenu ()
void showXAxisTitleDialog ()
void showYAxisTitleDialog ()
void viewTitleDialog ()
- Signals inherited from MyWidget
void closedWindow (MyWidget *)
 Emitted when the window was closed.
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedWindow (QWidget *)
void resizedWindow (QWidget *)
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Public Member Functions

LayerButtonaddLayerButton ()
void copy (ApplicationWindow *parent, MultiLayer *ml)
QWidgetList graphPtrs ()
Graphlayer (int num)
QWidgetList layerWidgets () const
 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 mousePressEvent (QMouseEvent *)
void contextMenuEvent (QContextMenuEvent *)
void wheelEvent (QWheelEvent *)
void keyPressEvent (QKeyEvent *)
void changeEvent (QEvent *)
 Catches parent changes (in order to gain access to the title bar)
bool eventFilter (QObject *object, QEvent *)
 Filters other object's events (customizes title bar's context menu)
void releaseLayer ()
bool focusNextPrevChild (bool next)
- Public Member Functions inherited from MyWidget
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.
Folderfolder ()
 Returns the pointer to the parent folder of the window.
 MyWidget (const QString &label=QString(), QWidget *parent=0, const QString name=0, Qt::WFlags f=0)
 Constructor.
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
virtual void restore (const QStringList &)
 Not implemented yet.
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 setMaximized ()
void setMinimized ()
virtual void setName (const QString &s)
 Set the window name.
void setNormal ()
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.

Private Member Functions

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

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

Additional Inherited Members

- Protected Slots inherited from MyWidget
void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.
- Protected Attributes inherited from MyWidget
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.

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.


Member Enumeration Documentation

Enumerator:
HCenter 
Left 
Right 
Enumerator:
VCenter 
Top 
Bottom 

Constructor & Destructor Documentation

MultiLayer::MultiLayer ( const QString &  label,
QWidget *  parent = 0,
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::activeGraph ( )
inlineslot
Graph * MultiLayer::addLayer ( int  x = 0,
int  y = 0,
int  width = 0,
int  height = 0 
)
slot
LayerButton * MultiLayer::addLayerButton ( )
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().

See also:
defaultTextMarkerFont, defaultTextMarkerFrame, defaultTextMarkerColor, defaultTextMarkerBackground

References addTextOn, canvas, defaultTextMarkerBackground, defaultTextMarkerColor, defaultTextMarkerFont, and defaultTextMarkerFrame.

Referenced by ApplicationWindow::addText(), and eventFilter().

void MultiLayer::addTextLayer ( const QPoint &  pos)
slot
void MultiLayer::adjustSize ( )
slot
QSize MultiLayer::arrangeLayers ( bool  userSize)
slot
void MultiLayer::arrangeLayers ( bool  fit,
bool  userSize 
)
slot
int MultiLayer::bottomMargin ( )
inlineslot

References bottom_margin.

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

QPixmap MultiLayer::canvasPixmap ( )
slot

References canvas.

Referenced by copyAllLayers(), and exportImage().

void MultiLayer::changeEvent ( QEvent *  event)
virtual

Catches parent changes (in order to gain access to the title bar)

Reimplemented from MyWidget.

References LayerButton::btnSize(), d_max_size, d_normal_size, and resizeLayers().

int MultiLayer::colsSpacing ( )
inlineslot

References colsSpace.

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

void MultiLayer::confirmRemoveLayer ( )
slot
void MultiLayer::connectLayer ( Graph g)
slot
void MultiLayer::contextMenuEvent ( QContextMenuEvent *  e)
void MultiLayer::copy ( ApplicationWindow parent,
MultiLayer ml 
)
void MultiLayer::copyAllLayers ( )
slot
void MultiLayer::createIntensityTable ( const QString &  )
signal

Referenced by connectLayer().

void MultiLayer::createTable ( const QString &  ,
const QString &  ,
QList< Column * >   
)
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 addTextLayer(), and connectLayer().

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

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

Reimplemented from MyWidget.

References addTextLayer(), addTextOn, canvas, resizeLayers(), MyWidget::showTitleBarMenu(), and MyWidget::titleBar.

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

Reimplemented from MyWidget.

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,
QPrinter::Orientation  orientation = QPrinter::Portrait 
)
slot
void MultiLayer::findBestLayout ( int &  rows,
int &  cols 
)
slot

References graphs.

Referenced by arrangeLayers().

bool MultiLayer::focusNextPrevChild ( bool  next)
int MultiLayer::getCols ( )
inlineslot

References cols.

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

int MultiLayer::getRows ( )
inlineslot

References rows.

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

QWidgetList MultiLayer::graphPtrs ( )
inline
int MultiLayer::horizontalAlignement ( )
inlineslot

References hor_align.

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

bool MultiLayer::isEmpty ( )
slot
void MultiLayer::keyPressEvent ( QKeyEvent *  e)
Graph * MultiLayer::layer ( int  num)

References graphsList.

Referenced by LayerDialog::update().

QSize MultiLayer::layerCanvasSize ( )
inlineslot
int MultiLayer::layers ( )
inlineslot
QWidgetList MultiLayer::layerWidgets ( ) const
inline

References graphsList.

int MultiLayer::leftMargin ( )
inlineslot

References left_margin.

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

void MultiLayer::modifiedPlot ( )
signal
void MultiLayer::mousePressEvent ( QMouseEvent *  e)
void MultiLayer::pasteMarker ( )
signal
void MultiLayer::print ( )
virtualslot

Reimplemented from MyWidget.

References MyWidget::aspect(), canvas, and printAllLayers().

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 ( )
void MultiLayer::removeLayer ( )
slot
void MultiLayer::resizeLayers ( const QResizeEvent *  re)
private
void MultiLayer::resizeLayers ( const QSize &  size,
const QSize &  oldSize,
bool  scaleFonts 
)
private
int MultiLayer::rightMargin ( )
inlineslot

References right_margin.

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

int MultiLayer::rowsSpacing ( )
inlineslot

References rowsSpace.

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

QString MultiLayer::saveAsTemplate ( const QString &  geometryInfo)
virtualslot
QString MultiLayer::saveToString ( const QString &  geometry)
virtualslot
bool MultiLayer::scaleLayersOnPrint ( )
inline

References d_scale_on_print.

Referenced by PlotDialog::setMultiLayer().

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

Notifies that a window was hidden by a direct user action.

Reimplemented from MyWidget.

References d_max_size, d_normal_size, MyWidget::Maximized, resizeLayers(), and MyWidget::status().

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

References d_open_maximized.

void MultiLayer::setPointerCursor ( )
signal

Referenced by removeLayer(), and setLayersNumber().

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

Referenced by connectLayer().

void MultiLayer::showCurveContextMenu ( int  )
signal

Referenced by connectLayer().

void MultiLayer::showCurvesDialog ( )
signal

Referenced by addLayerButton().

void MultiLayer::showGeometryDialog ( )
signal
void MultiLayer::showGraphContextMenu ( )
signal

Referenced by connectLayer().

void MultiLayer::showImageDialog ( )
signal

Referenced by connectLayer().

void MultiLayer::showLayerButtonContextMenu ( )
signal

Referenced by addLayerButton(), and 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::showRightAxisTitleDialog ( )
signal

Referenced by connectLayer().

void MultiLayer::showScaleDialog ( int  )
signal

Referenced by connectLayer().

void MultiLayer::showTextDialog ( )
signal

Referenced by connectLayer().

void MultiLayer::showTopAxisTitleDialog ( )
signal

Referenced by connectLayer().

void MultiLayer::showWindowContextMenu ( )
signal

Referenced by contextMenuEvent(), and keyPressEvent().

void MultiLayer::showXAxisTitleDialog ( )
signal

Referenced by connectLayer().

void MultiLayer::showYAxisTitleDialog ( )
signal

Referenced by connectLayer().

int MultiLayer::topMargin ( )
inlineslot

References top_margin.

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

int MultiLayer::verticalAlignement ( )
inlineslot

References vert_align.

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

void MultiLayer::viewTitleDialog ( )
signal

Referenced by connectLayer().

void MultiLayer::wheelEvent ( QWheelEvent *  e)

Member Data Documentation

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.

Referenced by changeEvent(), MultiLayer(), and setHidden().

QSize MultiLayer::d_normal_size
private

Stores the size of the widget in Qt::WindowNoState (normal state).

Referenced by changeEvent(), MultiLayer(), and setHidden().

int MultiLayer::d_open_maximized
private
bool MultiLayer::d_print_cropmarks
private
bool MultiLayer::d_scale_on_print
private
QColor MultiLayer::defaultTextMarkerBackground
private

Referenced by addTextLayer().

QColor MultiLayer::defaultTextMarkerColor
private

Referenced by addTextLayer().

QFont MultiLayer::defaultTextMarkerFont
private

Referenced by addTextLayer().

int MultiLayer::defaultTextMarkerFrame
private

Used when adding text markers on new layers.

Referenced by addTextLayer().

int MultiLayer::graph_height
private

Referenced by addLayer(), and MultiLayer().

int MultiLayer::graph_width
private

Referenced by addLayer(), and MultiLayer().

int MultiLayer::graphs
private
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

Referenced by addLayerButton(), and MultiLayer().

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

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