scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

MultiLayer Class Reference

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

#include <MultiLayer.h>

Inheritance diagram for MultiLayer:
[legend]
Collaboration diagram for MultiLayer:
[legend]

Public Types

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

Signals

void closedWindow (MyWidget *)
 Emitted when the window was closed. More...
 
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden. More...
 
void modifiedWindow (MyWidget *)
 
void resizedWindow (MyWidget *)
 
void statusChanged (MyWidget *)
 Emitted when the window status changed. More...
 
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent. More...
 

Public Member Functions

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

Protected Slots

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

Protected Member Functions

virtual void changeEvent (QEvent *event)
 

Protected Attributes

FolderparentFolder
 Pointer to the parent folder of the window. More...
 
QString w_label
 The window label. More...
 
QString birthdate
 The creation date. More...
 
Status w_status
 The window status. More...
 
CaptionPolicy caption_policy
 The caption policy. More...
 
bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event. More...
 

Event Handlers

void mousePressEvent (QMouseEvent *)
 
void contextMenuEvent (QContextMenuEvent *)
 
void wheelEvent (QWheelEvent *)
 
void keyPressEvent (QKeyEvent *)
 
bool eventFilter (QObject *object, QEvent *)
 
void releaseLayer ()
 
bool focusNextPrevChild (bool next)
 
bool scaleLayersOnPrint ()
 
void setScaleLayersOnPrint (bool on)
 
bool printCropmarksEnabled ()
 
void printCropmarks (bool on)
 
void setActiveGraph (Graph *g)
 
void activateGraph (LayerButton *button)
 
void setGraphGeometry (int x, int y, int w, int h)
 
void findBestLayout (int &rows, int &cols)
 
QSize arrangeLayers (bool userSize)
 
void arrangeLayers (bool fit, bool userSize)
 
int getRows ()
 
void setRows (int r)
 
int getCols ()
 
void setCols (int c)
 
int colsSpacing ()
 
int rowsSpacing ()
 
void setSpacing (int rgap, int cgap)
 
int leftMargin ()
 
int rightMargin ()
 
int topMargin ()
 
int bottomMargin ()
 
void setMargins (int lm, int rm, int tm, int bm)
 
QSize layerCanvasSize ()
 
void setLayerCanvasSize (int w, int h)
 
int horizontalAlignement ()
 
int verticalAlignement ()
 
void setAlignement (int ha, int va)
 
int layers ()
 
GraphaddLayer (int x=0, int y=0, int width=0, int height=0)
 
void setLayersNumber (int n)
 
bool isEmpty ()
 
void removeLayer ()
 
void confirmRemoveLayer ()
 
void addTextLayer (int f, const QFont &font, const QColor &textCol, const QColor &backgroundCol)
 Start adding a text layer. More...
 
void addTextLayer (const QPoint &pos)
 Finish adding a text layer. More...
 
GraphactiveGraph ()
 

Print and Export

QSize lastSize
 
Graphactive_graph
 
int graphs
 Used for resizing of layers. More...
 
int cols
 
int rows
 
int graph_width
 
int graph_height
 
int colsSpace
 
int rowsSpace
 
int left_margin
 
int right_margin
 
int top_margin
 
int bottom_margin
 
int l_canvas_width
 
int l_canvas_height
 
int hor_align
 
int vert_align
 
bool addTextOn
 
bool d_scale_on_print
 
bool d_print_cropmarks
 
int defaultTextMarkerFrame
 Used when adding text markers on new layers. More...
 
QFont defaultTextMarkerFont
 
QColor defaultTextMarkerColor
 
QColor defaultTextMarkerBackground
 
QWidgetList buttonsList
 
QWidgetList graphsList
 
QHBoxLayout * layerButtonsBox
 
QWidget * canvas
 
QPointer< SelectionMoveResizerd_layers_selector
 
void exportToFile (const QString &fileName)
 
void exportImage (const QString &fileName, int quality=-1)
 
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 exportPainter (QPaintDevice &paintDevice, bool keepAspect=false, QRect rect=QRect())
 
void exportPainter (QPainter &painter, bool keepAspect=false, QRect rect=QRect(), QSize size=QSize())
 
void copyAllLayers ()
 
void print ()
 
void printAllLayers (QPainter *painter)
 
void printActiveLayer ()
 
void setFonts (const QFont &titleFnt, const QFont &scaleFnt, const QFont &numbersFnt, const QFont &legendFnt)
 
void connectLayer (Graph *g)
 
QString saveToString (const QString &geometry)
 
QString saveAsTemplate (const QString &geometryInfo)
 
void showTextDialog ()
 
void showPlotDialog (int)
 
void showAxisDialog (int)
 
void showScaleDialog (int)
 
void showGraphContextMenu ()
 
void showLayerButtonContextMenu ()
 
void showCurveContextMenu (int)
 
void showWindowContextMenu ()
 
void showCurvesDialog ()
 
void drawTextOff ()
 
void drawLineEnded (bool)
 
void showXAxisTitleDialog ()
 
void showYAxisTitleDialog ()
 
void showTopAxisTitleDialog ()
 
void showRightAxisTitleDialog ()
 
void showMarkerPopupMenu ()
 
void modifiedPlot ()
 
void cursorInfo (const QString &)
 
void showImageDialog ()
 
void showLineDialog ()
 
void viewTitleDialog ()
 
void createTable (const QString &, const QString &, QList< Column * >)
 
void showGeometryDialog ()
 
void pasteMarker ()
 
void createIntensityTable (const QString &)
 
void setPointerCursor ()
 
void resizeLayers (const QResizeEvent *re)
 
void resizeLayers (const QSize &size, const QSize &oldSize, bool scaleFonts)
 

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.

Member Enumeration Documentation

◆ CaptionPolicy

enum MyWidget::CaptionPolicy
inherited

Possible window captions.

Enumerator
Name 

caption determined by the window name

Label 

caption detemined by the window label

Both 

caption = "name - label"

Definition at line 68 of file MyWidget.h.

68  {
69  Name = 0,
70  Label = 1,
71  Both = 2
72  };

◆ HorAlignement

Enumerator
HCenter 
Left 
Right 

Definition at line 78 of file MultiLayer.h.

78 {HCenter, Left, Right};

◆ Status

enum MyWidget::Status
inherited
Enumerator
Hidden 
Normal 
Minimized 
Maximized 

Definition at line 73 of file MyWidget.h.

73 {Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2};

◆ VertAlignement

Enumerator
VCenter 
Top 
Bottom 

Definition at line 79 of file MultiLayer.h.

79 {VCenter, Top, Bottom};

Constructor & Destructor Documentation

◆ MultiLayer()

MultiLayer::MultiLayer ( const QString &  label,
QWidget *  parent = 0,
const QString  name = QString(),
Qt::WindowFlags  f = 0 
)

Definition at line 87 of file MultiLayer.cpp.

88 : MyWidget(label,parent,name,f)
89 {
90  if ( name.isEmpty() )
91  setObjectName( "multilayer plot" );
92 
93  QDateTime dt = QDateTime::currentDateTime ();
94  setBirthDate(dt.toString(Qt::LocalDate));
95 
96  graphs=0; cols=1; rows=1;
97  graph_width=500; graph_height=400;
98  colsSpace=5; rowsSpace=5;
99  left_margin = 5; right_margin = 5;
100  top_margin = 5; bottom_margin = 5;
101  l_canvas_width = 400; l_canvas_height = 300;
102  lastSize = QSize(-1, -1);
104  active_graph = 0;
105  addTextOn = false;
106  d_scale_on_print = true;
107  d_print_cropmarks = false;
108 
109  layerButtonsBox = new QHBoxLayout();
110  QHBoxLayout *hbox = new QHBoxLayout();
111  // add a zero width widget to reserve space for the layer's buttons
112  QWidget* strut = new QWidget();
113  strut->setFixedSize(0,LayerButton::btnSize());
114  hbox->addWidget(strut);
115  hbox->addLayout(layerButtonsBox);
116  hbox->addStretch();
117 
118  canvas = new QWidget();
119  canvas->installEventFilter(this);
120 
121  QWidget* d_main_widget = new QWidget();
122  QVBoxLayout* layout = new QVBoxLayout();
123  d_main_widget->setLayout(layout);
124  layout->addLayout(hbox);
125  layout->addWidget(canvas, 1);
126  layout->setMargin(0);
127  layout->setSpacing(0);
128  this->setWidget(d_main_widget);
129 
130  d_main_widget->setAutoFillBackground(true);
131  d_main_widget->setBackgroundRole(QPalette::Window);
132  QPalette pal = palette();
133  pal.setColor(QPalette::Window, QColor(Qt::white));
134  d_main_widget->setPalette(pal);
135 
136  setMinimumSize(200,150);
137  setGeometry(QRect( 0, 0, graph_width, graph_height ));
138  setFocusPolicy(Qt::StrongFocus);
139 }

References active_graph, addTextOn, bottom_margin, LayerButton::btnSize(), canvas, cols, colsSpace, d_print_cropmarks, d_scale_on_print, graph_height, graph_width, graphs, HCenter, hor_align, l_canvas_height, l_canvas_width, lastSize, layerButtonsBox, left_margin, MyWidget::name(), right_margin, rows, rowsSpace, MyWidget::setBirthDate(), top_margin, VCenter, and vert_align.

Here is the call graph for this function:

Member Function Documentation

◆ activateGraph()

void MultiLayer::activateGraph ( LayerButton button)

Definition at line 184 of file MultiLayer.cpp.

185 {
186  for (int i=0;i<buttonsList.count();i++)
187  {
188  LayerButton *btn=(LayerButton*)buttonsList.at(i);
189  if (btn->isChecked())
190  btn->setChecked(false);
191 
192  if (btn == button)
193  {
194  active_graph = (Graph*) graphsList.at(i);
195  active_graph->setFocus();
196  active_graph->raise();//raise layer on top of the layers stack
197  button->setChecked(true);
198  }
199  }
200 }

References active_graph, buttonsList, and graphsList.

Referenced by addLayerButton().

Here is the caller graph for this function:

◆ activeGraph

Graph* MultiLayer::activeGraph ( )
inlineslot

◆ addLayer

Graph * MultiLayer::addLayer ( int  x = 0,
int  y = 0,
int  width = 0,
int  height = 0 
)
slot

Definition at line 164 of file MultiLayer.cpp.

165 {
166  addLayerButton();
167  if (!width && !height) {
168  width = graph_width;
169  height = graph_height;
170  }
171 
172  Graph* g = new Graph(canvas);
173  g->setAttribute(Qt::WA_DeleteOnClose);
174  g->setGeometry(x, y, width, height);
175  g->plotWidget()->resize(QSize(width, height));
176  graphsList.append(g);
177 
178  active_graph = g;
179  g->show();
180  connectLayer(g);
181  return g;
182 }

References active_graph, addLayerButton(), canvas, connectLayer(), graph_height, graph_width, graphsList, and Graph::plotWidget().

Referenced by ApplicationWindow::addLayer(), addTextLayer(), copy(), ImportOPJ::importGraphs(), ApplicationWindow::loadImage(), ApplicationWindow::multilayerPlot(), ApplicationWindow::newGraph(), ApplicationWindow::openGraph(), ApplicationWindow::pasteSelection(), ApplicationWindow::plotSpectrogram(), and setLayersNumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addLayerButton()

LayerButton * MultiLayer::addLayerButton ( )

Definition at line 146 of file MultiLayer.cpp.

147 {
148  for (int i=0;i<buttonsList.count();i++)
149  {
150  LayerButton *btn=(LayerButton*) buttonsList.at(i);
151  btn->setChecked(false);
152  }
153 
154  LayerButton *button = new LayerButton(QString::number(++graphs));
155  connect (button, SIGNAL(clicked(LayerButton*)),this, SLOT(activateGraph(LayerButton*)));
156  connect (button, SIGNAL(showContextMenu()),this, SIGNAL(showLayerButtonContextMenu()));
157  connect (button, SIGNAL(showCurvesDialog()),this, SIGNAL(showCurvesDialog()));
158 
159  buttonsList.append(button);
160  layerButtonsBox->addWidget(button);
161  return button;
162 }

References activateGraph(), buttonsList, graphs, layerButtonsBox, showCurvesDialog(), and showLayerButtonContextMenu().

Referenced by addLayer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTextLayer [1/2]

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 Legend is added with a placeholder text.

See also
defaultTextMarkerFont, defaultTextMarkerFrame, defaultTextMarkerColor, defaultTextMarkerBackground, addTextLayer(int,const QFont&,const QColor&,const QColor&)

Definition at line 947 of file MultiLayer.cpp.

948 {
949  Graph* g=addLayer();
950  g->removeLegend();
951  g->setTitle("");
952  QVector<bool> axesOn(4);
953  for (int j=0;j<4;j++)
954  axesOn[j] = false;
955  g->enableAxes(axesOn);
956  g->setIgnoreResizeEvents(true);
959  Legend *mrk = g->newLegend(tr("enter your text here"));
960  QSize size = mrk->rect().size();
961  setGraphGeometry(pos.x(), pos.y(), size.width()+10, size.height()+10);
962  g->setIgnoreResizeEvents(false);
963  g->show();
964  QApplication::restoreOverrideCursor();
965  canvas->releaseMouse();
966  addTextOn=false;
967  emit drawTextOff();
968  emit modifiedPlot();
969 }

