arrow_standalone.C

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: triangleset.C 26568 2008-12-01 20:55:50Z matevz $
00002 // Author: Matevz Tadel
00003 
00004 // How to use EVE without the standard window.
00005 
00006 // Type
00007 //   gEve->GetBrowser()->MapWindow()
00008 // to bring it up for object interaction, debugging, etc.
00009 
00010 void arrow_standalone()
00011 {
00012    TEveManager::Create(kFALSE);
00013 
00014    // ----------------------------------------------------------------------
00015 
00016    TGMainFrame* mf = new TGMainFrame(gClient->GetRoot(), 800, 400,
00017                                      kHorizontalFrame);
00018    mf->SetWindowName("Arrow Foo");
00019 
00020    // ----------------------------------------------------------------------
00021 
00022    TGCompositeFrame* evf = new TGCompositeFrame(mf, 400, 400);
00023    mf->AddFrame(evf, new TGLayoutHints(kLHintsNormal  |
00024                                        kLHintsExpandX | kLHintsExpandY));
00025 
00026    TGLEmbeddedViewer* ev = new TGLEmbeddedViewer(evf);
00027    evf->AddFrame(ev->GetFrame(),
00028                  new TGLayoutHints(kLHintsNormal  |
00029                                    kLHintsExpandX | kLHintsExpandY));
00030 
00031    TEveViewer* eve_v = new TEveViewer("YourViewer");
00032    eve_v->SetGLViewer(ev, ev->GetFrame());
00033    eve_v->IncDenyDestroy();
00034    eve_v->AddScene(gEve->GetEventScene());
00035    gEve->GetViewers()->AddElement(eve_v);
00036 
00037    // ----------------------------------------------------------------------
00038 
00039    // To create embedded canvas ... no menus on top.
00040 
00041    // TRootEmbeddedCanvas* ec =
00042    //    new TRootEmbeddedCanvas("EmbeddedCanvas", mf, 400, 400);
00043    // mf->AddFrame(ec, new TGLayoutHints(kLHintsNormal  |
00044    //                                    kLHintsExpandX | kLHintsExpandY));
00045 
00046    // --------------------------------
00047 
00048    // This one is tricky - must be after embedded canvas but before std canvas!
00049    mf->MapSubwindows();
00050 
00051    // --------------------------------
00052 
00053    // To create full canvas with menus.
00054 
00055    mf->SetEditable();
00056    TCanvas* c = new TCanvas("Foo", "Bar", 400, 400);
00057    mf->SetEditable(kFALSE);
00058 
00059    // ----------------------------------------------------------------------
00060 
00061    mf->Layout();
00062    mf->MapWindow();
00063 
00064    // ----------------------------------------------------------------------
00065 
00066    // Populate the viewer ... here we just call the arrow.C.
00067 
00068    TEveUtil::Macro("arrow.C");
00069 }

Generated on Tue Jul 5 15:43:50 2011 for ROOT_528-00b_version by  doxygen 1.5.1