示例#1
0
void HeteroStructure::construct(){

  /// add bottom interface
  add_Interface( new Interface( intervals_d[0], 0.0, 0.0 ) );

  /// add bottom layer
  posvec_t bot_corner = r_min; bot_corner[2] = intervals_d[0];
  posvec_t top_corner = r_max; top_corner[2] = intervals_d[1];
  add_Layer( new Layer(eps_d[0], offset_d[0],bot_corner,top_corner ) );

  for( int ilayer = 1; ilayer < nlayers_d; ilayer++ ){

    /// add a layer
    bot_corner = r_min; bot_corner[2] = intervals_d[ilayer];
    top_corner = r_max; top_corner[2] = intervals_d[ilayer + 1];
    add_Layer( new Layer(eps_d[ ilayer ], 
			 offset_d[ ilayer ],bot_corner,top_corner ) );
    
    /// add the interface above the layer
    double diff_eps = layers[ilayer - 1]->eps_d - layers[ilayer]->eps_d;
    double av_eps = 0.5 * ( layers[ilayer-1]->eps_d + layers[ilayer]->eps_d );
    add_Interface( new Interface(intervals_d[ilayer], diff_eps, av_eps) );

  }

  add_Interface( new Interface(intervals_d[nlayers_d], 0.0, 0.0 ) );

  return;

}
示例#2
0
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();
}
示例#3
0
void Structure_Toolbar::destroy(bool)
{
	QMessageBox::StandardButton reply = QMessageBox::question(this,"Removal", "Remove substrate and all layers?", QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
	if (reply == QMessageBox::Yes)
	{
		structure_Tree->tree->clear();
		add_Layer(true);
		toolbar->actions()[2]->setDisabled(false);		// add_Substrate
		refresh_Toolbar();
	}
}