File indexing completed on 2025-01-18 09:15:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "run_plugin.h"
0016
0017
0018 int main(int argc,char** argv) {
0019 std::vector<const char*> av;
0020 std::string level, visopt, opt, detector;
0021 bool dry = false;
0022 for(int i=0; i<argc; ++i) {
0023 if ( i==1 && argv[i][0] != '-' ) av.emplace_back("-input");
0024 if ( strncmp(argv[i],"-load-only",4) == 0 ) dry = true, av.emplace_back(argv[i]);
0025 else if ( strncmp(argv[i],"-dry-run",4) == 0 ) dry = true, av.emplace_back(argv[i]);
0026 else if ( strncmp(argv[i],"-visopt",4) == 0 ) visopt = argv[++i];
0027 else if ( strncmp(argv[i],"-level", 4) == 0 ) level = argv[++i];
0028 else if ( strncmp(argv[i],"-option",4) == 0 ) opt = argv[++i];
0029 else if ( strncmp(argv[i],"-detector",4) == 0 ) detector = argv[++i];
0030 else av.emplace_back(argv[i]);
0031 }
0032 if ( !dry ) {
0033 av.emplace_back("-interactive");
0034 av.emplace_back("-plugin");
0035 av.emplace_back("DD4hep_GeometryWebDisplay");
0036 if ( !opt.empty() ) av.emplace_back("-opt"), av.emplace_back(opt.c_str());
0037 if ( !level.empty() ) av.emplace_back("-level"), av.emplace_back(level.c_str());
0038 if ( !visopt.empty() ) av.emplace_back("-visopt"), av.emplace_back(visopt.c_str());
0039 if ( !detector.empty() ) av.emplace_back("-detector"), av.emplace_back(detector.c_str());
0040 }
0041 return dd4hep::execute::main_plugins("DD4hep_GeometryWebDisplay", av.size(), (char**)&av[0]);
0042 }