Logo ROOT  
Reference Guide
arrow_standalone.C File Reference

Detailed Description

How to use EVE without the standard window.

Type gEve->GetBrowser()->MapWindow() to bring it up for object interaction, debugging, etc.

void arrow_standalone()
{
// ----------------------------------------------------------------------
auto mf = new TGMainFrame(gClient->GetRoot(), 800, 400,
mf->SetWindowName("Arrow Foo");
// ----------------------------------------------------------------------
auto evf = new TGCompositeFrame(mf, 400, 400);
mf->AddFrame(evf, new TGLayoutHints(kLHintsNormal |
auto ev = new TGLEmbeddedViewer(evf);
evf->AddFrame(ev->GetFrame(),
auto eve_v = new TEveViewer("YourViewer");
eve_v->SetGLViewer(ev, ev->GetFrame());
eve_v->IncDenyDestroy();
eve_v->AddScene(gEve->GetEventScene());
// ----------------------------------------------------------------------
// To create embedded canvas ... no menus on top.
// TRootEmbeddedCanvas* ec =
// new TRootEmbeddedCanvas("EmbeddedCanvas", mf, 400, 400);
// mf->AddFrame(ec, new TGLayoutHints(kLHintsNormal |
// kLHintsExpandX | kLHintsExpandY));
// --------------------------------
// This one is tricky - must be after embedded canvas but before std canvas!
mf->MapSubwindows();
// --------------------------------
// To create full canvas with menus.
mf->SetEditable();
auto c = new TCanvas("Foo", "Bar", 400, 400);
mf->SetEditable(kFALSE);
// ----------------------------------------------------------------------
mf->Layout();
mf->MapWindow();
// ----------------------------------------------------------------------
// Populate the viewer ... here we just call the arrow.C.
TEveUtil::Macro("arrow.C");
}
@ kHorizontalFrame
Definition: GuiTypes.h:382
#define c(i)
Definition: RSha256.hxx:101
const Bool_t kFALSE
Definition: RtypesCore.h:90
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
#define gClient
Definition: TGClient.h:166
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsNormal
Definition: TGLayout.h:39
@ kLHintsExpandX
Definition: TGLayout.h:37
The Canvas class.
Definition: TCanvas.h:27
TEveViewerList * GetViewers() const
Definition: TEveManager.h:145
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
TEveScene * GetEventScene() const
Definition: TEveManager.h:148
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition: TEveUtil.cxx:168
virtual void AddElement(TEveElement *el)
Call base-class implementation.
Definition: TEveViewer.cxx:359
Eve representation of TGLViewer.
Definition: TEveViewer.h:31
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Author
Matevz Tadel

Definition in file arrow_standalone.C.