References addLayer(), addTextOn, canvas, defaultTextMarkerBackground, defaultTextMarkerColor, defaultTextMarkerFont, defaultTextMarkerFrame, drawTextOff(), Graph::enableAxes(), modifiedPlot(), Graph::newLegend(), Legend::rect(), Graph::removeLegend(), setGraphGeometry(), Graph::setIgnoreResizeEvents(), Graph::setTextMarkerDefaults(), and Graph::setTitle().

Here is the call graph for this function:

◆ addTextLayer [2/2]

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

Definition at line 934 of file MultiLayer.cpp.

936 {
937  defaultTextMarkerFont = font;
939  defaultTextMarkerColor = textCol;
940  defaultTextMarkerBackground = backgroundCol;
941 
942  addTextOn=true;
943  QApplication::setOverrideCursor(Qt::IBeamCursor);
944  canvas->grabMouse();
945 }

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

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

Here is the caller graph for this function:

◆ arrangeLayers() [1/2]

void MultiLayer::arrangeLayers ( bool  fit,
bool  userSize 
)

Definition at line 575 of file MultiLayer.cpp.

576 {
577  if (!graphs)
578  return;
579 
580  QApplication::setOverrideCursor(Qt::WaitCursor);
581 
583  delete d_layers_selector;
584 
585  if (fit)
587 
588  //the canvas sizes of all layers become equal only after several
589  //resize iterations, due to the way Qwt handles the plot layout
590  int iterations = 0;
591  QSize size = arrangeLayers(userSize);
592  QSize canvas_size = QSize(1,1);
593  while (canvas_size != size && iterations < 10)
594  {
595  iterations++;
596  canvas_size = size;
597  size = arrangeLayers(userSize);
598  }
599 
600  if (userSize)
601  {//resize window
602  bool ignoreResize = active_graph->ignoresResizeEvents();
603  for (int i=0; i<(int)graphsList.count(); i++)
604  {
605  Graph *gr = (Graph *)graphsList.at(i);
606  gr->setIgnoreResizeEvents(true);
607  }
608 
609  this->showNormal();
610  QSize size = canvas->childrenRect().size();
611  this->resize(QSize(size.width() + right_margin,
612  size.height() + bottom_margin + LayerButton::btnSize()));
613 
614  for (int i=0; i<(int)graphsList.count(); i++)
615  {
616  Graph *gr = (Graph *)graphsList.at(i);
617  gr->setIgnoreResizeEvents(ignoreResize);
618  }
619  }
620 
621  emit modifiedPlot();
622  QApplication::restoreOverrideCursor();
623 }

References active_graph, arrangeLayers(), bottom_margin, LayerButton::btnSize(), canvas, cols, d_layers_selector, findBestLayout(), graphs, graphsList, Graph::ignoresResizeEvents(), modifiedPlot(), right_margin, rows, and Graph::setIgnoreResizeEvents().

Here is the call graph for this function:

◆ arrangeLayers() [2/2]

QSize MultiLayer::arrangeLayers ( bool  userSize)

Definition at line 379 of file MultiLayer.cpp.

380 {
381  const QRect rect = canvas->geometry();
382 
383  gsl_vector *xTopR = gsl_vector_calloc (graphs);//ratio between top axis + title and canvas height
384  gsl_vector *xBottomR = gsl_vector_calloc (graphs); //ratio between bottom axis and canvas height
385  gsl_vector *yLeftR = gsl_vector_calloc (graphs);
386  gsl_vector *yRightR = gsl_vector_calloc (graphs);
387  gsl_vector *maxXTopHeight = gsl_vector_calloc (rows);//maximum top axis + title height in a row
388  gsl_vector *maxXBottomHeight = gsl_vector_calloc (rows);//maximum bottom axis height in a row
389  gsl_vector *maxYLeftWidth = gsl_vector_calloc (cols);//maximum left axis width in a column
390  gsl_vector *maxYRightWidth = gsl_vector_calloc (cols);//maximum right axis width in a column
391  gsl_vector *Y = gsl_vector_calloc (rows);
392  gsl_vector *X = gsl_vector_calloc (cols);
393 
394  int i;
395  for (i=0; i<graphs; i++)
396  {//calculate scales/canvas dimensions reports for each layer and stores them in the above vectors
397  Graph *gr=(Graph *)graphsList.at(i);
398  QwtPlot *plot=gr->plotWidget();
399  QwtPlotLayout *plotLayout=plot->plotLayout();
400  QRect cRect=plotLayout->canvasRect();
401  double ch = (double) cRect.height();
402  double cw = (double) cRect.width();
403 
404  QRect tRect=plotLayout->titleRect ();
405  QwtScaleWidget *scale=(QwtScaleWidget *) plot->axisWidget (QwtPlot::xTop);
406 
407  int topHeight = 0;
408  if (!tRect.isNull())
409  topHeight += tRect.height() + plotLayout->spacing();
410  if (scale)
411  {
412  QRect sRect=plotLayout->scaleRect (QwtPlot::xTop);
413  topHeight += sRect.height();
414  }
415  gsl_vector_set (xTopR, i, double(topHeight)/ch);
416 
417  scale=(QwtScaleWidget *) plot->axisWidget (QwtPlot::xBottom);
418  if (scale)
419  {
420  QRect sRect = plotLayout->scaleRect (QwtPlot::xBottom);
421  gsl_vector_set (xBottomR, i, double(sRect.height())/ch);
422  }
423 
424  scale=(QwtScaleWidget *) plot->axisWidget (QwtPlot::yLeft);
425  if (scale)
426  {
427  QRect sRect = plotLayout->scaleRect (QwtPlot::yLeft);
428  gsl_vector_set (yLeftR, i, double(sRect.width())/cw);
429  }
430 
431  scale=(QwtScaleWidget *) plot->axisWidget (QwtPlot::yRight);
432  if (scale)
433  {
434  QRect sRect = plotLayout->scaleRect (QwtPlot::yRight);
435  gsl_vector_set (yRightR, i, double(sRect.width())/cw);
436  }
437 
438  //calculate max scales/canvas dimensions ratio for each line and column and stores them to vectors
439  int row = i / cols;
440  if (row >= rows )
441  row = rows - 1;
442 
443  int col = i % cols;
444 
445  double aux = gsl_vector_get(xTopR, i);
446  double old_max = gsl_vector_get(maxXTopHeight, row);
447  if (aux >= old_max)
448  gsl_vector_set(maxXTopHeight, row, aux);
449 
450  aux = gsl_vector_get(xBottomR, i) ;
451  if (aux >= gsl_vector_get(maxXBottomHeight, row))
452  gsl_vector_set(maxXBottomHeight, row, aux);
453 
454  aux = gsl_vector_get(yLeftR, i);
455  if (aux >= gsl_vector_get(maxYLeftWidth, col))
456  gsl_vector_set(maxYLeftWidth, col, aux);
457 
458  aux = gsl_vector_get(yRightR, i);
459  if (aux >= gsl_vector_get(maxYRightWidth, col))
460  gsl_vector_set(maxYRightWidth, col, aux);
461  }
462 
463  double c_heights = 0.0;
464  for (i=0; i<rows; i++)
465  {
466  gsl_vector_set (Y, i, c_heights);
467  c_heights += 1 + gsl_vector_get(maxXTopHeight, i) + gsl_vector_get(maxXBottomHeight, i);
468  }
469 
470  double c_widths = 0.0;
471  for (i=0; i<cols; i++)
472  {
473  gsl_vector_set (X, i, c_widths);
474  c_widths += 1 + gsl_vector_get(maxYLeftWidth, i) + gsl_vector_get(maxYRightWidth, i);
475  }
476 
477  if (!userSize)
478  {
479  l_canvas_width = int((rect.width()-(cols-1)*colsSpace - right_margin - left_margin)/c_widths);
480  l_canvas_height = int((rect.height()-(rows-1)*rowsSpace - top_margin - bottom_margin)/c_heights);
481  }
482 
483  QSize size = QSize(l_canvas_width, l_canvas_height);
484 
485  for (i=0; i<graphs; i++)
486  {
487  int row = i / cols;
488  if (row >= rows )
489  row = rows - 1;
490 
491  int col = i % cols;
492 
493  //calculate sizes and positions for layers
494  const int w = int (l_canvas_width*(1 + gsl_vector_get(yLeftR, i) + gsl_vector_get(yRightR, i)));
495  const int h = int (l_canvas_height*(1 + gsl_vector_get(xTopR, i) + gsl_vector_get(xBottomR, i)));
496 
497  int x = left_margin + col*colsSpace;
498  if (hor_align == HCenter)
499  x += int (l_canvas_width*(gsl_vector_get(X, col) + gsl_vector_get(maxYLeftWidth, col) - gsl_vector_get(yLeftR, i)));
500  else if (hor_align == Left)
501  x += int(l_canvas_width*gsl_vector_get(X, col));
502  else if (hor_align == Right)
503  x += int(l_canvas_width*(gsl_vector_get(X, col) + gsl_vector_get(maxYLeftWidth, col) - gsl_vector_get(yLeftR, i)+
504  gsl_vector_get(maxYRightWidth, col) - gsl_vector_get(yRightR, i)));
505 
506  int y = top_margin + row*rowsSpace;
507  if (vert_align == VCenter)
508  y += int(l_canvas_height*(gsl_vector_get(Y, row) + gsl_vector_get(maxXTopHeight, row) - gsl_vector_get(xTopR, i)));
509  else if (vert_align == Top)
510  y += int(l_canvas_height*gsl_vector_get(Y, row));
511  else if (vert_align == Bottom)
512  y += int(l_canvas_height*(gsl_vector_get(Y, row) + gsl_vector_get(maxXTopHeight, row) - gsl_vector_get(xTopR, i)+
513  + gsl_vector_get(maxXBottomHeight, row) - gsl_vector_get(xBottomR, i)));
514 
515  //resizes and moves layers
516  Graph *gr = (Graph *)graphsList.at(i);
517  bool autoscaleFonts = false;
518  if (!userSize)
519  {//When the user specifies the layer canvas size, the window is resized
520  //and the fonts must be scaled accordingly. If the size is calculated
521  //automatically we don't rescale the fonts in order to prevent problems
522  //with too small fonts when the user adds new layers or when removing layers
523 
524  autoscaleFonts = gr->autoscaleFonts();//save user settings
525  gr->setAutoscaleFonts(false);
526  }
527 
528  gr->setGeometry(QRect(x, y, w, h));
529  gr->plotWidget()->resize(QSize(w, h));
530 
531  if (!userSize)
532  gr->setAutoscaleFonts(autoscaleFonts);//restore user settings
533  }
534 
535  //free memory
536  gsl_vector_free (maxXTopHeight); gsl_vector_free (maxXBottomHeight);
537  gsl_vector_free (maxYLeftWidth); gsl_vector_free (maxYRightWidth);
538  gsl_vector_free (xTopR); gsl_vector_free (xBottomR);
539  gsl_vector_free (yLeftR); gsl_vector_free (yRightR);
540  gsl_vector_free (X); gsl_vector_free (Y);
541  return size;
542 }

References Graph::autoscaleFonts(), Bottom, bottom_margin, canvas, cols, colsSpace, graphs, graphsList, HCenter, hor_align, l_canvas_height, l_canvas_width, Left, left_margin, Graph::plotWidget(), Right, right_margin, rows, rowsSpace, Graph::setAutoscaleFonts(), Top, top_margin, VCenter, and vert_align.

Referenced by ApplicationWindow::addLayer(), arrangeLayers(), ApplicationWindow::autoArrangeLayers(), confirmRemoveLayer(), ImportOPJ::importGraphs(), ApplicationWindow::multilayerPlot(), ApplicationWindow::newGraph(), and LayerDialog::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ askOnCloseEvent()

void MyWidget::askOnCloseEvent ( bool  ask)
inlineinherited

Toggle the "ask on close" flag.

Definition at line 123 of file MyWidget.h.

123 {askOnClose = ask;};

References MyWidget::askOnClose.

Referenced by ApplicationWindow::connectMultilayerPlot(), ApplicationWindow::connectSurfacePlot(), ApplicationWindow::connectTable(), ApplicationWindow::deleteFitTables(), ApplicationWindow::initMatrix(), and ApplicationWindow::initNote().

Here is the caller graph for this function:

◆ aspect()

QString MyWidget::aspect ( )
inherited

Return the window status as a string.

Definition at line 106 of file MyWidget.cpp.

107 {
108  QString s = tr("Normal");
109  switch (w_status)
110  {
111  case Hidden:
112  return tr("Hidden");
113  break;
114 
115  case Normal:
116  break;
117 
118  case Minimized:
119  return tr("Minimized");
120  break;
121 
122  case Maximized:
123  return tr("Maximized");
124  break;
125  }
126  return s;
127 }

References MyWidget::Hidden, MyWidget::Maximized, MyWidget::Minimized, MyWidget::Normal, and MyWidget::w_status.

Referenced by ApplicationWindow::addListViewItem(), TableView::handleAspectAdded(), Table::handleAspectDescriptionAboutToChange(), Matrix::handleAspectDescriptionChange(), Table::handleAspectDescriptionChange(), TableView::handleAspectDescriptionChanged(), print(), and ApplicationWindow::updateWindowStatus().

