#include "SimGedViewer.h"
#include "SimGedViewerScene.h"
#include <QtGui/QBoxLayout>
#include "Des.h"
#include "SimCompState.h"

namespace DESpot
{

SimGedViewer::SimGedViewer(Des* pDes, QWidget *parent)
    : QMainWindow(parent)
{
	setupUi(this);
	setWindowTitle(QString::fromStdWString(pDes->getName()));

	m_pScene = new SimGedViewerScene(pDes, this);
	setCentralWidget(m_pScene);
}

SimGedViewer::~SimGedViewer()
{
	delete m_pScene;
}

void SimGedViewer::setVisible(bool visible, bool supressSignal)
{
	if (visible)
	{
		//~TODO: enable init
		//m_pScene->init();
	}

	QMainWindow::setVisible(visible);
	if (!supressSignal)
	{
		emit visibilityChanged(visible);
	}
}

} // end of namespace
