ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tutorials
eve
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
TGMainFrame
* mf =
new
TGMainFrame
(
gClient
->GetRoot(), 800, 400,
20
kHorizontalFrame
);
21
mf->
SetWindowName
(
"Arrow Foo"
);
22
23
// ----------------------------------------------------------------------
24
25
TGCompositeFrame
* evf =
new
TGCompositeFrame
(mf, 400, 400);
26
mf->
AddFrame
(evf,
new
TGLayoutHints
(
kLHintsNormal
|
27
kLHintsExpandX
|
kLHintsExpandY
));
28
29
TGLEmbeddedViewer
* ev =
new
TGLEmbeddedViewer
(evf);
30
evf->
AddFrame
(ev->
GetFrame
(),
31
new
TGLayoutHints
(
kLHintsNormal
|
32
kLHintsExpandX
|
kLHintsExpandY
));
33
34
TEveViewer
* 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
TCanvas
* 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
}
TEveManager::GetViewers
TEveViewerList * GetViewers() const
Definition:
TEveManager.h:145
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition:
TGFrame.cxx:1746
kLHintsExpandY
Definition:
TGLayout.h:44
TEveElement::IncDenyDestroy
void IncDenyDestroy()
Increases the deny-destroy count of the element.
Definition:
TEveElement.cxx:1794
gClient
#define gClient
Definition:
TGClient.h:174
kFALSE
const Bool_t kFALSE
Definition:
Rtypes.h:92
TGLEmbeddedViewer::GetFrame
TGCompositeFrame * GetFrame() const
Definition:
TGLEmbeddedViewer.h:50
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition:
TGFrame.cxx:1239
TGLEmbeddedViewer
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Definition:
TGLEmbeddedViewer.h:27
kLHintsExpandX
Definition:
TGLayout.h:43
TEveViewer::SetGLViewer
void SetGLViewer(TGLViewer *viewer, TGFrame *frame)
Set TGLViewer that is represented by this object.
Definition:
TEveViewer.cxx:143
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:895
gEve
R__EXTERN TEveManager * gEve
Definition:
TEveManager.h:243
TCanvas
The Canvas class.
Definition:
TCanvas.h:48
TGCompositeFrame
Definition:
TGFrame.h:362
TEveUtil::Macro
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition:
TEveUtil.cxx:168
TEveManager::GetEventScene
TEveScene * GetEventScene() const
Definition:
TEveManager.h:148
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition:
TGFrame.cxx:1099
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition:
TGFrame.cxx:1146
TGFrame::MapWindow
virtual void MapWindow()
Definition:
TGFrame.h:267
TEveViewerList::AddElement
virtual void AddElement(TEveElement *el)
Call base-class implementation.
Definition:
TEveViewer.cxx:358
TGLayoutHints
Definition:
TGLayout.h:63
kHorizontalFrame
Definition:
TGFrame.h:76
TGCompositeFrame::SetEditable
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition:
TGFrame.cxx:930
kLHintsNormal
Definition:
TGLayout.h:45
TGMainFrame
Definition:
TGFrame.h:482
TEveViewer
Eve representation of TGLViewer.
Definition:
TEveViewer.h:30
TEveViewer::AddScene
virtual void AddScene(TEveScene *scene)
Add 'scene' to the list of scenes.
Definition:
TEveViewer.cxx:261