node *matrixDraw(int row,int column) { GLfloatPoint point1,point2,point3; int i=0; node *head = gridDraw(row,column),*head1 = gridDraw(row,column); for(i=0;i<head->point.x;i++) { point1=popPoint(head); point2.x=point1.x ; point2.y=point1.y + heightOfOneGrid; point3.x=point1.x + widthOfOneGrid; point3.y=point1.y; drawLine(point1,point2); drawLine(point1,point3); glFlush(); } return head1; }
void MainWindow::createElements() { QMenu *fileMenu = new QMenu(tr("&File"), this); menuBar()->addMenu(fileMenu); QMenu *viewMenu = new QMenu(tr("&View"), this); menuBar()->addMenu(viewMenu); QMenu *selectMenu = new QMenu(tr("&Selection"), this); menuBar()->addMenu(selectMenu); QMenu *helpMenu = new QMenu(tr("&Help"), this); menuBar()->addMenu(helpMenu); QAction *openAct = new QAction(tr("&Open..."), this); openAct->setShortcut(tr("Ctrl+O")); connect(openAct, SIGNAL(triggered()), this, SLOT(open())); fileMenu->addAction(openAct); QAction *exitAct = new QAction(tr("E&xit"), this); exitAct->setShortcut(tr("Ctrl+Q")); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); fileMenu->addAction(exitAct); QAction *zoomInAct = new QAction(tr("Zoom &In (25%)"), this); zoomInAct->setShortcut(tr("Ctrl++")); connect(zoomInAct, SIGNAL(triggered()), this, SLOT(zoomIn())); viewMenu->addAction(zoomInAct); QAction *zoomOutAct = new QAction(tr("Zoom &Out (25%)"), this); zoomOutAct->setShortcut(tr("Ctrl+-")); connect(zoomOutAct, SIGNAL(triggered()), this, SLOT(zoomOut())); viewMenu->addAction(zoomOutAct); QAction *normalSizeAct = new QAction(tr("&Normal Size"), this); normalSizeAct->setShortcut(tr("Ctrl+0")); connect(normalSizeAct, SIGNAL(triggered()), this, SLOT(normalSize())); viewMenu->addAction(normalSizeAct); QAction *flipSectAct = new QAction(tr("&Show/Hide Section"), this); flipSectAct->setShortcut(tr("Ctrl+J")); connect(flipSectAct, SIGNAL(triggered()), this, SLOT(flipSectWin())); viewMenu->addAction(flipSectAct); QAction *flipSpecAct = new QAction(tr("&Show/Hide Spectrum"), this); flipSpecAct->setShortcut(tr("Ctrl+K")); connect(flipSpecAct, SIGNAL(triggered()), this, SLOT(flipSpecWin())); viewMenu->addAction(flipSpecAct); QAction *flipMainOptAct = new QAction(tr("&Show/Hide Image Viewer Options"), this); flipMainOptAct->setShortcut(tr("Ctrl+L")); connect(flipMainOptAct, SIGNAL(triggered()), this, SLOT(flipMainOpt())); viewMenu->addAction(flipMainOptAct); QAction *flipSectOptAct = new QAction(tr("&Show/Hide Section Viewer Options"), this); flipSectOptAct->setShortcut(tr("Ctrl+L")); connect(flipSectOptAct, SIGNAL(triggered()), this, SLOT(flipSectOpt())); viewMenu->addAction(flipSectOptAct); QAction *popAct = new QAction(tr("&Delete Last Point"), this); popAct->setShortcut(tr("Ctrl+N")); connect(popAct, SIGNAL(triggered()), this, SLOT(popPoint())); selectMenu->addAction(popAct); QAction *clearAct = new QAction(tr("&Delete All Points"), this); clearAct->setShortcut(tr("Ctrl+M")); connect(clearAct, SIGNAL(triggered()), this, SLOT(clearPoints())); selectMenu->addAction(clearAct); QAction *aboutAct = new QAction(tr("&About"), this); connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); helpMenu->addAction(aboutAct); connect(m_maincan, SIGNAL(sample()), this, SLOT(sample())); connect(m_maincan, SIGNAL(moved(float, float)), this, SLOT(showMainPixel(float, float))); connect(m_sectwin, SIGNAL(moved(float, float)), this, SLOT(mapSect(float, float))); }