Here is the caller graph for this function:

◆ birthDate()

virtual QString MyWidget::birthDate ( )
inlinevirtualinherited

Return the creation date.

Reimplemented in Matrix.

Definition at line 91 of file MyWidget.h.

91 {return birthdate;};

References MyWidget::birthdate.

Referenced by ApplicationWindow::addListViewItem(), Graph3D::saveToString(), saveToString(), TableStatistics::saveToString(), Note::saveToString(), and ApplicationWindow::windowProperties().

Here is the caller graph for this function:

◆ bottomMargin()

int MultiLayer::bottomMargin ( )
inline

Definition at line 148 of file MultiLayer.h.

148 {return bottom_margin;};

References bottom_margin.

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

Here is the caller graph for this function:

◆ captionPolicy()

virtual CaptionPolicy MyWidget::captionPolicy ( )
inlinevirtualinherited

Return the caption policy.

Definition at line 86 of file MyWidget.h.

86 {return caption_policy;};

References MyWidget::caption_policy.

Referenced by RenameWindowDialog::accept(), ApplicationWindow::clone(), ApplicationWindow::convertMatrixToTable(), ApplicationWindow::convertTableToMatrix(), ApplicationWindow::renameWindow(), Graph3D::saveToString(), saveToString(), TableStatistics::saveToString(), Matrix::saveToString(), Note::saveToString(), and RenameWindowDialog::setWidget().

Here is the caller graph for this function:

◆ changeEvent()

void MyWidget::changeEvent ( QEvent *  event)
protectedvirtualinherited

Reimplemented in TableView, and MatrixView.

Definition at line 129 of file MyWidget.cpp.

130 {
131  if (!isHidden() && event->type() == QEvent::WindowStateChange) {
132  if (((QWindowStateChangeEvent *)event)->oldState() == windowState())
133  return;
134  if( windowState() & Qt::WindowMinimized )
136  else if ( windowState() & Qt::WindowMaximized )
138  else
139  w_status = Normal;
140  emit statusChanged (this);
141  }
142  QMdiSubWindow::changeEvent(event);
143 }

References MyWidget::Maximized, MyWidget::Minimized, MyWidget::Normal, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by MatrixView::changeEvent(), and TableView::changeEvent().

Here is the caller graph for this function:

◆ closedWindow

void MyWidget::closedWindow ( MyWidget )
signalinherited

Emitted when the window was closed.

Referenced by MyWidget::closeEvent().

Here is the caller graph for this function:

◆ closeEvent()

void MyWidget::closeEvent ( QCloseEvent *  e)
inherited

Close event handler.

Ask the user "delete, hide, or cancel?" if the "ask on close" flag is set.

Definition at line 76 of file MyWidget.cpp.

77 {
78 if (askOnClose)
79  {
80  switch( QMessageBox::information(this,tr("SciDAVis"),
81  tr("Do you want to hide or delete") + "<p><b>'" + objectName() + "'</b> ?",
82  tr("Delete"), tr("Hide"), tr("Cancel"), 0,2))
83  {
84  case 0:
85  emit closedWindow(this);
86  e->accept();
87  break;
88 
89  case 1:
90  e->ignore();
91  emit hiddenWindow(this);
92  break;
93 
94  case 2:
95  e->ignore();
96  break;
97  }
98  }
99 else
100  {
101  emit closedWindow(this);
102  e->accept();
103  }
104 }

References MyWidget::askOnClose, MyWidget::closedWindow(), and MyWidget::hiddenWindow().

◆ colsSpacing()

int MultiLayer::colsSpacing ( )
inline

Definition at line 141 of file MultiLayer.h.

141 {return colsSpace;};

References colsSpace.

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

Here is the caller graph for this function:

◆ confirmRemoveLayer

void MultiLayer::confirmRemoveLayer ( )
slot

Definition at line 285 of file MultiLayer.cpp.

286 {
287  if (graphs>1)
288  {
289  switch(QMessageBox::information(this,
290  tr("Guess best layout?"),
291  tr("Do you want SciDAVis to rearrange the remaining layers?"),
292  tr("&Yes"), tr("&No"), tr("&Cancel"),
293  0, 2) )
294  {
295  case 0:
296  removeLayer();
297  arrangeLayers(true, false);
298  break;
299 
300  case 1:
301  removeLayer();
302  break;
303 
304  case 2:
305  return;
306  break;
307  }
308  }
309  else
310  removeLayer();
311 }

References arrangeLayers(), graphs, and removeLayer().

Here is the call graph for this function:

◆ connectLayer()

void MultiLayer::connectLayer ( Graph g)

Definition at line 906 of file MultiLayer.cpp.

907 {
908  connect (g,SIGNAL(drawLineEnded(bool)), this, SIGNAL(drawLineEnded(bool)));
909  connect (g,SIGNAL(drawTextOff()),this,SIGNAL(drawTextOff()));
910  connect (g,SIGNAL(showPlotDialog(int)),this,SIGNAL(showPlotDialog(int)));
911  connect (g,SIGNAL(createTable(const QString&,const QString&,QList<Column*>)),
912  this,SIGNAL(createTable(const QString&,const QString&,QList<Column*>)));
913  connect (g,SIGNAL(viewLineDialog()),this,SIGNAL(showLineDialog()));
914  connect (g,SIGNAL(showContextMenu()),this,SIGNAL(showGraphContextMenu()));
915  connect (g,SIGNAL(showLayerButtonContextMenu()),this,SIGNAL(showLayerButtonContextMenu()));
916  connect (g,SIGNAL(showAxisDialog(int)),this,SIGNAL(showAxisDialog(int)));
917  connect (g,SIGNAL(axisDblClicked(int)),this,SIGNAL(showScaleDialog(int)));
918  connect (g,SIGNAL(xAxisTitleDblClicked()),this,SIGNAL(showXAxisTitleDialog()));
919  connect (g,SIGNAL(yAxisTitleDblClicked()),this,SIGNAL(showYAxisTitleDialog()));
920  connect (g,SIGNAL(rightAxisTitleDblClicked()),this,SIGNAL(showRightAxisTitleDialog()));
921  connect (g,SIGNAL(topAxisTitleDblClicked()),this,SIGNAL(showTopAxisTitleDialog()));
922  connect (g,SIGNAL(showMarkerPopupMenu()),this,SIGNAL(showMarkerPopupMenu()));
923  connect (g,SIGNAL(showCurveContextMenu(int)),this,SIGNAL(showCurveContextMenu(int)));
924  connect (g,SIGNAL(cursorInfo(const QString&)),this,SIGNAL(cursorInfo(const QString&)));
925  connect (g,SIGNAL(viewImageDialog()),this,SIGNAL(showImageDialog()));
926  connect (g,SIGNAL(viewTitleDialog()),this,SIGNAL(viewTitleDialog()));
927  connect (g,SIGNAL(modifiedGraph()),this,SIGNAL(modifiedPlot()));
928  connect (g,SIGNAL(selectedGraph(Graph*)),this, SLOT(setActiveGraph(Graph*)));
929  connect (g,SIGNAL(viewTextDialog()),this,SIGNAL(showTextDialog()));
930  connect (g,SIGNAL(createIntensityTable(const QString&)),
931  this,SIGNAL(createIntensityTable(const QString&)));
932 }

References createIntensityTable(), createTable(), cursorInfo(), drawLineEnded(), drawTextOff(), modifiedPlot(), setActiveGraph(), showAxisDialog(), showCurveContextMenu(), showGraphContextMenu(), showImageDialog(), showLayerButtonContextMenu(), showLineDialog(), showMarkerPopupMenu(), showPlotDialog(), showRightAxisTitleDialog(), showScaleDialog(), showTextDialog(), showTopAxisTitleDialog(), showXAxisTitleDialog(), showYAxisTitleDialog(), and viewTitleDialog().

Referenced by addLayer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contextMenuEvent()

void MultiLayer::contextMenuEvent ( QContextMenuEvent *  e)

Definition at line 226 of file MultiLayer.cpp.

227 {
228  emit showWindowContextMenu();
229  e->accept();
230 }

References showWindowContextMenu().

◆ copy()

void MultiLayer::copy ( ApplicationWindow parent,
MultiLayer ml 
)

Definition at line 1286 of file MultiLayer.cpp.

1287 {
1288  hide();//FIXME: find a better way to avoid a resize event
1289  resize(ml->size());
1290 
1291  setSpacing(ml->rowsSpacing(), ml->colsSpacing());
1293  setMargins(ml->leftMargin(), ml->rightMargin(), ml->topMargin(), ml->bottomMargin());
1294 
1295  QWidgetList graphsList = ml->graphPtrs();
1296  for (int i=0; i<graphsList.count(); i++){
1297  Graph* g = (Graph*)graphsList.at(i);
1298  Graph* g2 = addLayer(g->pos().x(), g->pos().y(), g->width(), g->height());
1299  g2->copy(parent, g);
1302  }
1303  show();
1304 }

References addLayer(), Graph::autoscaleFonts(), bottomMargin(), colsSpacing(), Graph::copy(), graphPtrs(), graphsList, horizontalAlignement(), Graph::ignoresResizeEvents(), leftMargin(), rightMargin(), rowsSpacing(), setAlignement(), Graph::setAutoscaleFonts(), Graph::setIgnoreResizeEvents(), setMargins(), setSpacing(), topMargin(), and verticalAlignement().

Here is the call graph for this function:

◆ copyAllLayers()

void MultiLayer::copyAllLayers ( )

Definition at line 765 of file MultiLayer.cpp.

766 {
767  QImage image(canvas->size(), QImage::Format_ARGB32);
768  exportPainter(image);
769  QApplication::clipboard()->setImage(image);
770 }

References canvas, and exportPainter().

Here is the call graph for this function:

◆ createIntensityTable

