예제 #1
0
void DistViewGUI::initVPActions()
{
	ui->gv->addAction(uivc->actionHq);
	uivc->hqButton->setAction(uivc->actionHq);
	vp->setDrawHQ(uivc->actionHq);
	connect(uivc->actionHq, SIGNAL(triggered()), vp, SLOT(toggleHQ()));

	ui->gv->addAction(uivc->actionLog);
	uivc->logButton->setAction(uivc->actionLog);
	vp->setDrawLog(uivc->actionLog);
	connect(uivc->actionLog, SIGNAL(triggered()), vp, SLOT(updateBuffers()));

	ui->gv->addAction(uivc->actionScr);
	uivc->screenshotButton->setAction(uivc->actionScr);
	connect(uivc->actionScr, SIGNAL(triggered()), vp, SLOT(screenshot()));

	ui->gv->addAction(uivc->actionBuff);
	connect(uivc->actionBuff, SIGNAL(triggered()), vp, SLOT(toggleBufferFormat()));
	connect(vp, SIGNAL(bufferFormatToggled(Viewport::BufferFormat)),
	        this, SLOT(updateBufferFormat(Viewport::BufferFormat)));

	ui->gv->addAction(uivc->actionRgb);
	uivc->rgbButton->setAction(uivc->actionRgb);
	vp->setDrawRGB(uivc->actionRgb);
	connect(uivc->actionRgb, SIGNAL(triggered()), vp, SLOT(updateBuffers()));

	ui->gv->addAction(uivc->actionMeans);
	vp->setDrawMeans(uivc->actionMeans);
	connect(uivc->actionMeans, SIGNAL(triggered()), vp, SLOT(rebuild()));
}
예제 #2
0
파일: viewport.cpp 프로젝트: ribalda/gerbil
void Viewport::toggleBufferFormat()
{
	switch (bufferFormat) {
	case RGBA8: bufferFormat = RGBA16F; break;
	case RGBA16F: bufferFormat = RGBA32F; break;
	case RGBA32F: bufferFormat = RGBA8; break;
	}

	// initialize buffers with new format
	initBuffers();
	updateBuffers();

	emit bufferFormatToggled(bufferFormat);
}