ROOT
master
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
13
void
arrow_standalone()
14
{
15
TEveManager::Create
(
kFALSE
);
16
17
// ----------------------------------------------------------------------
18
19
auto
mf =
new
TGMainFrame
(
gClient
->GetRoot(), 800, 400,
kHorizontalFrame
);
20
mf->SetWindowName(
"Arrow Foo"
);
21
22
// ----------------------------------------------------------------------
23
24
auto
evf =
new
TGCompositeFrame
(mf, 400, 400);
25
mf->AddFrame(evf,
new
TGLayoutHints
(
kLHintsNormal
|
kLHintsExpandX
|
kLHintsExpandY
));
26
27
auto
ev =
new
TGLEmbeddedViewer
(evf);
28
evf->AddFrame(ev->GetFrame(),
new
TGLayoutHints
(
kLHintsNormal
|
kLHintsExpandX
|
kLHintsExpandY
));
29
30
auto
eve_v =
new
TEveViewer
(
"YourViewer"
);
31
eve_v->SetGLViewer(ev, ev->GetFrame());
32
eve_v->IncDenyDestroy();
33
eve_v->AddScene(
gEve
->
GetEventScene
());
34
gEve
->
GetViewers
()->
AddElement
(eve_v);
35
36
// ----------------------------------------------------------------------
37
38
// To create embedded canvas ... no menus on top.
39
40
// TRootEmbeddedCanvas* ec =
41
// new TRootEmbeddedCanvas("EmbeddedCanvas", mf, 400, 400);
42
// mf->AddFrame(ec, new TGLayoutHints(kLHintsNormal |
43
// kLHintsExpandX | kLHintsExpandY));
44
45
// --------------------------------
46
47
// This one is tricky - must be after embedded canvas but before std canvas!
48
mf->MapSubwindows();
49
50
// --------------------------------
51
52
// To create full canvas with menus.
53
54
mf->SetEditable();
55
auto
c
=
new
TCanvas
(
"Foo"
,
"Bar"
, 400, 400);
56
mf->SetEditable(
kFALSE
);
57
58
// ----------------------------------------------------------------------
59
60
mf->Layout();
61
mf->MapWindow();
62
63
// ----------------------------------------------------------------------
64
65
// Populate the viewer ... here we just call the arrow.C.
66
67
TEveUtil::Macro
(
"arrow.C"
);
68
}
kHorizontalFrame
@ kHorizontalFrame
Definition
GuiTypes.h:382
c
#define c(i)
Definition
RSha256.hxx:101
kFALSE
constexpr Bool_t kFALSE
Definition
RtypesCore.h:94
gEve
R__EXTERN TEveManager * gEve
Definition
TEveManager.h:243
gClient
#define gClient
Definition
TGClient.h:157
kLHintsExpandY
@ kLHintsExpandY
Definition
TGLayout.h:31
kLHintsNormal
@ kLHintsNormal
Definition
TGLayout.h:32
kLHintsExpandX
@ kLHintsExpandX
Definition
TGLayout.h:30
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TEveManager::GetViewers
TEveViewerList * GetViewers() const
Definition
TEveManager.h:145
TEveManager::Create
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
Definition
TEveManager.cxx:887
TEveManager::GetEventScene
TEveScene * GetEventScene() const
Definition
TEveManager.h:148
TEveUtil::Macro
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition
TEveUtil.cxx:164
TEveViewerList::AddElement
void AddElement(TEveElement *el) override
Call base-class implementation.
Definition
TEveViewer.cxx:358
TEveViewer
Eve representation of TGLViewer.
Definition
TEveViewer.h:31
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition
TGFrame.h:287
TGLEmbeddedViewer
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Definition
TGLEmbeddedViewer.h:24
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition
TGLayout.h:50
TGMainFrame
Defines top level windows that interact with the system Window Manager.
Definition
TGFrame.h:397
tutorials
visualisation
eve7
eve
arrow_standalone.C
ROOT master - Reference Guide Generated on Wed Jan 8 2025 15:05:59 (GVA Time) using Doxygen 1.9.8