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