// @(#)root/eve:$Id: test_windows.C 26876 2008-12-12 14:45:40Z matevz $
// Author: Matevz Tadel

// Demonstrates usage of EVE window-manager.

#include "TEveWindow.h"
#include "TEveViewer.h"
#include "TEveManager.h"
#include "TEveBrowser.h"
#include "TEveGedEditor.h"
#include "TGLEmbeddedViewer.h"
#include "TCanvas.h"
#include "TGTab.h"

void test_windows()
{
   TEveManager::Create();

   TEveUtil::Macro("pointset_test.C");

   TEveWindowSlot  *slot  = 0;
   TEveWindowFrame *frame = 0;

   TEveViewer *v = 0;

   // ----------------------------------------------------------------

   slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());

   TEveWindowPack* pack1 = slot->MakePack();
   pack1->SetHorizontal();

   slot = pack1->NewSlot();
   // Embedded viewer.
   v = new TEveViewer("BarViewer");
   v->SpawnGLEmbeddedViewer();
   slot->ReplaceWindow(v);
   v->SetElementName("Bar Embedded Viewer");

   gEve->GetViewers()->AddElement(v);
   v->AddScene(gEve->GetEventScene());

   slot = pack1->NewSlot();   
   TEveWindowPack* pack2 = slot->MakePack();

   slot = pack2->NewSlot();
   slot->StartEmbedding();
   new TCanvas("Root Canvas");
   slot->StopEmbedding();

   slot = pack2->NewSlot();
   // SA viewer.
   v = new TEveViewer("FooViewer");
   v->SpawnGLViewer(gEve->GetEditor());
   slot->ReplaceWindow(v);

   gEve->GetViewers()->AddElement(v);
   v->AddScene(gEve->GetEventScene());   

   // ----------------------------------------------------------------

   slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());

   TEveWindowTab* tab1 = slot->MakeTab();
   slot = tab1->NewSlot();
   frame = slot->MakeFrame(new TRootEmbeddedCanvas());
   frame->SetElementName("Embedded Canvas");

   slot = tab1->NewSlot();

   TEveWindowTab* tab2 = slot->MakeTab();
   tab2->NewSlot();
   tab2->NewSlot();

   // ----------------------------------------------------------------

   gEve->GetBrowser()->GetTabRight()->SetTab(1);

   gDebug = 1;
}
thumb

Last change: Wed Dec 17 10:56:29 2008
Last generated: 2008-12-17 10:56

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.