In principle you just need to write your own main function and call TEveManager::Create() before you call TApplication::Run(). See example from alieve main function: alisoft.cern.ch/viewvc/trunk/EVE … ot=AliRoot
The important parts:
#include <TRint.h>
#include <TEveManager.h>
int main(int argc, char **argv)
{
// Use TApplication if you don't need prompt.
TRint *app = new TRint("App", &argc, argv);
// See arguments to Create() and constructor -- you can choose not to show the window
// or some GUI parts.
TEveManager::Create();
// Create custom GUI, if needed.
app->Run(kTRUE);
// Pass kFALSE if you want application to terminate by itself.
// Then you just need "return 0;" below (to avoid compiler warnings).
// Optionally shutdown eve here (not really needed):
// TEveManager::Terminate();
app->Terminate(0);
return 0;
}
thank you very much! I succeeded creating my own stand alone EVE application with your help. Just a bit detail: I had to add by hand -lGeom -lEve -lGed -lRGL -lEG -lTreePlayer to the output of root-config -glibs to compile the program. Is it possible to get the list automatically?
At the moment there is no such option to root-config … I will ask Fons to add option -evelibs returning the needed libraries. Thanks for your suggestion!
// See arguments to Create() and constructor -- you can choose not to show the window
// or some GUI parts.
TEveManager::Create();
[/quote]
Dear Matevz,
I tried to use TEveManager::Create(kTRUE,“FV”) to disable command-line part of the GUI. That part did disappear, but it didn’t give up the space it occupied: where it was became an empty space, the 3D viewer did not take that space.
Is it a way to tell the 3D viewer to take that empty space?
Fons also added the --evelibs option to configure just now
You will need to reconfigure your build, i.e. run:
build/unix/reconfigure.sh
or run configure manually.
What’s the current command for telling configure to include the eve libs in the root-config --glibs output? Doing ./configure --evelibs or ./configure --with-evelibs says invalid option, and I don’t see a reference to eve anywhere in the online guide or in ./configure --help.
Thanks for the useful information on how to create a stand-alone EVE application.
Following your recipe I was able to convert the histobrowser.C example to a standalone program. I still have a problem: the example creates a couple of macros with this syntax:
m = new TMacro;
m->AddLine("{ g_hlt_canvas->Clear();"
" g_hlt_canvas->cd();"
" g_hlt_canvas->Update(); }");
m->SetName("Clear Canvas");
followed by
gEve->GetBrowser()->StartEmbedding(1);
g_hlt_canvas = new TCanvas;
gEve->GetBrowser()->StopEmbedding("HLT Canvas");
When I try to use them from the EVE window I get the following error:
Error: Symbol g_hlt_canvas is not defined in current scope /tmp/daq/Split Canvas.CaOh6la:1:
Error: Failed to evaluate g_hlt_canvas->Clear()
*** Interpreter error recovered ***
I understand that the macro interpreter does not know about g_hlt_canvas. Of course this does not happen when I execute histobrowser.C interactively. What is the right way to define these macros in a stand alone EVE program?
Well, the interpreter must know the symbols you’re using, there’s no way around that. You can:[ul]
[li] export variables, like this: github.com/root-mirror/root/blo … t.cxx#L957[/li]
[li] call functions from your macro and implement all handling in the compiled code[/li][/ul]