Esempio n. 1
0
void QmitkSemanticRelationsView::OnNodesAdded(std::vector<mitk::DataNode*> nodes)
{
  mitk::SemanticTypes::CaseID caseID = "";
  for (mitk::DataNode* dataNode : nodes)
  {
    // no observer needed for the integration; simply use a temporary instance for adding
    mitk::SemanticRelationsIntegration semanticRelationsIntegration;
    AddToSemanticRelationsAction::Run(&semanticRelationsIntegration, GetDataStorage(), dataNode);
    caseID = mitk::GetCaseIDFromDataNode(dataNode);
    AddToComboBox(caseID);
  }
}
void
CNdasDevicePropGeneralPage::_InitData()
{
	//
	// Device Properties
	//
	_UpdateDeviceData();

	//
	// Unit Device Properties
	//
	m_pUnitDevices = m_pDevice->GetUnitDevices();
	DWORD nUnitDevices = m_pUnitDevices.size();

	if (0 == nUnitDevices) 
	{
		m_wndUnitDeviceType.SetWindowText(_T(""));
		_ShowUnitDeviceControls(SW_HIDE);
		m_wndNA.ShowWindow(SW_SHOW);
		m_wndUnitDeviceList.ShowWindow(SW_HIDE);
	}
	else
	{
		m_wndNA.ShowWindow(SW_HIDE);
		_ShowUnitDeviceControls(SW_SHOW);
		m_wndUnitDeviceList.ShowWindow((nUnitDevices == 1) ? SW_HIDE : SW_SHOW);
		m_wndUnitDeviceType.ShowWindow((nUnitDevices == 1) ? SW_SHOW : SW_HIDE);
		// Initiate Unit Device Information Update (async)
		m_unitDeviceUpdated.resize(m_pUnitDevices.size(), false);

		ATLASSERT(0 == m_ThreadCount);
		ATLASSERT(WAIT_OBJECT_0 == WaitForSingleObject(m_ThreadCompleted, 0));

		ATLVERIFY(ResetEvent(m_ThreadCompleted));

		std::for_each(
			m_pUnitDevices.begin(),
			m_pUnitDevices.end(),
			UpdateUnitDeviceData(this));

		std::for_each(
			m_pUnitDevices.begin(),
			m_pUnitDevices.end(),
			AddToComboBox(m_wndUnitDeviceList));

		m_wndUnitDeviceList.SetCurSel(0);
		_SetCurUnitDevice(0);
	}
}
Esempio n. 3
0
void
CDeviceGeneralPage::_InitData()
{
	//
	// Device Properties
	//
	_UpdateDeviceData();

	//
	// Unit Device Properties
	//
	m_pUnitDevices = m_pDevice->GetUnitDevices();
	DWORD nUnitDevices = m_pUnitDevices.size();

	if (0 == nUnitDevices) 
	{
		m_wndUnitDeviceType.SetWindowText(_T(""));
		_ShowUnitDeviceControls(SW_HIDE);
		m_wndNA.ShowWindow(SW_SHOW);
		m_wndUnitDeviceList.ShowWindow(SW_HIDE);
	}
	else
	{
		m_wndNA.ShowWindow(SW_HIDE);
		_ShowUnitDeviceControls(SW_SHOW);
		m_wndUnitDeviceList.ShowWindow((nUnitDevices == 1) ? SW_HIDE : SW_SHOW);
		m_wndUnitDeviceType.ShowWindow((nUnitDevices == 1) ? SW_SHOW : SW_HIDE);
		// Initiate Unit Device Information Update (async)
		m_unitDeviceUpdated.resize(m_pUnitDevices.size(), false);

		std::for_each(
			m_pUnitDevices.begin(),
			m_pUnitDevices.end(),
			UpdateUnitDeviceData(this));

		std::for_each(
			m_pUnitDevices.begin(),
			m_pUnitDevices.end(),
			AddToComboBox(m_wndUnitDeviceList));

		m_wndUnitDeviceList.SetCurSel(0);
		_SetCurUnitDevice(0);
	}
}
Esempio n. 4
0
void QmitkSemanticRelationsView::CreateQtPartControl(QWidget* parent)
{
  // create GUI widgets
  m_Controls.setupUi(parent);

  m_LesionInfoWidget = new QmitkLesionInfoWidget(GetDataStorage(), parent);
  m_Controls.gridLayout->addWidget(m_LesionInfoWidget);

  m_PatientTableInspector = new QmitkPatientTableInspector(parent);
  m_PatientTableInspector->SetDataStorage(GetDataStorage());
  m_Controls.gridLayout->addWidget(m_PatientTableInspector);

  QGridLayout* dndDataNodeWidgetLayout = new QGridLayout;
  dndDataNodeWidgetLayout->addWidget(m_PatientTableInspector, 0, 0);
  dndDataNodeWidgetLayout->setContentsMargins(0, 0, 0, 0);

  m_DnDDataNodeWidget = new QmitkDnDDataNodeWidget(parent);
  m_DnDDataNodeWidget->setLayout(dndDataNodeWidgetLayout);

  m_Controls.gridLayout->addWidget(m_DnDDataNodeWidget);

  m_ContextMenu = new QmitkSemanticRelationsContextMenu(GetSite(), m_PatientTableInspector);
  m_ContextMenu->SetDataStorage(GetDataStorage());

  mitk::IRenderWindowPart* renderWindowPart = GetRenderWindowPart();
  if (nullptr != renderWindowPart)
  {
    RenderWindowPartActivated(renderWindowPart);
  }

  SetUpConnections();

  const auto& allCaseIDs = mitk::RelationStorage::GetAllCaseIDs();
  for (const auto& caseID : allCaseIDs)
  {
    AddToComboBox(caseID);
  }
}