//Keyboard Work void mykey(unsigned char key, int x, int y) { //w=up, a= left, d=right, s=down, q=exit if (key == 'q' || key == 'Q') { exit(0); } if (key == 'w' || key == 'W') { move_Up(); } if (key == 's' || key == 'S') { move_Down(); } if (key == 'a' || key == 'A') { move_Left(); } if (key == 'd' || key == 'd') { move_Right(); } }
void Structure_Toolbar::create_Toolbar() { QPixmap add_Layer (icon_path + "add_layer.bmp"); QPixmap add_Multilayer (icon_path + "add_multilayer.bmp"); QPixmap add_Substrate (icon_path + "add_substrate.bmp"); QPixmap edit (icon_path + "roi.bmp"); QPixmap remove (icon_path + "delete.bmp"); QPixmap cut (icon_path + "cut.bmp"); QPixmap copy (icon_path + "copy.bmp"); QPixmap paste (icon_path + "paste.bmp"); QPixmap move_Up (icon_path + "shift_up.bmp"); QPixmap move_Down (icon_path + "shift_down.bmp"); QPixmap group (icon_path + "group.bmp"); QPixmap ungroup (icon_path + "ungroup.bmp"); QPixmap thickness_Plot (icon_path + "zplot.bmp"); QPixmap sigma_Plot (icon_path + "sigmaplot.bmp"); QPixmap destroy (icon_path + "bomb.bmp"); toolbar = new QToolBar; toolbar->addAction(QIcon(add_Layer), "Add Layer"); // 0 toolbar->addAction(QIcon(add_Multilayer), "Add Multilayer"); // 1 toolbar->addAction(QIcon(add_Substrate), "Add Substrate"); // 2 toolbar->addAction(QIcon(edit), "Edit"); // 3 toolbar->addAction(QIcon(remove), "Remove"); // 4 toolbar->addAction(QIcon(cut), "Cut"); // 5 toolbar->addAction(QIcon(copy), "Copy"); // 6 toolbar->addAction(QIcon(paste), "Paste"); // 7 toolbar->addAction(QIcon(move_Up), "Move Up"); // 8 toolbar->addAction(QIcon(move_Down), "Move Down"); // 9 toolbar->addAction(QIcon(group), "Group"); // 10 toolbar->addAction(QIcon(ungroup), "Ungroup"); // 11 toolbar->addAction(QIcon(thickness_Plot), "Plot Layer Thickness Profile"); // 12 toolbar->addAction(QIcon(sigma_Plot), "Plot Interface Width Profile"); // 13 toolbar->addAction(QIcon(destroy), "Remove Substrate and All Layers"); // 14 toolbar->setIconSize(add_Layer.size()); connect(toolbar->actions()[0], SIGNAL(triggered(bool)), this, SLOT(add_Layer(bool))); connect(toolbar->actions()[1], SIGNAL(triggered(bool)), this, SLOT(add_Multilayer(bool))); connect(toolbar->actions()[2], SIGNAL(triggered(bool)), this, SLOT(add_Substrate(bool))); connect(toolbar->actions()[3], SIGNAL(triggered(bool)), this, SLOT(edit(bool))); connect(toolbar->actions()[4], SIGNAL(triggered(bool)), this, SLOT(remove(bool))); connect(toolbar->actions()[5], SIGNAL(triggered(bool)), this, SLOT(cut(bool))); connect(toolbar->actions()[6], SIGNAL(triggered(bool)), this, SLOT(copy(bool))); connect(toolbar->actions()[7], SIGNAL(triggered(bool)), this, SLOT(paste(bool))); connect(toolbar->actions()[8], SIGNAL(triggered(bool)), this, SLOT(move_Up(bool))); connect(toolbar->actions()[9], SIGNAL(triggered(bool)), this, SLOT(move_Down(bool))); connect(toolbar->actions()[10], SIGNAL(triggered(bool)), this, SLOT(group(bool))); connect(toolbar->actions()[11], SIGNAL(triggered(bool)), this, SLOT(ungroup(bool))); connect(toolbar->actions()[12], SIGNAL(triggered(bool)), this, SLOT(thickness_Plot(bool))); connect(toolbar->actions()[13], SIGNAL(triggered(bool)), this, SLOT(sigma_Plot(bool))); connect(toolbar->actions()[14], SIGNAL(triggered(bool)), this, SLOT(destroy(bool))); if_Selected(); }