Graph* MultiLayer::addLayer() { addLayerButton(); Graph* g = new Graph(canvas,0,WDestructiveClose); g->setGeometry(QRect(0,0,graph_width, graph_height)); g->plotWidget()->resize(QSize(graph_width, graph_height)); graphsList->append(g); active_graph=g; g->show(); connectLayer(g); return g; }
Graph* MultiLayer::insertFirstLayer() { LayerButton *btn = addLayerButton(); Graph* g = new Graph(canvas,0,0); g->setGeometry(QRect(0,0,graph_width,graph_height)); g->plotWidget()->resize(QSize(graph_width,graph_height)); connectLayer(g); setGeometry(QRect(0, 0,graphs*graph_width,rows*graph_height+btn->height())); g->setIgnoreResizeEvents(true); active_graph=g; graphsList->append(g); return g; }
Graph *MultiLayer::addLayer(int x, int y, int width, int height) { addLayerButton(); if (!width && !height) { width = graph_width; height = graph_height; } removeLayoutButton->setEnabled(true); Graph *g = new Graph(canvas); g->setAttribute(Qt::WA_DeleteOnClose); g->setGeometry(x, y, width, height); g->plotWidget()->resize(QSize(width, height)); graphsList.append(g); active_graph = g; g->show(); connectLayer(g); return g; }
Graph* MultiLayer::addLayer(int x, int y, int width, int height) { addLayerButton(); if (!width && !height){ width = canvas->width() - left_margin - right_margin - (d_cols - 1)*colsSpace; height = canvas->height() - top_margin - left_margin - (d_rows - 1)*rowsSpace; int layers = graphsList.size(); x = left_margin + (layers % d_cols)*(width + colsSpace); y = top_margin + (layers / d_cols)*(height + rowsSpace); } Graph* g = new Graph(x, y, width, height, canvas); g->show(); graphsList.append(g); active_graph = g; connectLayer(g); return g; }
Graph* MultiLayer::addLayerToOrigin() { addLayerButton(); Graph* g = new Graph(canvas,0,0); g->removeLegend(); int w = canvas->width(); int h = canvas->height(); g->setGeometry(QRect(0, 0, w, h)); g->plotWidget()->resize(QSize(w,h)); graphsList->append(g); connectLayer(g); active_graph=g; makeTransparentLayer(g); g->show(); emit modifiedPlot(); return g; }
void MultiLayer::addTextLayer(const QPoint& pos) { Graph* g=addLayer(); g->setTitle(""); QMemArray<bool> axesOn(4); for (int j=0;j<4;j++) axesOn[j]=FALSE; g->enableAxes(axesOn); g->plotWidget()->setLineWidth(1); g->setIgnoreResizeEvents(true); QSize size=g->newLegend(tr("enter your text here")); setGraphGeometry(pos.x(), pos.y(), size.width()+10, size.height()+10); g->setIgnoreResizeEvents(false); g->show(); connectLayer(g); QApplication::restoreOverrideCursor(); canvas->releaseMouse(); addTextOn=FALSE; emit drawTextOff(); emit modifiedPlot(); }
void Layer::operator <<( Layer* prevLayer) { connectLayer(prevLayer); }
void Layer::operator << (Layer& prevLayer) { //-- Same as connectLayer(), but nicer connectLayer(prevLayer); }