File indexing completed on 2025-08-03 08:20:24
0001 #ifndef MACRO_DISPLAYON_C
0002 #define MACRO_DISPLAYON_C
0003
0004 #include <g4main/PHG4Reco.h>
0005
0006 #include <fun4all/Fun4AllServer.h>
0007
0008 R__LOAD_LIBRARY(libfun4all.so)
0009 R__LOAD_LIBRARY(libg4testbench.so)
0010
0011 namespace Enable
0012 {
0013 bool DISPLAY = false;
0014 }
0015
0016
0017
0018
0019 PHG4Reco *QTGui()
0020 {
0021 Fun4AllServer *se = Fun4AllServer::instance();
0022 PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
0023 g4->InitRun(se->topNode());
0024 g4->ApplyDisplayAction();
0025 g4->StartGui();
0026 return g4;
0027 }
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 PHG4Reco *DisplayOn(const char *mac = "vis.mac")
0038 {
0039 char cmd[100];
0040 Fun4AllServer *se = Fun4AllServer::instance();
0041 PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
0042 g4->InitRun(se->topNode());
0043 g4->ApplyDisplayAction();
0044 sprintf(cmd, "/control/execute %s", mac);
0045 g4->ApplyCommand(cmd);
0046 return g4;
0047 }
0048
0049 void displaycmd()
0050 {
0051 cout << "draw axis: " << endl;
0052 cout << " g4->ApplyCommand(\"/vis/scene/add/axes 0 0 0 50 cm\")" << endl;
0053 cout << "zoom" << endl;
0054 cout << " g4->ApplyCommand(\"/vis/viewer/zoom 1\")" << endl;
0055 cout << "viewpoint:" << endl;
0056 cout << " g4->ApplyCommand(\"/vis/viewer/set/viewpointThetaPhi 0 0\")" << endl;
0057 cout << "panTo:" << endl;
0058 cout << " g4->ApplyCommand(\"/vis/viewer/panTo 0 0 cm\")" << endl;
0059 cout << "print to eps:" << endl;
0060 cout << " g4->ApplyCommand(\"/vis/ogl/printEPS\")" << endl;
0061 cout << "set background color:" << endl;
0062 cout << " g4->ApplyCommand(\"/vis/viewer/set/background white\")" << endl;
0063 }
0064 #endif