コード例 #1
0
MainWindow::MainWindow(QWidget* parent)
    : QMainWindow(parent)
{
    capture = NULL;
    is_table_changed = false;
    is_cap_para_setted = false;
    is_file_opened = false;
    createactions();
    createmenus();
    createcontexmnu();
    createtoolbars();
    createstatusbar();
    createshowarea();
    createdialogs();
}
コード例 #2
0
ファイル: GUI.cpp プロジェクト: saket-j/Visualize-n-Slice
// Constructor: This call all other functions, to create the complete GUI. All the QVTKWidgets are inside a QGroupBox
// This also adds dummy rendering window to the QVTKWidgets, so that GUI is not distorted.
GUI::GUI()
{
	Setstyle();

	createactions();
	createmenu();

	centralWid = new QWidget(this);
	this->setCentralWidget(centralWid);
	
	mainLayout = new QHBoxLayout;
	createVtoolbar();
	acttoolwid = new QWidget(centralWid);
	mainLayout->addWidget(acttoolwid);
	mainLayout->setSpacing(0);
	mainLayout->setContentsMargins(0,0,0,0);
	centralWid->setContentsMargins(0,0,0,0);
	centralWid->setLayout(mainLayout);

	vLayout = new QVBoxLayout;
	createHtoolbar();
	vLayout->setSpacing(0);
	vLayout->setContentsMargins(0,0,0,0);
	acttoolwid->setContentsMargins(0,0,0,0);
	QWidget *upper = new QWidget(acttoolwid);
	QWidget *lower = new QWidget(acttoolwid);
	vLayout->addWidget(upper);
	vLayout->addWidget(lower);
	acttoolwid->setLayout(vLayout);

	QHBoxLayout *upperwidlayout = new QHBoxLayout;
	QHBoxLayout *lowerwidlayout = new QHBoxLayout;
	QGroupBox *isosurface = new QGroupBox(tr("IsoSurface"));
	QGroupBox *pathviewer = new QGroupBox(tr("Arbitrary Axis Slice Viewer"));
	QGroupBox *axialslice = new QGroupBox(tr("Axial Slice"));
	QGroupBox *coroslice = new QGroupBox(tr("Coronal Slice"));
	QGroupBox *sagislice = new QGroupBox(tr("Sagittal Slice"));
	upperwidlayout->addWidget(isosurface);		//Adding QGroupBoxes for differnt viewers
	upperwidlayout->addWidget(pathviewer);
	lowerwidlayout->addWidget(axialslice);
	lowerwidlayout->addWidget(coroslice);
	lowerwidlayout->addWidget(sagislice);
	
	upper->setLayout(upperwidlayout);
	lower->setLayout(lowerwidlayout);

	QHBoxLayout *corola = new QHBoxLayout;
	QHBoxLayout *axialla = new QHBoxLayout;
	QHBoxLayout *sagila = new QHBoxLayout;
	QHBoxLayout *araxl = new QHBoxLayout;

	corowid = new QVTKWidget(coroslice);	//Widgets that will contains diff rendering windows
	sagiwid = new QVTKWidget(sagislice);
	axiawid = new QVTKWidget(axialslice);
	isoshow = new QVTKWidget(isosurface);
	defaxwid = new QVTKWidget(pathviewer);
	
	vtkRenderer *duma = vtkRenderer::New();		//Dummy renderers
	vtkRenderer *dums = vtkRenderer::New();
	vtkRenderer *dumc = vtkRenderer::New();
	vtkRenderer *dumx = vtkRenderer::New();
	vtkRenderWindow *winda = vtkRenderWindow::New();
	vtkRenderWindow *winds = vtkRenderWindow::New();
	vtkRenderWindow *windc = vtkRenderWindow::New();
	vtkRenderWindow *windx = vtkRenderWindow::New();
	winda->AddRenderer(duma);
	windc->AddRenderer(dumc);
	winds->AddRenderer(dums);
	windx->AddRenderer(dumx);
	corowid->SetRenderWindow(dumc->GetRenderWindow());	//Adding dummy rendering windows
	sagiwid->SetRenderWindow(dums->GetRenderWindow());
	axiawid->SetRenderWindow(duma->GetRenderWindow());
	defaxwid->SetRenderWindow(dumx->GetRenderWindow());

	coroslice->setLayout(corola);
	sagislice->setLayout(sagila);
	axialslice->setLayout(axialla);
	pathviewer->setLayout(araxl);

	QWidget *corosl = new QWidget(coroslice);
	QWidget *sagisl = new QWidget(sagislice);
	QWidget *axiasl = new QWidget(axialslice);

	corola->addWidget(corowid);
	corola->addWidget(corosl);
	sagila->addWidget(sagiwid);
	sagila->addWidget(sagisl);
	axialla->addWidget(axiawid);
	axialla->addWidget(axiasl);
	araxl->addWidget(defaxwid);

	//Add slider and label
	labc = new QLabel(corosl);
	labs = new QLabel(sagisl);
	laba = new QLabel(axiasl);

	slc = new QSlider(Qt::Vertical,corosl);
	sls = new QSlider(Qt::Vertical,sagisl);
	sla = new QSlider(Qt::Vertical,axiasl);

	QVBoxLayout *sal = new QVBoxLayout;
	QVBoxLayout *axl = new QVBoxLayout;
	QVBoxLayout *col = new QVBoxLayout;
	QVBoxLayout *iso = new QVBoxLayout;

	sal->addWidget(labs);
	sal->addWidget(sls);
	axl->addWidget(laba);
	axl->addWidget(sla);
	col->addWidget(labc);
	col->addWidget(slc);
	iso->addWidget(isoshow);

	corosl->setLayout(col);
	axiasl->setLayout(axl);
	sagisl->setLayout(sal);
	isosurface->setLayout(iso);

	Disableall();
	createstatusbar();
}