Beispiel #1
0
void clTreeCtrlPanel::AddFolder(const wxString& path)
{
    wxTreeItemId itemFolder = DoAddFolder(GetTreeCtrl()->GetRootItem(), path);
    DoExpandItem(itemFolder, false);
    ToggleView();
    GetTreeCtrl()->SortChildren(GetTreeCtrl()->GetRootItem());
}
Beispiel #2
0
void SceneViewerMainMenu::OnItemClicked(VMenuEventDataObject* pEvent)
{
  VDialog::OnItemClicked(pEvent);

  if (pEvent->m_pItem == m_pLoadButton)
  {
    m_bLoadNewScene = true;
  }
  else if(pEvent->m_pItem == m_pContinueButton)
  {
    ToggleView(m_pCamera);
  }
}
Beispiel #3
0
void Video::Run(){
	server = CameraServer::GetInstance();

	LiveConfigure();
	SelectFront();

	while (!myConfig->StopCapture)
	{
		// Check for a camera toggle
		if (myController->Get_ButtonState().LeftBumper) ToggleView();
		ProcessStream();
		if (myConfig->configUpdateCount > currentUpdate) LiveConfigure();
	}
}
Beispiel #4
0
bool SjCoverBrowser::OnMouseLeftDClick(wxMouseEvent& event)
{
	SjCol* cover;
	long found = FindCover(event.GetX(), event.GetY(), &cover);
	if( found == FOUND_COVER )
	{
		ToggleView();
		return true; // click used
	}
	else if( found == FOUND_COVER_ARROW )
	{
		return true; // click used (avoid toggle the view by fast clicks on the cover toggler)
	}

	return false; // click not used
}
Beispiel #5
0
void ASpaceRocksPawn::OnConstruction(const FTransform& Transform)
{
	// Call Super class function
	Super::OnConstruction(Transform);

	// Switch to first person
	ToggleView();

	CurrentXAxisSpeed = 0.f;
	CurrentZAxisSpeed = 0.f;
	CurrentYAxisSpeed = 0.f;

	FRotator SpawnRotation = GetActorRotation();
	FVector SpawnForwardVector = GetActorForwardVector();

	FRotator SALRotation(0, 0, 0);
	SetActorRotation(SALRotation);
	PlaneMesh->AddLocalRotation(SpawnForwardVector.Rotation());

}
Beispiel #6
0
void clTreeCtrlPanel::DoCloseFolder(const wxTreeItemId& item)
{
    CHECK_ITEM_RET(item);
    if(!IsTopLevelFolder(item)) return;

    if(GetConfig()) {
        // If this folder is a pinned one, remove it
        wxArrayString pinnedFolders;
        pinnedFolders = GetConfig()->Read("ExplorerFolders", pinnedFolders);
        clTreeCtrlData* d = GetItemData(item);
        int where = pinnedFolders.Index(d->GetPath());
        if(where != wxNOT_FOUND) {
            pinnedFolders.RemoveAt(where);
        }
        GetConfig()->Write("ExplorerFolders", pinnedFolders);
    }
    // Now, delete the item
    GetTreeCtrl()->Delete(item);

    ToggleView();
}
Beispiel #7
0
void clTreeCtrlPanel::OnRefresh(wxCommandEvent& event)
{
    wxArrayString paths, files;
    wxArrayTreeItemIds items, fileItems;
    GetSelections(paths, items, files, fileItems);
    if(items.IsEmpty()) return;

    // Close the selected folders
    std::vector<std::pair<wxString, bool> > topFolders;
    for(size_t i = 0; i < items.GetCount(); ++i) {
        topFolders.push_back(std::make_pair(paths.Item(i), GetTreeCtrl()->IsExpanded(items.Item(i))));
        DoCloseFolder(items.Item(i));
    }

    // Re-add them
    for(size_t i = 0; i < topFolders.size(); ++i) {
        wxTreeItemId itemFolder = DoAddFolder(GetTreeCtrl()->GetRootItem(), topFolders.at(i).first);
        DoExpandItem(itemFolder, topFolders.at(i).second);
    }
    GetTreeCtrl()->SortChildren(GetTreeCtrl()->GetRootItem());
    ToggleView();
}
Beispiel #8
0
bool SjCoverBrowser::OnSkinTargetEvent(int targetId, SjSkinValue& value, long accelFlags)
{
	bool shiftSelection = g_mainFrame->IsOpAvailable(SJ_OP_MULTI_ENQUEUE)? ((accelFlags&wxACCEL_SHIFT)!=0) : false;

	m_preservedVisible.Clear();

	//bool shiftSelection   = g_mainFrame->IsAllAvailable()? ((accelFlags&wxACCEL_SHIFT)!=0) : false;
	if( targetId >= IDT_WORKSPACE_GOTO_A && targetId <= IDT_WORKSPACE_GOTO_0_9 )
	{

		g_visModule->StopVisIfOverWorkspace();
		g_mainFrame->EndSimpleSearch();
		if( !GotoCover(g_mainFrame->m_columnMixer.GetMaskedColIndexByAz(targetId)) )
			CalcPositions(); // needed to reset a-z
		m_window->SetFocus();
		return true;
	}
	else switch( targetId )
		{
			case IDT_WORKSPACE_GOTO_RANDOM:
				g_visModule->StopVisIfOverWorkspace();
				g_mainFrame->EndSimpleSearch();
				GotoCover(SjTools::Rand(g_mainFrame->m_columnMixer.GetMaskedColCount()), true);
				m_window->SetFocus();
				return true;

			case IDT_WORKSPACE_KEY_LEFT:
				if( !g_mainFrame->IsWorkspaceMovedAway() )
					DoChangeSelection(SJ_SEL_LEFT, shiftSelection);
				return true;

			case IDT_WORKSPACE_KEY_RIGHT:
				if( !g_mainFrame->IsWorkspaceMovedAway() )
					DoChangeSelection(SJ_SEL_RIGHT, shiftSelection);
				return true;

			case IDT_WORKSPACE_KEY_UP:
				if( !g_mainFrame->IsWorkspaceMovedAway() )
					DoChangeSelection(SJ_SEL_UP, shiftSelection);
				return true;

			case IDT_WORKSPACE_KEY_DOWN:
				if( !g_mainFrame->IsWorkspaceMovedAway() )
					DoChangeSelection(SJ_SEL_DOWN, shiftSelection);
				return true;

			case IDT_WORKSPACE_V_SCROLL:
			case IDT_WORKSPACE_LINE_UP:
			case IDT_WORKSPACE_LINE_DOWN:
			case IDT_WORKSPACE_PAGE_UP:
			case IDT_WORKSPACE_PAGE_DOWN:
			case IDT_WORKSPACE_HOME: // the search should stay "as is"
			case IDT_WORKSPACE_END:
				OnVScroll(targetId, value.value, TRUE /*redraw*/);
				return true;

			case IDT_WORKSPACE_PAGE_LEFT: // this is only accessible for explicit page left/right buttons as used in the "Old-style Jukebox"
				OnVScroll(IDT_WORKSPACE_PAGE_UP, 0, TRUE /*redraw*/);
				return true;

			case IDT_WORKSPACE_PAGE_RIGHT:  // this is only accessible for explicit page left/right buttons as used in the "Old-style Jukebox"
				OnVScroll(IDT_WORKSPACE_PAGE_DOWN, 0, TRUE /*redraw*/);
				return true;

			case IDT_WORKSPACE_ENTER:
				if( FindFirstSelectedCover() )
					ToggleView();
				return true;
		}

	return false;
}
Beispiel #9
0
void SceneViewerMainMenu::OnTick(float dtime)
{
  VDialog::OnTick(dtime);

  if(VisSampleApp::GetInputMap()->GetTrigger(SCENE_LOAD_NEW_SCENE) || (m_pSceneList->Items().Count() == 1) )
  {
    m_bLoadNewScene = true;
#ifdef _VISION_MOBILE
    if (m_pSceneList->Items().Count() == 1)
        m_pSceneList->SetSelectionIndex(0);
#endif
  }

#if defined(WIN32) && ( !defined(_VISION_WINRT) || defined(_VISION_METRO) )

#elif defined(_VISION_XENON) || (defined(_VISION_WINRT) && !defined(_VISION_APOLLO))
  if (VInputManagerXenon::GetPad(0).GetRawControlValue(CT_PAD_DOWN))

#elif defined(_VISION_PS3)
  if (VInputManagerPS3::GetPad(0).GetRawControlValue(CT_PAD_DOWN))

#elif defined(_VISION_PSP2)
  if (VInputManagerPSP2::GetPad(0).GetRawControlValue(CT_PAD_DOWN))

#elif defined(_VISION_WIIU)
  if (VInputManagerWiiU::GetDRC(V_DRC_FIRST).GetRawControlValue(CT_PAD_DOWN))
  
#elif defined(_VISION_MOBILE)
  if(false)
#endif
  {
    if(!m_bButtonBHit)
    {
      m_bButtonBHit = true;
      int selected = m_pSceneList->GetSelectionIndex();
      if (++selected >= m_pSceneList->Items().Count())
      {
        selected = 0;
      }
      m_pSceneList->SetSelectionIndex(selected);
      m_pSceneList->EnsureVisible(m_pSceneList->GetSelectedItem());
    }
  }
#if !defined(WIN32) || ( defined(_VISION_WINRT) && !defined(_VISION_METRO) )
  else
  {
    m_bButtonBHit = false;
  }
#endif

#if defined(WIN32) && (!defined(_VISION_WINRT) || defined(_VISION_METRO))


#elif defined(_VISION_XENON) ||  (defined(_VISION_WINRT) && !defined(_VISION_APOLLO)) 
  if (VInputManagerXenon::GetPad(0).GetRawControlValue(CT_PAD_UP))

#elif defined(_VISION_PS3)
  if (VInputManagerPS3::GetPad(0).GetRawControlValue(CT_PAD_UP))

#elif defined(_VISION_PSP2)
  if (VInputManagerPSP2::GetPad(0).GetRawControlValue(CT_PAD_UP))

#elif defined(_VISION_WIIU)
  if (VInputManagerWiiU::GetDRC(V_DRC_FIRST).GetRawControlValue(CT_PAD_UP))

#elif defined(_VISION_MOBILE)
  if(false)
#endif
  {
    if(!m_bButtonXHit)
    {
      m_bButtonXHit = true;
      int selected = m_pSceneList->GetSelectionIndex();
      if (--selected < 0 )
      {
        selected = m_pSceneList->Items().Count()-1;
      }
      m_pSceneList->SetSelectionIndex(selected);
      m_pSceneList->EnsureVisible(m_pSceneList->GetSelectedItem());
    }
  }
#if !defined(WIN32) || (defined(_VISION_WINRT) && !defined(_VISION_METRO) && !defined(_VISION_APOLLO))
  else
  {
    m_bButtonXHit = false;
  }

  if (VisSampleApp::GetInputMap()->GetTrigger(SCENE_TOGGLE_MENU))
  {
    if(m_pCamera)
      ToggleView(m_pCamera);
  }

#endif

  if (VisSampleApp::GetInputMap()->GetTrigger(SCENE_TOGGLE_MENU))
  {
    if(m_pCamera)
      ToggleView(m_pCamera);
  }

}
Beispiel #10
0
void pdp::Toolbar::AddToolbar()
{
	//std::cout << "hi from " << __FUNCSIG__ << std::endl;

	m_Toolbar = m_ThreeDEditing->GetMainWindow()->addToolBar("tools");

	QToolButton* btn_OpenFile = new QToolButton(m_Toolbar);
	QIcon icn_OpenFile;
	icn_OpenFile.addFile(":/threeDEditing/res/threeDEditing/Open-32.png");
	btn_OpenFile->setIcon(icn_OpenFile);
	btn_OpenFile->setToolTip("Open new file.");
	btn_OpenFile->setShortcut(QKeySequence("CTRL+O"));
	m_Toolbar->addWidget(btn_OpenFile);
	QObject::connect(btn_OpenFile, SIGNAL(clicked()), this, SLOT(OpenFile()));
	
	QToolButton* btn_SaveSelectedNode = new QToolButton(m_Toolbar);
	QIcon icn_SaveSelectedNode;
	icn_SaveSelectedNode.addFile(":/threeDEditing/res/threeDEditing/Save-32.png");
	btn_SaveSelectedNode->setIcon(icn_SaveSelectedNode);
	btn_SaveSelectedNode->setToolTip("Save selected file.");
	btn_SaveSelectedNode->setShortcut(QKeySequence("CTRL+S"));
	m_Toolbar->addWidget(btn_SaveSelectedNode);
	QObject::connect(btn_SaveSelectedNode, SIGNAL(clicked()), this, SLOT(SaveSelectedNode()));

	QToolButton* btn_GetCurrentDataStorage = new QToolButton(m_Toolbar);
	QIcon icn_GetCurrentDataStorage;
	icn_GetCurrentDataStorage.addFile(":/threeDEditing/res/threeDEditing/Refresh-32.png");
	btn_GetCurrentDataStorage->setIcon(icn_GetCurrentDataStorage);
	btn_GetCurrentDataStorage->setToolTip("Load thickenings created by Pleuradat Plus.");
	m_Toolbar->addWidget(btn_GetCurrentDataStorage);
	QObject::connect(btn_GetCurrentDataStorage, SIGNAL(clicked()), this, SLOT(GetCurrentDataStorage()));

	QToolButton* btn_RemoveSelectedNode = new QToolButton(m_Toolbar);
	QIcon icn_RemoveSelectedNode;
	icn_RemoveSelectedNode.addFile(":/threeDEditing/res/threeDEditing/Delete-32.png");
	btn_RemoveSelectedNode->setIcon(icn_RemoveSelectedNode);
	btn_RemoveSelectedNode->setToolTip("Remove selected data node.");
	btn_RemoveSelectedNode->setShortcut(QKeySequence("Del"));
	m_Toolbar->addWidget(btn_RemoveSelectedNode);
	QObject::connect(btn_RemoveSelectedNode, SIGNAL(clicked()), this, SLOT(RemoveSelectedNode()));
	
	m_Toolbar->addSeparator();
	
	QToolButton* btn_Undo = new QToolButton(m_Toolbar);
	QIcon icn_Undo;
	icn_Undo.addFile(":/threeDEditing/res/threeDEditing/Undo_48.png");
	btn_Undo->setIcon(icn_Undo);
	btn_Undo->setToolTip("Undo the last action (not supported by all modules).");
	btn_Undo->setShortcut(QKeySequence("CTRL+Z"));
	m_Toolbar->addWidget(btn_Undo);
	QObject::connect(btn_Undo, SIGNAL(clicked()), this, SLOT(Undo()));

	QToolButton* btn_Redo = new QToolButton(m_Toolbar);
	QIcon icn_Redo;
	icn_Redo.addFile(":/threeDEditing/res/threeDEditing/Redo_48.png");
	btn_Redo->setIcon(icn_Redo);
	btn_Redo->setToolTip("Execute the last action that was undone again (not supported by all modules).");
	btn_Redo->setShortcut(QKeySequence("CTRL+Y"));
	m_Toolbar->addWidget(btn_Redo);
	QObject::connect(btn_Redo, SIGNAL(clicked()), this, SLOT(Redo()));

	m_Toolbar->addSeparator();

	QToolButton* btn_ToggleDataManager = new QToolButton(m_Toolbar);
	QIcon icn_ToggleDataManager;
	icn_ToggleDataManager.addFile(":/threeDEditing/res/threeDEditing/DataManager.png");
	btn_ToggleDataManager->setIcon(icn_ToggleDataManager);
	btn_ToggleDataManager->setToolTip("Toggle data manager.");
	m_Toolbar->addWidget(btn_ToggleDataManager);
	m_DataManagerToggled = true;
	btn_ToggleDataManager->setDown(true);
	QObject::connect(btn_ToggleDataManager, SIGNAL(clicked()), this, SLOT(ToggleDataManager()));


	QToolButton* btn_UseMITKSegmentationTools = new QToolButton(m_Toolbar);
	QIcon icn_UseMITKSegmentationTools;
	icn_UseMITKSegmentationTools.addFile(":/threeDEditing/res/threeDEditing/Segmentation.png");
	btn_UseMITKSegmentationTools->setIcon(icn_UseMITKSegmentationTools);
	btn_UseMITKSegmentationTools->setToolTip("Toggle tool manager.");
	m_Toolbar->addWidget(btn_UseMITKSegmentationTools);
	m_ToolManagerInitialize = true;
	m_ToolManagerToggled = false;
	btn_UseMITKSegmentationTools->setDown(false);
	QObject::connect(btn_UseMITKSegmentationTools, SIGNAL(clicked()), this, SLOT(ToggleToolManager()));

	m_Toolbar->addSeparator();

	// Surface Representation part
	QToolButton* btn_ToggleView = new QToolButton(m_Toolbar);
	QIcon icn_ToggleView;
	icn_ToggleView.addFile(":/threeDEditing/res/threeDEditing/View.png");
	btn_ToggleView->setIcon(icn_ToggleView);
	btn_ToggleView->setToolTip("Toggle surface representation: Points -> Surface -> Wireframe.");
	m_Toolbar->addWidget(btn_ToggleView);
	QObject::connect(btn_ToggleView, SIGNAL(clicked()), this, SLOT(ToggleView()));

	QToolButton* btn_ToggleSurfaceColor = new QToolButton(m_Toolbar);
	QIcon icn_ToggleSurfaceColor;
	icn_ToggleSurfaceColor.addFile(":/threeDEditing/res/threeDEditing/Color.png");
	btn_ToggleSurfaceColor->setIcon(icn_ToggleSurfaceColor);
	btn_ToggleSurfaceColor->setToolTip("Toggle color of surfaces. Show one or multiple colors.");
	m_Toolbar->addWidget(btn_ToggleSurfaceColor);
	QObject::connect(btn_ToggleSurfaceColor, SIGNAL(clicked()), this, SLOT(ToggleSurfaceColor()));

	QToolButton* btn_ToggleOrientationWidget = new QToolButton(m_Toolbar);
	QIcon icn_ToggleOrientationWidget;
	icn_ToggleOrientationWidget.addFile(":/threeDEditing/res/threeDEditing/Orientation.png");
	btn_ToggleOrientationWidget->setIcon(icn_ToggleOrientationWidget);
	btn_ToggleOrientationWidget->setToolTip("Toggle Orientation Widget.");
	m_Toolbar->addWidget(btn_ToggleOrientationWidget);
	QObject::connect(btn_ToggleOrientationWidget, SIGNAL(clicked()), this, SLOT(ToggleOrientationWidget()));

	QToolButton* btn_ToggleAnnotation = new QToolButton(m_Toolbar);
	QIcon icn_ToggleAnnotation;
	icn_ToggleAnnotation.addFile(":/threeDEditing/res/threeDEditing/Annotation.png");
	btn_ToggleAnnotation->setIcon(icn_ToggleAnnotation);
	btn_ToggleAnnotation->setToolTip("Toggle renderer window informations.");
	m_Toolbar->addWidget(btn_ToggleAnnotation);
	QObject::connect(btn_ToggleAnnotation, SIGNAL(clicked()), this, SLOT(ToggleAnnotation()));

	m_Toolbar->addSeparator();
	
	QColor color(214,247,202);
	QPalette colorPalette(color);
	m_Toolbar->setAutoFillBackground(true);
	m_Toolbar->setPalette(colorPalette);

	//std::cout << "ciao from " << __FUNCSIG__ << std::endl;	
}