Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
arrow_standalone.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve
3/// How to use EVE without the standard window.
4/// Type
5/// `gEve->GetBrowser()->MapWindow()`
6/// to bring it up for object interaction, debugging, etc.
7///
8/// \image html eve_arrow_standalone.png
9/// \macro_code
10///
11/// \author Matevz Tadel
12
13void arrow_standalone()
14{
16
17 // ----------------------------------------------------------------------
18
19 auto mf = new TGMainFrame(gClient->GetRoot(), 800, 400,
21 mf->SetWindowName("Arrow Foo");
22
23 // ----------------------------------------------------------------------
24
25 auto evf = new TGCompositeFrame(mf, 400, 400);
26 mf->AddFrame(evf, new TGLayoutHints(kLHintsNormal |
28
29 auto ev = new TGLEmbeddedViewer(evf);
30 evf->AddFrame(ev->GetFrame(),
33
34 auto eve_v = new TEveViewer("YourViewer");
35 eve_v->SetGLViewer(ev, ev->GetFrame());
36 eve_v->IncDenyDestroy();
37 eve_v->AddScene(gEve->GetEventScene());
38 gEve->GetViewers()->AddElement(eve_v);
39
40 // ----------------------------------------------------------------------
41
42 // To create embedded canvas ... no menus on top.
43
44 // TRootEmbeddedCanvas* ec =
45 // new TRootEmbeddedCanvas("EmbeddedCanvas", mf, 400, 400);
46 // mf->AddFrame(ec, new TGLayoutHints(kLHintsNormal |
47 // kLHintsExpandX | kLHintsExpandY));
48
49 // --------------------------------
50
51 // This one is tricky - must be after embedded canvas but before std canvas!
52 mf->MapSubwindows();
53
54 // --------------------------------
55
56 // To create full canvas with menus.
57
58 mf->SetEditable();
59 auto c = new TCanvas("Foo", "Bar", 400, 400);
60 mf->SetEditable(kFALSE);
61
62 // ----------------------------------------------------------------------
63
64 mf->Layout();
65 mf->MapWindow();
66
67 // ----------------------------------------------------------------------
68
69 // Populate the viewer ... here we just call the arrow.C.
70
71 TEveUtil::Macro("arrow.C");
72}
@ kHorizontalFrame
Definition GuiTypes.h:382
#define c(i)
Definition RSha256.hxx:101
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
R__EXTERN TEveManager * gEve
#define gClient
Definition TGClient.h:156
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsExpandX
Definition TGLayout.h:30
The Canvas class.
Definition TCanvas.h:23
TEveViewerList * GetViewers() const
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
TEveScene * GetEventScene() const
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition TEveUtil.cxx:164
void AddElement(TEveElement *el) override
Call base-class implementation.
Eve representation of TGLViewer.
Definition TEveViewer.h:31
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
Minimal GL-viewer that can be embedded in a standard ROOT frames.
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397