void MultiLayer::createIntensityTable ( const QString &  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ createTable

void MultiLayer::createTable ( const QString &  ,
const QString &  ,
QList< Column * >   
)
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ cursorInfo

void MultiLayer::cursorInfo ( const QString &  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ drawLineEnded

void MultiLayer::drawLineEnded ( bool  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ drawTextOff

void MultiLayer::drawTextOff ( )
signal

Referenced by addTextLayer(), and connectLayer().

Here is the caller graph for this function:

◆ eventFilter()

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

Definition at line 971 of file MultiLayer.cpp.

972 {
973  if(e->type() == QEvent::MouseButtonPress && object == (QObject *)canvas)
974  {
975  const QMouseEvent *me = (const QMouseEvent *)e;
976  if (me->button()==Qt::LeftButton && addTextOn)
977  addTextLayer(me->pos());
978 
979  return false;
980  }
981  else if(e->type() == QEvent::Resize && object == (QObject *)canvas)
982  {
983  resizeLayers((const QResizeEvent *)e);
984  }
985  return MyWidget::eventFilter(object, e);
986 }

References addTextLayer(), addTextOn, canvas, and resizeLayers().

Here is the call graph for this function:

◆ exportImage()

void MultiLayer::exportImage ( const QString &  fileName,
int  quality = -1 
)

Definition at line 662 of file MultiLayer.cpp.

663 {
664  QImage image(canvas->size(), QImage::Format_ARGB32);
665  exportPainter(image);
666  image.save(fileName, 0, quality);
667 }

References canvas, and exportPainter().

Referenced by exportToFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportPainter() [1/2]

void MultiLayer::exportPainter ( QPaintDevice &  paintDevice,
bool  keepAspect = false,
QRect  rect = QRect() 
)

Definition at line 730 of file MultiLayer.cpp.

731 {
732  QPainter p(&paintDevice);
733  exportPainter(p, keepAspect, rect, QSize(paintDevice.width(), paintDevice.height()));
734  p.end();
735 }

Referenced by copyAllLayers(), exportImage(), exportSVG(), and exportVector().

Here is the caller graph for this function:

◆ exportPainter() [2/2]

void MultiLayer::exportPainter ( QPainter &  painter,
bool  keepAspect = false,
QRect  rect = QRect(),
QSize  size = QSize() 
)

Definition at line 737 of file MultiLayer.cpp.

738  {
739  if (size == QSize()) size = canvas->size();
740  if (rect == QRect()) rect = canvas->rect();
741  if (keepAspect)
742  {
743  QSize scaled = rect.size();
744  scaled.scale(size, Qt::KeepAspectRatio);
745  size = scaled;
746  }
747  painter.scale(
748  (double)size.width()/(double)rect.width(),
749  (double)size.height()/(double)rect.height()
750  );
751 
752  painter.fillRect(rect, widget()->palette().brush(backgroundRole()));
753 
754  for (int i=0; i<(int)graphsList.count(); i++)
755  {
756  Graph *gr = (Graph *)graphsList.at(i);
757  Plot *myPlot = (Plot *)gr->plotWidget();
758 
759  QPoint pos = QPoint(gr->pos().x(), gr->pos().y());
760  gr->exportPainter(painter, false, QRect(pos, myPlot->size()));
761  }
762  }

References canvas, Graph::exportPainter(), graphsList, and Graph::plotWidget().

Here is the call graph for this function:

◆ exportPDF()

void MultiLayer::exportPDF ( const QString &  fname)
virtual

Reimplemented from MyWidget.

Definition at line 669 of file MultiLayer.cpp.

670 {
671  exportVector(fname);
672 }

References exportVector().

Here is the call graph for this function:

◆ exportSVG()

void MultiLayer::exportSVG ( const QString &  fname)

Definition at line 715 of file MultiLayer.cpp.

716 {
717 #if QT_VERSION >= 0x040300
718  QSvgGenerator generator;
719  generator.setFileName(fname);
720 #if QT_VERSION >= 0x040500
721  generator.setSize(canvas->size());
722  generator.setViewBox(QRect(QPoint(0,0), generator.size()));
723  generator.setResolution(96); // FIXME hardcored
724  generator.setTitle(this->name());
725 #endif
726  exportPainter(generator);
727 #endif
728 }

References canvas, exportPainter(), and MyWidget::name().

Referenced by exportToFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToFile()

void MultiLayer::exportToFile ( const QString &  fileName)

Definition at line 637 of file MultiLayer.cpp.

638 {
639  if ( fileName.isEmpty() ){
640  QMessageBox::critical(0, tr("Error"), tr("Please provide a valid file name!"));
641  return;
642  }
643 
644  if (fileName.contains(".eps") || fileName.contains(".pdf") || fileName.contains(".ps")){
645  exportVector(fileName);
646  return;
647  } else if(fileName.contains(".svg")){
648  exportSVG(fileName);
649  return;
650  } else {
651  QList<QByteArray> list = QImageWriter::supportedImageFormats();
652  for(int i=0 ; i<list.count() ; i++){
653  if (fileName.contains( "." + list[i].toLower())){
654  exportImage(fileName);
655  return;
656  }
657  }
658  QMessageBox::critical(this, tr("Error"), tr("File format not handled, operation aborted!"));
659  }
660 }

References exportImage(), exportSVG(), and exportVector().

Here is the call graph for this function:

◆ exportVector()

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 
)

Definition at line 674 of file MultiLayer.cpp.

675 {
676  if ( fileName.isEmpty() ){
677  QMessageBox::critical(this, tr("Error"),
678  tr("Please provide a valid file name!"));
679  return;
680  }
681 
682  QPrinter printer;
683  printer.setDocName (this->name());
684  printer.setCreator("SciDAVis");
685  printer.setFullPage(true);
686  printer.setOutputFileName(fileName);
687  if (fileName.contains(".eps"))
688  {
689 #if QT_VERSION >= 0x050000
690  QMessageBox::warning(this, tr("Warning"),
691  tr("Output in postscript format is not available for Qt5, using PDF"));
692  printer.setOutputFormat(QPrinter::PdfFormat);
693  printer.setOutputFileName(fileName+".pdf");
694 #else
695  printer.setOutputFormat(QPrinter::PostScriptFormat);
696 #endif
697  }
698 
699  if (color)
700  printer.setColorMode(QPrinter::Color);
701  else
702  printer.setColorMode(QPrinter::GrayScale);
703 
704  if (pageSize == QPrinter::Custom)
705  printer.setPaperSize(canvas->size(), QPrinter::Point);
706  else
707  {
708  printer.setOrientation(orientation);
709  printer.setPaperSize(pageSize);
710  }
711 
712  exportPainter(printer, keepAspect);
713 }

References canvas, exportPainter(), and MyWidget::name().

Referenced by exportPDF(), and exportToFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findBestLayout()

void MultiLayer::findBestLayout ( int &  rows,
int &  cols 
)

Definition at line 544 of file MultiLayer.cpp.

545 {
546  int NumGraph=graphs;
547  if(NumGraph%2==0) // NumGraph is an even number
548  {
549  if(NumGraph<=2)
550  cols=NumGraph/2+1;
551  else if(NumGraph>2)
552  cols=NumGraph/2;
553 
554  if(NumGraph<8)
555  rows=NumGraph/4+1;
556  if(NumGraph>=8)
557  rows=NumGraph/4;
558  }
559  else if(NumGraph%2!=0) // NumGraph is an odd number
560  {
561  int Num=NumGraph+1;
562 
563  if(Num<=2)
564  cols=1;
565  else if(Num>2)
566  cols=Num/2;
567 
568  if(Num<8)
569  rows=Num/4+1;
570  if(Num>=8)
571  rows=Num/4;
572  }
573 }

References cols, graphs, and rows.

Referenced by arrangeLayers().

Here is the caller graph for this function:

◆ focusNextPrevChild()

bool MultiLayer::focusNextPrevChild ( bool  next)

Definition at line 1306 of file MultiLayer.cpp.

1307 {
1308  if (!active_graph)
1309  return true;
1310 
1311  return active_graph->focusNextPrevChild(next);
1312 }

References active_graph, and Graph::focusNextPrevChild().

Here is the call graph for this function:

◆ folder()

Folder* MyWidget::folder ( )
inlineinherited

Returns the pointer to the parent folder of the window.

Definition at line 128 of file MyWidget.h.

128 {return parentFolder;};

References MyWidget::parentFolder.

Referenced by ApplicationWindow::closeWindow(), MuParserScript::resolveColumnPath(), ApplicationWindow::restoreWindowGeometry(), MuParserScript::tableColumn__Function(), and ApplicationWindow::windowGeometryInfo().

Here is the caller graph for this function:

◆ getCols()

int MultiLayer::getCols ( )
inline

Definition at line 138 of file MultiLayer.h.

138 {return cols;};

References cols.

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

Here is the caller graph for this function:

◆ getRows()

int MultiLayer::getRows ( )
inline

Definition at line 135 of file MultiLayer.h.

135 {return rows;};

References rows.

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

Here is the caller graph for this function:

◆ graphPtrs()

◆ hiddenWindow

void MyWidget::hiddenWindow ( MyWidget )
signalinherited

Emitted when the window was hidden.

Referenced by Matrix::closeEvent(), MyWidget::closeEvent(), and Table::closeEvent().

Here is the caller graph for this function:

◆ horizontalAlignement()

int MultiLayer::horizontalAlignement ( )
inline

Definition at line 154 of file MultiLayer.h.

154 {return hor_align;};

References hor_align.

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

Here is the caller graph for this function:

◆ isEmpty

◆ keyPressEvent()

void MultiLayer::keyPressEvent ( QKeyEvent *  e)

Definition at line 988 of file MultiLayer.cpp.

989 {
990  if (e->key() == Qt::Key_F12)
991  {
992  if (d_layers_selector)
993  delete d_layers_selector;
994  int index = graphsList.indexOf((QWidget *)active_graph) + 1;
995  if (index >= graphsList.size())
996  index = 0;
997  Graph *g=(Graph *)graphsList.at(index);
998  if (g)
999  setActiveGraph(g);
1000  return;
1001  }
1002 
1003  if (e->key() == Qt::Key_F10)
1004  {
1005  if (d_layers_selector)
1006  delete d_layers_selector;
1007  int index=graphsList.indexOf((QWidget *)active_graph) - 1;
1008  if (index < 0)
1009  index = graphsList.size() - 1;
1010  Graph *g=(Graph *)graphsList.at(index);
1011  if (g)
1012  setActiveGraph(g);
1013  return;
1014  }
1015 
1016  if (e->key() == Qt::Key_F11)
1017  {
1018  emit showWindowContextMenu();
1019  return;
1020  }
1021 }

References active_graph, d_layers_selector, graphsList, setActiveGraph(), and showWindowContextMenu().

Here is the call graph for this function:

◆ layer()

Graph * MultiLayer::layer ( int  num)

Definition at line 141 of file MultiLayer.cpp.

142 {
143  return (Graph*) graphsList.at(num-1);
144 }

References graphsList.

Referenced by LayerDialog::update().

Here is the caller graph for this function:

◆ layerCanvasSize()

QSize MultiLayer::layerCanvasSize ( )
inline

Definition at line 151 of file MultiLayer.h.

151 {return QSize(l_canvas_width, l_canvas_height);};

References l_canvas_height, and l_canvas_width.

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

Here is the caller graph for this function:

◆ layers()

int MultiLayer::layers ( )
inline

Definition at line 158 of file MultiLayer.h.

158 {return graphs;};

References graphs.

Referenced by ApplicationWindow::copySelection(), ApplicationWindow::cutSelection(), ApplicationWindow::pasteSelection(), LayerDialog::setMultiLayer(), ApplicationWindow::showWindowContextMenu(), and LayerDialog::update().

Here is the caller graph for this function:

◆ layerWidgets()

QWidgetList MultiLayer::layerWidgets ( ) const
inline

Definition at line 74 of file MultiLayer.h.

74 { return graphsList; }

References graphsList.

◆ leftMargin()

int MultiLayer::leftMargin ( )
inline

Definition at line 145 of file MultiLayer.h.

145 {return left_margin;};

References left_margin.

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

Here is the caller graph for this function:

◆ modifiedPlot

void MultiLayer::modifiedPlot ( )
signal

Referenced by addTextLayer(), arrangeLayers(), connectLayer(), mousePressEvent(), removeLayer(), resizeLayers(), setFonts(), setGraphGeometry(), setLayersNumber(), and wheelEvent().

Here is the caller graph for this function:

◆ modifiedWindow

void MyWidget::modifiedWindow ( MyWidget )
signalinherited

Referenced by Matrix::handleChange(), Table::handleChange(), Matrix::invert(), Note::modifiedNote(), MyWidget::notifyChanges(), Matrix::recalculate(), and Matrix::setNumericFormat().

Here is the caller graph for this function:

◆ mousePressEvent()

void MultiLayer::mousePressEvent ( QMouseEvent *  e)

Definition at line 1150 of file MultiLayer.cpp.

1151 {
1152  if (!this->widget()->geometry().contains(e->pos())) { // event.pos is in titlebar
1153  if (e->button() == Qt::RightButton) {
1154  emit showTitleBarMenu();
1155  e->accept();
1156  } else {
1157  MyWidget::mousePressEvent(e);
1158  }
1159  return;
1160  }
1161  int margin = 5;
1162  QPoint pos = canvas->mapFrom(this,e->pos());
1163  // iterate backwards, so layers on top are preferred for selection
1164  QList<QWidget*>::iterator i = graphsList.end();
1165  while (i!=graphsList.begin()) {
1166  --i;
1167  QRect igeo = (*i)->frameGeometry();
1168  igeo.adjust(-margin, -margin, margin, margin);
1169  if (igeo.contains(pos)) {
1170  if (e->modifiers() & Qt::ShiftModifier) {
1171  if (d_layers_selector)
1172  d_layers_selector->add(*i);
1173  else {
1175  connect(d_layers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedPlot()));
1176  }
1177  } else {
1178  setActiveGraph((Graph*) (*i));
1179  active_graph->raise();
1180  if (!d_layers_selector) {
1182  connect(d_layers_selector, SIGNAL(targetsChanged()), this, SIGNAL(modifiedPlot()));
1183  }
1184  }
1185  return;
1186  }
1187  }
1188  if (d_layers_selector)
1189  delete d_layers_selector;
1190 }

References active_graph, canvas, d_layers_selector, graphsList, modifiedPlot(), setActiveGraph(), and MyWidget::showTitleBarMenu().

Here is the call graph for this function:

◆ name()

virtual QString MyWidget::name ( )
inlinevirtualinherited

Return the window name.

Reimplemented in Table, and Matrix.

Definition at line 81 of file MyWidget.h.

81 {return objectName();};

Referenced by RenameWindowDialog::accept(), ApplicationWindow::addListViewItem(), ApplicationWindow::alreadyUsedName(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ApplicationWindow::closeWindow(), ApplicationWindow::depending3DPlots(), ApplicationWindow::dependingPlots(), exportSVG(), exportVector(), Folder::findWindow(), ApplicationWindow::generateUniqueName(), Note::init(), ApplicationWindow::loadImage(), ApplicationWindow::loadProject(), MultiLayer(), MyWidget::MyWidget(), ApplicationWindow::openNote(), ApplicationWindow::openSurfacePlot(), Graph3D::print(), ApplicationWindow::removeWindowFromLists(), ApplicationWindow::renameWindow(), ApplicationWindow::restoreWindowGeometry(), ApplicationWindow::saveAsTemplate(), Graph3D::saveToString(), saveToString(), Note::saveToString(), PlotDialog::setMultiLayer(), ApplicationWindow::setShowWindowsPolicy(), RenameWindowDialog::setWidget(), ApplicationWindow::showWindowMenuImpl(), MyWidget::updateCaption(), Graph3D::updateData(), Graph3D::updateScales(), ApplicationWindow::updateWindowStatus(), ApplicationWindow::window(), Folder::window(), ApplicationWindow::windowProperties(), ApplicationWindow::windowsMenuAboutToShow(), and ApplicationWindow::windowsMenuActivated().

Here is the caller graph for this function:

◆ notifyChanges()

void MyWidget::notifyChanges ( )
inlineinherited

Notifies the main application that the window has been modified.

Definition at line 134 of file MyWidget.h.

134 {emit modifiedWindow(this);};

References MyWidget::modifiedWindow().

Referenced by ApplicationWindow::importASCII(), PlotDialog::pickBorderColor(), and PlotDialog::updateBorder().

Here is the caller graph for this function:

◆ pasteMarker

void MultiLayer::pasteMarker ( )
signal

◆ print()

void MultiLayer::print ( )
virtual

Reimplemented from MyWidget.

Definition at line 782 of file MultiLayer.cpp.

783 {
784  QPrinter printer;
785  printer.setColorMode (QPrinter::Color);
786  printer.setFullPage(true);
787  QRect canvasRect = canvas->rect();
788  double aspect = double(canvasRect.width())/double(canvasRect.height());
789  if (aspect < 1)
790  printer.setOrientation(QPrinter::Portrait);
791  else
792  printer.setOrientation(QPrinter::Landscape);
793 
794  QPrintDialog printDialog(&printer);
795  if (printDialog.exec() == QDialog::Accepted)
796  {
797  QPainter paint(&printer);
798  printAllLayers(&paint);
799  paint.end();
800  }
801 }

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

Referenced by ApplicationWindow::print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printActiveLayer()

void MultiLayer::printActiveLayer ( )

Definition at line 772 of file MultiLayer.cpp.

773 {
774  if (active_graph)
775  {
778  active_graph->print();
779  }
780 }

References active_graph, d_print_cropmarks, d_scale_on_print, Graph::print(), Graph::printCropmarks(), and Graph::setScaleOnPrint().

Here is the call graph for this function:

◆ printAllLayers()

void MultiLayer::printAllLayers ( QPainter *  painter)

Definition at line 803 of file MultiLayer.cpp.

804 {
805  if (!painter)
806  return;
807 
808  QPrinter *printer = (QPrinter *)painter->device();
809  QRect paperRect = ((QPrinter *)painter->device())->paperRect();
810  QRect canvasRect = canvas->rect();
811  QRect pageRect = printer->pageRect();
812  QRect cr = canvasRect; // cropmarks rectangle
813 
814  if (d_scale_on_print)
815  {
816  int margin = (int)((1/2.54)*printer->logicalDpiY()); // 1 cm margins
817  double scaleFactorX=(double)(paperRect.width()-2*margin)/(double)canvasRect.width();
818  double scaleFactorY=(double)(paperRect.height()-2*margin)/(double)canvasRect.height();
819 
820  if (d_print_cropmarks)
821  {
822  cr.moveTo(QPoint(margin + int(cr.x()*scaleFactorX),
823  margin + int(cr.y()*scaleFactorY)));
824  cr.setWidth(int(cr.width()*scaleFactorX));
825  cr.setHeight(int(cr.height()*scaleFactorX));
826  }
827 
828  for (int i=0; i<(int)graphsList.count(); i++)
829  {
830  Graph *gr=(Graph *)graphsList.at(i);
831  Plot *myPlot= gr->plotWidget();
832 
833  QPoint pos=gr->pos();
834  pos=QPoint(margin + int(pos.x()*scaleFactorX), margin + int(pos.y()*scaleFactorY));
835 
836  int width=int(myPlot->frameGeometry().width()*scaleFactorX);
837  int height=int(myPlot->frameGeometry().height()*scaleFactorY);
838 
839  gr->print(painter, QRect(pos, QSize(width,height)));
840  }
841  }
842  else
843  {
844  int x_margin = (pageRect.width() - canvasRect.width())/2;
845  int y_margin = (pageRect.height() - canvasRect.height())/2;
846 
847  if (d_print_cropmarks)
848  cr.moveTo(x_margin, y_margin);
849 
850  for (int i=0; i<(int)graphsList.count(); i++)
851  {
852  Graph *gr = (Graph *)graphsList.at(i);
853  Plot *myPlot = (Plot *)gr->plotWidget();
854 
855  QPoint pos = gr->pos();
856  pos = QPoint(x_margin + pos.x(), y_margin + pos.y());
857  gr->print(painter, QRect(pos, myPlot->size()));
858  }
859  }
860  if (d_print_cropmarks)
861  {
862  cr.adjust(-1, -1, 2, 2);
863  painter->save();
864  painter->setPen(QPen(QColor(Qt::black), 0.5, Qt::DashLine));
865  painter->drawLine(paperRect.left(), cr.top(), paperRect.right(), cr.top());
866  painter->drawLine(paperRect.left(), cr.bottom(), paperRect.right(), cr.bottom());
867  painter->drawLine(cr.left(), paperRect.top(), cr.left(), paperRect.bottom());
868  painter->drawLine(cr.right(), paperRect.top(), cr.right(), paperRect.bottom());
869  painter->restore();
870  }
871 
872 }

References canvas, d_print_cropmarks, d_scale_on_print, graphsList, Graph::plotWidget(), and Graph::print().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printCropmarks()

void MultiLayer::printCropmarks ( bool  on)
inline

Definition at line 97 of file MultiLayer.h.

97 {d_print_cropmarks = on;};

References d_print_cropmarks.

Referenced by PlotDialog::acceptParams(), and ApplicationWindow::initBareMultilayerPlot().

Here is the caller graph for this function:

◆ printCropmarksEnabled()

bool MultiLayer::printCropmarksEnabled ( )
inline

Definition at line 96 of file MultiLayer.h.

96 {return d_print_cropmarks;};

References d_print_cropmarks.

Referenced by PlotDialog::setMultiLayer().

Here is the caller graph for this function:

◆ releaseLayer()

void MultiLayer::releaseLayer ( )

◆ removeLayer

void MultiLayer::removeLayer ( )
slot

Definition at line 313 of file MultiLayer.cpp.

314 {
315  //remove corresponding button
316  LayerButton *btn=0;
317  int i;
318  for (i=0;i<buttonsList.count();i++)
319  {
320  btn=(LayerButton*)buttonsList.at(i);
321  if (btn->isChecked())
322  {
323  buttonsList.removeAll(btn);
324  btn->close();
325  break;
326  }
327  }
328 
329  //update the texts of the buttons
330  for (i=0;i<buttonsList.count();i++)
331  {
332  btn=(LayerButton*)buttonsList.at(i);
333  btn->setText(QString::number(i+1));
334  }
335 
337  emit setPointerCursor();
338 
339  int index = graphsList.indexOf(active_graph);
340  graphsList.removeAt(index);
341  active_graph->close();
342  graphs--;
343  if(index >= graphsList.count())
344  index--;
345 
346  if (graphs == 0)
347  {
348  active_graph = 0;
349  return;
350  }
351 
352  active_graph=(Graph*) graphsList.at(index);
353 
354  for (i=0;i<(int)graphsList.count();i++)
355  {
356  Graph *gr=(Graph *)graphsList.at(i);
357  if (gr == active_graph)
358  {
359  LayerButton *button=(LayerButton *)buttonsList.at(i);
360  button->setChecked(true);
361  break;
362  }
363  }
364 
365  emit modifiedPlot();
366 }

References active_graph, Graph::activeTool(), buttonsList, graphs, graphsList, modifiedPlot(), setPointerCursor(), and Graph::zoomOn().

Referenced by confirmRemoveLayer(), and ApplicationWindow::cutSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizedWindow

void MyWidget::resizedWindow ( MyWidget )
signalinherited

Referenced by Graph3D::resizeEvent(), and resizeLayers().

Here is the caller graph for this function:

◆ resizeLayers() [1/2]

void MultiLayer::resizeLayers ( const QResizeEvent *  re)
private

Definition at line 232 of file MultiLayer.cpp.

233 {
234  QSize oldSize = re->oldSize();
235  QSize size = re->size();
236 
237  if(!oldSize.isValid())
238  {
239  if (lastSize.isValid() && isVisible())
240  {
241  oldSize = lastSize;
242  }
243  else
244  { //TODO: for maximized windows, the size of the layers should be saved in % of the workspace area in order to restore
245  //the layers properly! For the moment just resize the layers to occupy the whole canvas, although the restored geometry might be altered!
246  oldSize = QSize(canvas->childrenRect().width() + left_margin + right_margin,
247  canvas->childrenRect().height() + top_margin + bottom_margin);
248  }
249  }
250 
251  resizeLayers(size, oldSize, false);
252 }

References bottom_margin, canvas, lastSize, left_margin, right_margin, and top_margin.

Referenced by eventFilter().

Here is the caller graph for this function:

◆ resizeLayers() [2/2]

void MultiLayer::resizeLayers ( const QSize &  size,
const QSize &  oldSize,
bool  scaleFonts 
)
private

Definition at line 254 of file MultiLayer.cpp.

255 {
256  QApplication::setOverrideCursor(Qt::WaitCursor);
257 
258  double w_ratio = (double)size.width()/(double)oldSize.width();
259  double h_ratio = (double)(size.height())/(double)(oldSize.height());
260 
261  for (int i=0;i<graphsList.count();i++)
262  {
263  Graph *gr = (Graph *)graphsList.at(i);
264  if (gr && !gr->ignoresResizeEvents())
265  {
266  int gx = qRound(gr->x()*w_ratio);
267  int gy = qRound(gr->y()*h_ratio);
268  int gw = qRound(gr->width()*w_ratio);
269  int gh = qRound(gr->height()*h_ratio);
270 
271  gr->setGeometry(QRect(gx, gy, gw, gh));
272  gr->plotWidget()->resize(QSize(gw, gh));
273 
274  if (scaleFonts)
275  gr->scaleFonts(h_ratio);
276  }
277  }
278 
279  lastSize = size;
280  emit modifiedPlot();
281  emit resizedWindow(this);
282  QApplication::restoreOverrideCursor();
283 }

References graphsList, Graph::ignoresResizeEvents(), lastSize, modifiedPlot(), Graph::plotWidget(), MyWidget::resizedWindow(), and Graph::scaleFonts().

Here is the call graph for this function:

◆ restore()

virtual void MyWidget::restore ( const QStringList &  )
inlinevirtualinherited

Not implemented yet.

Definition at line 105 of file MyWidget.h.

105 {};

Referenced by ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ rightMargin()

int MultiLayer::rightMargin ( )
inline

Definition at line 146 of file MultiLayer.h.

146 {return right_margin;};

References right_margin.

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

Here is the caller graph for this function:

◆ rowsSpacing()

int MultiLayer::rowsSpacing ( )
inline

Definition at line 142 of file MultiLayer.h.

142 {return rowsSpace;};

References rowsSpace.

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

Here is the caller graph for this function:

◆ saveAsTemplate()

QString MultiLayer::saveAsTemplate ( const QString &  geometryInfo)
virtual

Reimplemented from MyWidget.

Definition at line 1130 of file MultiLayer.cpp.

1131 {
1132  QString s="<multiLayer>\t";
1133  s+=QString::number(rows)+"\t";
1134  s+=QString::number(cols)+"\n";
1135  s+= geometryInfo;
1136  s+="Margins\t"+QString::number(left_margin)+"\t"+QString::number(right_margin)+"\t"+
1137  QString::number(top_margin)+"\t"+QString::number(bottom_margin)+"\n";
1138  s+="Spacing\t"+QString::number(rowsSpace)+"\t"+QString::number(colsSpace)+"\n";
1139  s+="LayerCanvasSize\t"+QString::number(l_canvas_width)+"\t"+QString::number(l_canvas_height)+"\n";
1140  s+="Alignement\t"+QString::number(hor_align)+"\t"+QString::number(vert_align)+"\n";
1141 
1142  for (int i=0;i<(int)graphsList.count();i++)
1143  {
1144  Graph* ag=(Graph*)graphsList.at(i);
1145  s += ag->saveToString(true);
1146  }
1147  return s+"</multiLayer>\n";
1148 }

References bottom_margin, cols, colsSpace, graphsList, hor_align, l_canvas_height, l_canvas_width, left_margin, right_margin, rows, rowsSpace, Graph::saveToString(), top_margin, and vert_align.

Here is the call graph for this function:

◆ saveToString()

QString MultiLayer::saveToString ( const QString &  geometry)
virtual

Reimplemented from MyWidget.

Definition at line 1107 of file MultiLayer.cpp.

1108 {
1109  QString s="<multiLayer>\n";
1110  s+=QString(name())+"\t";
1111  s+=QString::number(cols)+"\t";
1112  s+=QString::number(rows)+"\t";
1113  s+=birthDate()+"\n";
1114  s+=geometry;
1115  s+="WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n";
1116  s+="Margins\t"+QString::number(left_margin)+"\t"+QString::number(right_margin)+"\t"+
1117  QString::number(top_margin)+"\t"+QString::number(bottom_margin)+"\n";
1118  s+="Spacing\t"+QString::number(rowsSpace)+"\t"+QString::number(colsSpace)+"\n";
1119  s+="LayerCanvasSize\t"+QString::number(l_canvas_width)+"\t"+QString::number(l_canvas_height)+"\n";
1120  s+="Alignement\t"+QString::number(hor_align)+"\t"+QString::number(vert_align)+"\n";
1121 
1122  for (int i=0;i<(int)graphsList.count();i++)
1123  {
1124  Graph* ag=(Graph*)graphsList.at(i);
1125  s+=ag->saveToString();
1126  }
1127  return s+"</multiLayer>\n";
1128 }

References MyWidget::birthDate(), bottom_margin, MyWidget::captionPolicy(), cols, colsSpace, graphsList, hor_align, l_canvas_height, l_canvas_width, left_margin, MyWidget::name(), right_margin, rows, rowsSpace, Graph::saveToString(), top_margin, vert_align, and MyWidget::windowLabel().

Here is the call graph for this function:

◆ scaleLayersOnPrint()

bool MultiLayer::scaleLayersOnPrint ( )
inline

Definition at line 93 of file MultiLayer.h.

93 {return d_scale_on_print;};

References d_scale_on_print.

Referenced by PlotDialog::setMultiLayer().

Here is the caller graph for this function:

◆ setActiveGraph()

void MultiLayer::setActiveGraph ( Graph g)

Definition at line 202 of file MultiLayer.cpp.

203 {
204  if (!g || active_graph == g)
205  return;
206 
207  active_graph = g;
208  active_graph->setFocus();
209 
210  if (d_layers_selector)
211  delete d_layers_selector;
212 
213  active_graph->raise();//raise layer on top of the layers stack
214 
215  for (int i=0;i<(int)graphsList.count();i++)
216  {
217  Graph *gr = (Graph *)graphsList.at(i);
218  LayerButton *btn = (LayerButton *)buttonsList.at(i);
219  if (gr == g)
220  btn->setChecked(true);
221  else
222  btn->setChecked(false);
223  }
224 }

References active_graph, buttonsList, d_layers_selector, and graphsList.

Referenced by connectLayer(), keyPressEvent(), and mousePressEvent().

Here is the caller graph for this function:

◆ setAlignement()

void MultiLayer::setAlignement ( int  ha,
int  va 
)

Definition at line 1220 of file MultiLayer.cpp.

1221 {
1222  if (hor_align != ha)
1223  hor_align = ha;
1224 
1225  if (vert_align != va)
1226  vert_align = va;
1227 }

References hor_align, and vert_align.

Referenced by ApplicationWindow::appendProject(), copy(), ApplicationWindow::loadProject(), and LayerDialog::update().

Here is the caller graph for this function:

◆ setBirthDate()

virtual void MyWidget::setBirthDate ( const QString &  s)
inlinevirtualinherited

Set the creation date.

Reimplemented in Table, and Matrix.

Definition at line 93 of file MyWidget.h.

93 {birthdate = s;};

References MyWidget::birthdate.

Referenced by ApplicationWindow::appendProject(), Note::init(), Graph3D::initPlot(), ApplicationWindow::loadProject(), MultiLayer(), ApplicationWindow::openNote(), and ApplicationWindow::openSurfacePlot().

Here is the caller graph for this function:

◆ setCaptionPolicy()

virtual void MyWidget::setCaptionPolicy ( CaptionPolicy  policy)
inlinevirtualinherited

Set the caption policy.

Reimplemented in Table, and Matrix.

Definition at line 88 of file MyWidget.h.

88 { caption_policy = policy; updateCaption(); }

References MyWidget::caption_policy, and MyWidget::updateCaption().

Referenced by RenameWindowDialog::accept(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ApplicationWindow::loadImage(), ApplicationWindow::loadProject(), ApplicationWindow::openNote(), ApplicationWindow::openSurfacePlot(), and ApplicationWindow::renameWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCols()

void MultiLayer::setCols ( int  c)

Definition at line 625 of file MultiLayer.cpp.

626 {
627  if (cols != c)
628  cols=c;
629 }

References cols.

Referenced by ApplicationWindow::appendProject(), ApplicationWindow::loadProject(), ApplicationWindow::multilayerPlot(), and LayerDialog::update().

Here is the caller graph for this function:

◆ setFolder()

void MyWidget::setFolder ( Folder f)
inlineinherited

Initializes the pointer to the parent folder of the window.

Definition at line 131 of file MyWidget.h.

131 {parentFolder = f;};

References MyWidget::parentFolder.

Referenced by Folder::addWindow(), ApplicationWindow::initBareMultilayerPlot(), ApplicationWindow::initMatrix(), ApplicationWindow::initNote(), ApplicationWindow::initPlot3D(), ApplicationWindow::initTable(), and Folder::removeWindow().

Here is the caller graph for this function:

◆ setFonts()

void MultiLayer::setFonts ( const QFont &  titleFnt,
const QFont &  scaleFnt,
const QFont &  numbersFnt,
const QFont &  legendFnt 
)

Definition at line 874 of file MultiLayer.cpp.

876 {
877  for (int i=0;i<(int)graphsList.count();i++)
878  {
879  Graph *gr=(Graph *)graphsList.at(i);
880  QwtPlot *plot=gr->plotWidget();
881 
882  QwtText text = plot->title();
883  text.setFont(titleFnt);
884  plot->setTitle(text);
885  for (int j= 0;j<QwtPlot::axisCnt;j++)
886  {
887  plot->setAxisFont (j,numbersFnt);
888 
889  text = plot->axisTitle(j );
890  text.setFont(scaleFnt);
891  plot->setAxisTitle(j, text);
892  }
893 
894  QVector<int> keys=gr->textMarkerKeys();
895  for (int k=0;k<(int)keys.size();k++)
896  {
897  Legend* mrk=(Legend*)gr->textMarker(keys[k]);
898  if (mrk)
899  mrk->setFont(legendFnt);
900  }
901  plot->replot();
902  }
903  emit modifiedPlot();
904 }

References graphsList, modifiedPlot(), Graph::plotWidget(), Legend::setFont(), Graph::textMarker(), and Graph::textMarkerKeys().

Referenced by PlotDialog::acceptParams().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGraphGeometry()

void MultiLayer::setGraphGeometry ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 368 of file MultiLayer.cpp.

369 {
370  if (active_graph->pos() == QPoint (x,y) &&
371  active_graph->size() == QSize (w,h))
372  return;
373 
374  active_graph->setGeometry(QRect(QPoint(x,y),QSize(w,h)));
375  active_graph->plotWidget()->resize(QSize(w, h));
376  emit modifiedPlot();
377 }

References active_graph, modifiedPlot(), and Graph::plotWidget().

Referenced by addTextLayer(), and ApplicationWindow::pasteSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHidden()

void MyWidget::setHidden ( )
virtualinherited

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

Definition at line 162 of file MyWidget.cpp.

163 {
164  w_status = Hidden;
165  emit statusChanged (this);
166  hide();
167 }

References MyWidget::Hidden, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::hideWindow(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setLayerCanvasSize()

void MultiLayer::setLayerCanvasSize ( int  w,
int  h 
)

Definition at line 1212 of file MultiLayer.cpp.

1213 {
1214  if (l_canvas_width != w)
1215  l_canvas_width = w;
1216  if (l_canvas_height != h)
1217  l_canvas_height = h;
1218 }

References l_canvas_height, and l_canvas_width.

Referenced by ApplicationWindow::appendProject(), ApplicationWindow::loadProject(), and LayerDialog::update().

Here is the caller graph for this function:

◆ setLayersNumber

void MultiLayer::setLayersNumber ( int  n)
slot

Definition at line 1229 of file MultiLayer.cpp.

1230 {
1231  if (graphs == n)
1232  return;
1233 
1234  int dn = graphs - n;
1235  if (dn > 0)
1236  {
1237  for (int i = 0; i < dn; i++)
1238  {//remove layer buttons
1239  LayerButton *btn=(LayerButton*)buttonsList.last();
1240  if (btn)
1241  {
1242  btn->close();
1243  buttonsList.removeLast();
1244  }
1245 
1246  Graph *g = (Graph *)graphsList.last();
1247  if (g)
1248  {//remove layers
1249  if (g->zoomOn() || g->activeTool())
1250  setPointerCursor();
1251 
1252  g->close();
1253  graphsList.removeLast();
1254  }
1255  }
1256  graphs = n;
1257  if (!graphs)
1258  {
1259  active_graph = 0;
1260  return;
1261  }
1262 
1263  // check whether the active Graph.has been deleted
1264  if(graphsList.indexOf(active_graph) == -1)
1265  active_graph=(Graph*) graphsList.last();
1266  for (int j=0;j<(int)graphsList.count();j++)
1267  {
1268  Graph *gr=(Graph *)graphsList.at(j);
1269  if (gr == active_graph)
1270  {
1271  LayerButton *button=(LayerButton *)buttonsList.at(j);
1272  button->setChecked(true);
1273  break;
1274  }
1275  }
1276  }
1277  else
1278  {
1279  for (int i = 0; i < abs(dn); i++)
1280  addLayer();
1281  }
1282 
1283  emit modifiedPlot();
1284 }

References active_graph, Graph::activeTool(), addLayer(), buttonsList, graphs, graphsList, modifiedPlot(), setPointerCursor(), and Graph::zoomOn().

Referenced by LayerDialog::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMargins()

void MultiLayer::setMargins ( int  lm,
int  rm,
int  tm,
int  bm 
)

Definition at line 1192 of file MultiLayer.cpp.

1193 {
1194  if (left_margin != lm)
1195  left_margin = lm;
1196  if (right_margin != rm)
1197  right_margin = rm;
1198  if (top_margin != tm)
1199  top_margin = tm;
1200  if (bottom_margin != bm)
1201  bottom_margin = bm;
1202 }

References bottom_margin, left_margin, right_margin, and top_margin.

Referenced by ApplicationWindow::appendProject(), ApplicationWindow::autoArrangeLayers(), copy(), ApplicationWindow::loadProject(), and LayerDialog::update().

Here is the caller graph for this function:

◆ setMaximized()

void MyWidget::setMaximized ( )
inherited

Definition at line 183 of file MyWidget.cpp.

184 {
185  showMaximized();
187  emit statusChanged (this);
188 }

References MyWidget::Maximized, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::folderItemDoubleClicked(), ApplicationWindow::maximizeWindow(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setMinimized()

void MyWidget::setMinimized ( )
inherited

Definition at line 176 of file MyWidget.cpp.

177 {
178  showMinimized();
180  emit statusChanged (this);
181 }

References MyWidget::Minimized, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::minimizeWindow(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setName()

virtual void MyWidget::setName ( const QString &  s)
inlinevirtualinherited

Set the window name.

Reimplemented in Table, and Matrix.

Definition at line 83 of file MyWidget.h.

83 {setObjectName(s); updateCaption();};

References MyWidget::updateCaption().

Referenced by ApplicationWindow::dataPlot3D(), ApplicationWindow::dataPlotXYZ(), ApplicationWindow::initBareMultilayerPlot(), ApplicationWindow::initNote(), ApplicationWindow::newPlot3D(), ApplicationWindow::openMatrixPlot3D(), ApplicationWindow::plot3DMatrix(), and ApplicationWindow::renameWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNormal()

void MyWidget::setNormal ( )
inherited

Definition at line 169 of file MyWidget.cpp.

170 {
171  showNormal();
172  w_status = Normal;
173  emit statusChanged (this);
174 }

References MyWidget::Normal, MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::activateSubWindow(), ApplicationWindow::folderItemDoubleClicked(), and ApplicationWindow::openTemplate().

Here is the caller graph for this function:

◆ setPointerCursor

void MultiLayer::setPointerCursor ( )
signal

Referenced by removeLayer(), and setLayersNumber().

Here is the caller graph for this function:

◆ setRows()

void MultiLayer::setRows ( int  r)

Definition at line 631 of file MultiLayer.cpp.

632 {
633  if (rows != r)
634  rows=r;
635 }

References rows.

Referenced by ApplicationWindow::appendProject(), ApplicationWindow::loadProject(), ApplicationWindow::multilayerPlot(), and LayerDialog::update().

Here is the caller graph for this function:

◆ setScaleLayersOnPrint()

void MultiLayer::setScaleLayersOnPrint ( bool  on)
inline

Definition at line 94 of file MultiLayer.h.

94 {d_scale_on_print = on;};

References d_scale_on_print.

Referenced by PlotDialog::acceptParams(), and ApplicationWindow::initBareMultilayerPlot().

Here is the caller graph for this function:

◆ setSpacing()

void MultiLayer::setSpacing ( int  rgap,
int  cgap 
)

Definition at line 1204 of file MultiLayer.cpp.

1205 {
1206  if (rowsSpace != rgap)
1207  rowsSpace = rgap;
1208  if (colsSpace != cgap)
1209  colsSpace = cgap;
1210 }

References colsSpace, and rowsSpace.

Referenced by ApplicationWindow::appendProject(), ApplicationWindow::autoArrangeLayers(), copy(), ApplicationWindow::loadProject(), and LayerDialog::update().

Here is the caller graph for this function:

◆ setStatus()

void MyWidget::setStatus ( Status  s)
inherited

Set the window status flag (hidden, normal, minimized or maximized)

Definition at line 153 of file MyWidget.cpp.

154 {
155  if (w_status == s)
156  return;
157 
158  w_status = s;
159  emit statusChanged (this);
160 }

References MyWidget::statusChanged(), and MyWidget::w_status.

Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::restoreWindowGeometry(), and ApplicationWindow::updateWindowStatus().

Here is the caller graph for this function:

◆ setWindowLabel()

virtual void MyWidget::setWindowLabel ( const QString &  s)
inlinevirtualinherited

Set the window label.

Reimplemented in Table, and Matrix.

Definition at line 78 of file MyWidget.h.

78 { w_label = s; updateCaption();};

References MyWidget::updateCaption(), and MyWidget::w_label.

Referenced by RenameWindowDialog::accept(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ImportOPJ::importGraphs(), ImportOPJ::importNotes(), ApplicationWindow::loadImage(), ApplicationWindow::loadProject(), ApplicationWindow::openNote(), and ApplicationWindow::openSurfacePlot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showAxisDialog

void MultiLayer::showAxisDialog ( int  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showCurveContextMenu

void MultiLayer::showCurveContextMenu ( int  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showCurvesDialog

void MultiLayer::showCurvesDialog ( )
signal

Referenced by addLayerButton().

Here is the caller graph for this function:

◆ showGeometryDialog

void MultiLayer::showGeometryDialog ( )
signal

◆ showGraphContextMenu

void MultiLayer::showGraphContextMenu ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showImageDialog

void MultiLayer::showImageDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showLayerButtonContextMenu

void MultiLayer::showLayerButtonContextMenu ( )
signal

Referenced by addLayerButton(), and connectLayer().

Here is the caller graph for this function:

◆ showLineDialog

void MultiLayer::showLineDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showMarkerPopupMenu

void MultiLayer::showMarkerPopupMenu ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showPlotDialog

void MultiLayer::showPlotDialog ( int  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showRightAxisTitleDialog

void MultiLayer::showRightAxisTitleDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showScaleDialog

void MultiLayer::showScaleDialog ( int  )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showTextDialog

void MultiLayer::showTextDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showTitleBarMenu

void MyWidget::showTitleBarMenu ( )
signalinherited

Emitted when the title bar recieves a QContextMenuEvent.

Referenced by Graph3D::contextMenuEvent(), MyWidget::contextMenuEvent(), and mousePressEvent().

Here is the caller graph for this function:

◆ showTopAxisTitleDialog

void MultiLayer::showTopAxisTitleDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showWindowContextMenu

void MultiLayer::showWindowContextMenu ( )
signal

Referenced by contextMenuEvent(), and keyPressEvent().

Here is the caller graph for this function:

◆ showXAxisTitleDialog

void MultiLayer::showXAxisTitleDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ showYAxisTitleDialog

void MultiLayer::showYAxisTitleDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ status()

Status MyWidget::status ( )
inlineinherited

Return the window status flag (hidden, normal, minimized or maximized)

Definition at line 98 of file MyWidget.h.

98 {return w_status;};

References MyWidget::w_status.

Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::clone(), ApplicationWindow::openTemplate(), ApplicationWindow::showAllFolderWindows(), ApplicationWindow::updateWindowStatus(), and ApplicationWindow::windowGeometryInfo().

Here is the caller graph for this function:

◆ statusChanged

void MyWidget::statusChanged ( MyWidget )
signalinherited

Emitted when the window status changed.

Referenced by MyWidget::changeEvent(), MyWidget::setHidden(), MyWidget::setMaximized(), MyWidget::setMinimized(), MyWidget::setNormal(), and MyWidget::setStatus().

Here is the caller graph for this function:

◆ topMargin()

int MultiLayer::topMargin ( )
inline

Definition at line 147 of file MultiLayer.h.

147 {return top_margin;};

References top_margin.

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

Here is the caller graph for this function:

◆ updateCaption

void MyWidget::updateCaption ( )
protectedslotinherited

Set caption according to current CaptionPolicy, name and label.

Definition at line 52 of file MyWidget.cpp.

53 {
54  switch (caption_policy)
55  {
56  case Name:
57  setWindowTitle(name());
58  break;
59 
60  case Label:
61  if (!windowLabel().isEmpty())
62  setWindowTitle(windowLabel());
63  else
64  setWindowTitle(name());
65  break;
66 
67  case Both:
68  if (!windowLabel().isEmpty())
69  setWindowTitle(name() + " - " + windowLabel());
70  else
71  setWindowTitle(name());
72  break;
73  }
74 };

References MyWidget::Both, MyWidget::caption_policy, MyWidget::Label, MyWidget::Name, MyWidget::name(), and MyWidget::windowLabel().

Referenced by Matrix::handleAspectDescriptionChange(), Table::handleAspectDescriptionChange(), Matrix::setCaptionPolicy(), MyWidget::setCaptionPolicy(), Table::setCaptionPolicy(), MyWidget::setName(), Matrix::setWindowLabel(), MyWidget::setWindowLabel(), and Table::setWindowLabel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verticalAlignement()

int MultiLayer::verticalAlignement ( )
inline

Definition at line 155 of file MultiLayer.h.

155 {return vert_align;};

References vert_align.

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

Here is the caller graph for this function:

◆ viewTitleDialog

void MultiLayer::viewTitleDialog ( )
signal

Referenced by connectLayer().

Here is the caller graph for this function:

◆ wheelEvent()

void MultiLayer::wheelEvent ( QWheelEvent *  e)

Definition at line 1023 of file MultiLayer.cpp.

1024 {
1025  QApplication::setOverrideCursor(Qt::WaitCursor);
1026 
1027  bool resize=false;
1028  QPoint aux;
1029  QSize intSize;
1030  Graph *resize_graph = 0;
1031  // Get the position of the mouse
1032  int xMouse=e->x();
1033  int yMouse=e->y();
1034  for (int i=0;i<(int)graphsList.count();i++)
1035  {
1036  Graph *gr=(Graph *)graphsList.at(i);
1037  intSize=gr->plotWidget()->size();
1038  aux=gr->pos();
1039  if(xMouse>aux.x() && xMouse<(aux.x()+intSize.width()))
1040  {
1041  if(yMouse>aux.y() && yMouse<(aux.y()+intSize.height()))
1042  {
1043  resize_graph=gr;
1044  resize=true;
1045  }
1046  }
1047  }
1048  if(resize && (e->modifiers()==Qt::AltModifier || e->modifiers()==Qt::ControlModifier || e->modifiers()==Qt::ShiftModifier))
1049  {
1050  intSize=resize_graph->plotWidget()->size();
1051  // If alt is pressed then change the width
1052  if(e->modifiers()==Qt::AltModifier)
1053  {
1054  if(e->delta()>0)
1055  {
1056  intSize.rwidth()+=5;
1057  }
1058  else if(e->delta()<0)
1059  {
1060  intSize.rwidth()-=5;
1061  }
1062  }
1063  // If crt is pressed then changed the height
1064  else if(e->modifiers()==Qt::ControlModifier)
1065  {
1066  if(e->delta()>0)
1067  {
1068  intSize.rheight()+=5;
1069  }
1070  else if(e->delta()<0)
1071  {
1072  intSize.rheight()-=5;
1073  }
1074  }
1075  // If shift is pressed then resize
1076  else if(e->modifiers()==Qt::ShiftModifier)
1077  {
1078  if(e->delta()>0)
1079  {
1080  intSize.rwidth()+=5;
1081  intSize.rheight()+=5;
1082  }
1083  else if(e->delta()<0)
1084  {
1085  intSize.rwidth()-=5;
1086  intSize.rheight()-=5;
1087  }
1088  }
1089 
1090  aux=resize_graph->pos();
1091  resize_graph->setGeometry(QRect(QPoint(aux.x(),aux.y()),intSize));
1092  resize_graph->plotWidget()->resize(intSize);
1093 
1094  emit modifiedPlot();
1095  }
1096  QApplication::restoreOverrideCursor();
1097 }

References graphsList, modifiedPlot(), and Graph::plotWidget().

Here is the call graph for this function:

◆ windowLabel()

virtual QString MyWidget::windowLabel ( )
inlinevirtualinherited

Return the window label.

Reimplemented in Table, and Matrix.

Definition at line 76 of file MyWidget.h.

76 {return QString(w_label);};

References MyWidget::w_label.

Referenced by RenameWindowDialog::accept(), ApplicationWindow::addListViewItem(), ApplicationWindow::clone(), Folder::findWindow(), Graph3D::saveToString(), saveToString(), Note::saveToString(), RenameWindowDialog::setWidget(), and MyWidget::updateCaption().

Here is the caller graph for this function:

Member Data Documentation

◆ active_graph

◆ addTextOn

bool MultiLayer::addTextOn
private

Definition at line 224 of file MultiLayer.h.

Referenced by addTextLayer(), eventFilter(), and MultiLayer().

◆ askOnClose

bool MyWidget::askOnClose
protectedinherited

Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.

Definition at line 175 of file MyWidget.h.

Referenced by MyWidget::askOnCloseEvent(), Matrix::closeEvent(), MyWidget::closeEvent(), Table::closeEvent(), and MyWidget::MyWidget().

◆ birthdate

QString MyWidget::birthdate
protectedinherited

◆ bottom_margin

int MultiLayer::bottom_margin
private

◆ buttonsList

QWidgetList MultiLayer::buttonsList
private

◆ canvas

◆ caption_policy

◆ cols

int MultiLayer::cols
private

◆ colsSpace

int MultiLayer::colsSpace
private

◆ d_layers_selector

QPointer<SelectionMoveResizer> MultiLayer::d_layers_selector
private

Definition at line 236 of file MultiLayer.h.

Referenced by arrangeLayers(), keyPressEvent(), mousePressEvent(), and setActiveGraph().

◆ d_print_cropmarks

bool MultiLayer::d_print_cropmarks
private

◆ d_scale_on_print

bool MultiLayer::d_scale_on_print
private

◆ defaultTextMarkerBackground

QColor MultiLayer::defaultTextMarkerBackground
private

Definition at line 230 of file MultiLayer.h.

Referenced by addTextLayer().

◆ defaultTextMarkerColor

QColor MultiLayer::defaultTextMarkerColor
private

Definition at line 230 of file MultiLayer.h.

Referenced by addTextLayer().

◆ defaultTextMarkerFont

QFont MultiLayer::defaultTextMarkerFont
private

Definition at line 229 of file MultiLayer.h.

Referenced by addTextLayer().

◆ defaultTextMarkerFrame

int MultiLayer::defaultTextMarkerFrame
private

Used when adding text markers on new layers.

Definition at line 228 of file MultiLayer.h.

Referenced by addTextLayer().

◆ graph_height

int MultiLayer::graph_height
private

Definition at line 221 of file MultiLayer.h.

Referenced by addLayer(), and MultiLayer().

◆ graph_width

int MultiLayer::graph_width
private

Definition at line 221 of file MultiLayer.h.

Referenced by addLayer(), and MultiLayer().

◆ graphs

int MultiLayer::graphs
private

Used for resizing of layers.

Definition at line 221 of file MultiLayer.h.

Referenced by addLayerButton(), arrangeLayers(), confirmRemoveLayer(), findBestLayout(), isEmpty(), layers(), MultiLayer(), removeLayer(), and setLayersNumber().

◆ graphsList

◆ hor_align

int MultiLayer::hor_align
private

◆ l_canvas_height

int MultiLayer::l_canvas_height
private

◆ l_canvas_width

int MultiLayer::l_canvas_width
private

◆ lastSize

QSize MultiLayer::lastSize
private

Definition at line 217 of file MultiLayer.h.

Referenced by MultiLayer(), and resizeLayers().

◆ layerButtonsBox

QHBoxLayout* MultiLayer::layerButtonsBox
private

Definition at line 233 of file MultiLayer.h.

Referenced by addLayerButton(), and MultiLayer().

◆ left_margin

int MultiLayer::left_margin
private

◆ parentFolder

Folder* MyWidget::parentFolder
protectedinherited

Pointer to the parent folder of the window.

Definition at line 159 of file MyWidget.h.

Referenced by MyWidget::folder(), and MyWidget::setFolder().

◆ right_margin

int MultiLayer::right_margin
private

◆ rows

int MultiLayer::rows
private

◆ rowsSpace

int MultiLayer::rowsSpace
private

◆ top_margin

int MultiLayer::top_margin
private

◆ vert_align

int MultiLayer::vert_align
private

◆ w_label

QString MyWidget::w_label
protectedinherited

The window label.

See also
setWindowLabel(), windowLabel(), setCaptionPolicy()

Definition at line 164 of file MyWidget.h.

Referenced by MyWidget::MyWidget(), MyWidget::setWindowLabel(), and MyWidget::windowLabel().

◆ w_status


The documentation for this class was generated from the following files:
MultiLayer::resizeLayers
void resizeLayers(const QResizeEvent *re)
Definition: MultiLayer.cpp:232
MultiLayer::graph_height
int graph_height
Definition: MultiLayer.h:221
Graph::print
void print()
Definition: Graph.cpp:1429
MultiLayer::colsSpace
int colsSpace
Definition: MultiLayer.h:221
MultiLayer::setSpacing
void setSpacing(int rgap, int cgap)
Definition: MultiLayer.cpp:1204
MyWidget::Label
@ Label
caption detemined by the window label
Definition: MyWidget.h:70
Graph::enableAxes
void enableAxes(QVector< bool > axesOn)
Definition: Graph.cpp:321
Graph::ignoresResizeEvents
bool ignoresResizeEvents()
Definition: Graph.h:644
MultiLayer::colsSpacing
int colsSpacing()
Definition: MultiLayer.h:141
MultiLayer::addTextLayer
void addTextLayer(int f, const QFont &font, const QColor &textCol, const QColor &backgroundCol)
Start adding a text layer.
Definition: MultiLayer.cpp:934
MyWidget::caption_policy
CaptionPolicy caption_policy
The caption policy.
Definition: MyWidget.h:173
MyWidget::Maximized
@ Maximized
Definition: MyWidget.h:73
MultiLayer::defaultTextMarkerBackground
QColor defaultTextMarkerBackground
Definition: MultiLayer.h:230
Graph::removeLegend
void removeLegend()
Definition: Graph.cpp:1758
MultiLayer::showCurvesDialog
void showCurvesDialog()
MultiLayer::createTable
void createTable(const QString &, const QString &, QList< Column * >)
MyWidget::MyWidget
MyWidget(const QString &label=QString(), QWidget *parent=0, const QString name=0, Qt::WindowFlags f=0)
Constructor.
Definition: MyWidget.cpp:42
MyWidget::parentFolder
Folder * parentFolder
Pointer to the parent folder of the window.
Definition: MyWidget.h:159
MultiLayer::printAllLayers
void printAllLayers(QPainter *painter)
Definition: MultiLayer.cpp:803
MultiLayer::leftMargin
int leftMargin()
Definition: MultiLayer.h:145
MultiLayer::showImageDialog
void showImageDialog()
MyWidget::statusChanged
void statusChanged(MyWidget *)
Emitted when the window status changed.
MultiLayer::showPlotDialog
void showPlotDialog(int)
MultiLayer::cols
int cols
Definition: MultiLayer.h:221
MyWidget::Normal
@ Normal
Definition: MyWidget.h:73
MultiLayer::removeLayer
void removeLayer()
Definition: MultiLayer.cpp:313
MultiLayer::rightMargin
int rightMargin()
Definition: MultiLayer.h:146
MultiLayer::verticalAlignement
int verticalAlignement()
Definition: MultiLayer.h:155
MultiLayer::active_graph
Graph * active_graph
Definition: MultiLayer.h:219
MyWidget::Minimized
@ Minimized
Definition: MyWidget.h:73
MyWidget::showTitleBarMenu
void showTitleBarMenu()
Emitted when the title bar recieves a QContextMenuEvent.
MyWidget::windowLabel
virtual QString windowLabel()
Return the window label.
Definition: MyWidget.h:76
MultiLayer::right_margin
int right_margin
Definition: MultiLayer.h:222
Graph::setScaleOnPrint
void setScaleOnPrint(bool on)
Definition: Graph.h:236
MultiLayer::exportImage
void exportImage(const QString &fileName, int quality=-1)
Definition: MultiLayer.cpp:662
MyWidget::captionPolicy
virtual CaptionPolicy captionPolicy()
Return the caption policy.
Definition: MyWidget.h:86
FitData::fit
Fit * fit
Definition: fit_gsl.h:48
MyWidget::birthdate
QString birthdate
The creation date.
Definition: MyWidget.h:166
MultiLayer::d_print_cropmarks
bool d_print_cropmarks
Definition: MultiLayer.h:225
MultiLayer::horizontalAlignement
int horizontalAlignement()
Definition: MultiLayer.h:154
MyWidget::name
virtual QString name()
Return the window name.
Definition: MyWidget.h:81
Graph::setTextMarkerDefaults
void setTextMarkerDefaults(int f, const QFont &font, const QColor &textCol, const QColor &backgroundCol)
Definition: Graph.cpp:4976
Graph::exportPainter
void exportPainter(QPaintDevice &paintDevice, bool keepAspect=false, QRect rect=QRect())
Definition: Graph.cpp:1502
MultiLayer::canvas
QWidget * canvas
Definition: MultiLayer.h:234
MultiLayer::showMarkerPopupMenu
void showMarkerPopupMenu()
MultiLayer::showWindowContextMenu
void showWindowContextMenu()
MultiLayer::graphs
int graphs
Used for resizing of layers.
Definition: MultiLayer.h:221
MultiLayer::createIntensityTable
void createIntensityTable(const QString &)
MultiLayer::Right
@ Right
Definition: MultiLayer.h:78
MultiLayer::l_canvas_height
int l_canvas_height
Definition: MultiLayer.h:223
MyWidget::resizedWindow
void resizedWindow(MyWidget *)
MultiLayer::setGraphGeometry
void setGraphGeometry(int x, int y, int w, int h)
Definition: MultiLayer.cpp:368
MultiLayer::topMargin
int topMargin()
Definition: MultiLayer.h:147
MyWidget::birthDate
virtual QString birthDate()
Return the creation date.
Definition: MyWidget.h:91
MultiLayer::top_margin
int top_margin
Definition: MultiLayer.h:222
MultiLayer::modifiedPlot
void modifiedPlot()
MultiLayer::exportPainter
void exportPainter(QPaintDevice &paintDevice, bool keepAspect=false, QRect rect=QRect())
Definition: MultiLayer.cpp:730
MyWidget::modifiedWindow
void modifiedWindow(MyWidget *)
MultiLayer::showAxisDialog
void showAxisDialog(int)
MultiLayer::HCenter
@ HCenter
Definition: MultiLayer.h:78
MultiLayer::addTextOn
bool addTextOn
Definition: MultiLayer.h:224
MultiLayer::d_scale_on_print
bool d_scale_on_print
Definition: MultiLayer.h:225
MultiLayer::bottom_margin
int bottom_margin
Definition: MultiLayer.h:222
MultiLayer::exportSVG
void exportSVG(const QString &fname)
Definition: MultiLayer.cpp:715
MultiLayer::connectLayer
void connectLayer(Graph *g)
Definition: MultiLayer.cpp:906
MultiLayer::drawTextOff
void drawTextOff()
FitData::Y
double * Y
Definition: fit_gsl.h:46
MultiLayer::defaultTextMarkerFont
QFont defaultTextMarkerFont
Definition: MultiLayer.h:229
Graph::textMarkerKeys
QVector< int > textMarkerKeys()
Definition: Graph.h:352
MultiLayer::layerButtonsBox
QHBoxLayout * layerButtonsBox
Definition: MultiLayer.h:233
MultiLayer::activateGraph
void activateGraph(LayerButton *button)
Definition: MultiLayer.cpp:184
MultiLayer::lastSize
QSize lastSize
Definition: MultiLayer.h:217
MultiLayer::showRightAxisTitleDialog
void showRightAxisTitleDialog()
MultiLayer::rowsSpace
int rowsSpace
Definition: MultiLayer.h:221
Graph::textMarker
Legend * textMarker(long id)
Definition: Graph.cpp:2682
Graph::newLegend
Legend * newLegend()
Definition: Graph.cpp:2485
FitData::X
double * X
Definition: fit_gsl.h:45
MultiLayer::findBestLayout
void findBestLayout(int &rows, int &cols)
Definition: MultiLayer.cpp:544
Graph::plotWidget
Plot * plotWidget() const
Accessor method for d_plot.
Definition: Graph.h:155
MultiLayer::showLayerButtonContextMenu
void showLayerButtonContextMenu()
MultiLayer::VCenter
@ VCenter
Definition: MultiLayer.h:79
MultiLayer::showGraphContextMenu
void showGraphContextMenu()
Legend::setFont
void setFont(const QFont &font)
Definition: Legend.cpp:189
MultiLayer::Bottom
@ Bottom
Definition: MultiLayer.h:79
MultiLayer::viewTitleDialog
void viewTitleDialog()
Graph::scaleFonts
void scaleFonts(double factor)
Definition: Graph.cpp:4161
Graph::autoscaleFonts
bool autoscaleFonts()
Definition: Graph.h:656
MyWidget::w_status
Status w_status
The window status.
Definition: MyWidget.h:168
MultiLayer::d_layers_selector
QPointer< SelectionMoveResizer > d_layers_selector
Definition: MultiLayer.h:236
MultiLayer::showTopAxisTitleDialog
void showTopAxisTitleDialog()
MultiLayer::defaultTextMarkerColor
QColor defaultTextMarkerColor
Definition: MultiLayer.h:230
MultiLayer::buttonsList
QWidgetList buttonsList
Definition: MultiLayer.h:232
MultiLayer::setMargins
void setMargins(int lm, int rm, int tm, int bm)
Definition: MultiLayer.cpp:1192
MyWidget::Name
@ Name
caption determined by the window name
Definition: MyWidget.h:69
Plot
Plot window class.
Definition: Plot.h:44
FitData::p
size_t p
Definition: fit_gsl.h:44
FitData::n
size_t n
Definition: fit_gsl.h:43
MyWidget::Hidden
@ Hidden
Definition: MyWidget.h:73
MultiLayer::showTextDialog
void showTextDialog()
MultiLayer::left_margin
int left_margin
Definition: MultiLayer.h:222
MultiLayer::graph_width
int graph_width
Definition: MultiLayer.h:221
MyWidget::setBirthDate
virtual void setBirthDate(const QString &s)
Set the creation date.
Definition: MyWidget.h:93
MyWidget::closedWindow
void closedWindow(MyWidget *)
Emitted when the window was closed.
MultiLayer::showScaleDialog
void showScaleDialog(int)
Legend::rect
QRect rect() const
Bounding rectangle in paint coordinates.
Definition: Legend.cpp:106
MultiLayer::setAlignement
void setAlignement(int ha, int va)
Definition: MultiLayer.cpp:1220
MultiLayer::defaultTextMarkerFrame
int defaultTextMarkerFrame
Used when adding text markers on new layers.
Definition: MultiLayer.h:228
Graph::copy
void copy(ApplicationWindow *parent, Graph *g)
Definition: Graph.cpp:4537
Graph::setAutoscaleFonts
void setAutoscaleFonts(bool yes)
Definition: Graph.h:657
MultiLayer::drawLineEnded
void drawLineEnded(bool)
MyWidget::Both
@ Both
caption = "name - label"
Definition: MyWidget.h:71
Graph::saveToString
QString saveToString(bool saveAsTemplate=false)
Definition: Graph.cpp:4060
SelectionMoveResizer
Handler for modifying one or more QWidget and/or QwtPlotMarker with mouse or keyboard.
Definition: SelectionMoveResizer.h:90
MultiLayer::graphsList
QWidgetList graphsList
Definition: MultiLayer.h:232
MultiLayer::cursorInfo
void cursorInfo(const QString &)
MultiLayer::showXAxisTitleDialog
void showXAxisTitleDialog()
LayerButton::btnSize
static int btnSize()
Definition: MultiLayer.h:249
Graph
A 2D-plotting widget.
Definition: Graph.h:119
MyWidget::hiddenWindow
void hiddenWindow(MyWidget *)
Emitted when the window was hidden.
MultiLayer::exportVector
void exportVector(const QString &fileName, int res=0, bool color=true, bool keepAspect=true, QPrinter::PageSize pageSize=QPrinter::Custom, QPrinter::Orientation orientation=QPrinter::Portrait)
Definition: MultiLayer.cpp:674
MultiLayer::Top
@ Top
Definition: MultiLayer.h:79
MultiLayer::showLineDialog
void showLineDialog()
MultiLayer::addLayer
Graph * addLayer(int x=0, int y=0, int width=0, int height=0)
Definition: MultiLayer.cpp:164
MyWidget::askOnClose
bool askOnClose
Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
Definition: MyWidget.h:175
MultiLayer::graphPtrs
QWidgetList graphPtrs()
Definition: MultiLayer.h:72
MultiLayer::vert_align
int vert_align
Definition: MultiLayer.h:223
LayerButton
Button with layer number.
Definition: MultiLayer.h:242
MyWidget::updateCaption
void updateCaption()
Set caption according to current CaptionPolicy, name and label.
Definition: MyWidget.cpp:52
MultiLayer::addLayerButton
LayerButton * addLayerButton()
Definition: MultiLayer.cpp:146
MultiLayer::showYAxisTitleDialog
void showYAxisTitleDialog()
Graph::focusNextPrevChild
bool focusNextPrevChild(bool next)
Definition: Graph.cpp:5266
Graph::zoomOn
bool zoomOn()
Definition: Graph.cpp:3725
Graph::activeTool
PlotToolInterface * activeTool() const
Return the active tool, or NULL if none is active.
Definition: Graph.h:147
MultiLayer::bottomMargin
int bottomMargin()
Definition: MultiLayer.h:148
MultiLayer::showCurveContextMenu
void showCurveContextMenu(int)
MultiLayer::hor_align
int hor_align
Definition: MultiLayer.h:223
MultiLayer::setPointerCursor
void setPointerCursor()
MultiLayer::Left
@ Left
Definition: MultiLayer.h:78
MultiLayer::arrangeLayers
QSize arrangeLayers(bool userSize)
Definition: MultiLayer.cpp:379
MyWidget::w_label
QString w_label
The window label.
Definition: MyWidget.h:164
MyWidget::aspect
QString aspect()
Return the window status as a string.
Definition: MyWidget.cpp:106
MultiLayer::rowsSpacing
int rowsSpacing()
Definition: MultiLayer.h:142
Graph::printCropmarks
void printCropmarks(bool on)
Definition: Graph.h:237
MultiLayer::rows
int rows
Definition: MultiLayer.h:221
Graph::setTitle
void setTitle(const QString &t)
Definition: Graph.cpp:1732
Legend
A piece of text to be drawn on a Plot.
Definition: Legend.h:56
Graph::setIgnoreResizeEvents
void setIgnoreResizeEvents(bool ok)
Definition: Graph.h:645
MultiLayer::setActiveGraph
void setActiveGraph(Graph *g)
Definition: MultiLayer.cpp:202
MultiLayer::l_canvas_width
int l_canvas_width
Definition: MultiLayer.h:223