DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
webdisplay.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include "run_plugin.h"
16 
17 //______________________________________________________________________________
18 int main(int argc,char** argv) {
19  std::vector<const char*> av;
20  std::string level, visopt, opt, detector;
21  bool dry = false;
22  for(int i=0; i<argc; ++i) {
23  if ( i==1 && argv[i][0] != '-' ) av.emplace_back("-input");
24  if ( strncmp(argv[i],"-load-only",4) == 0 ) dry = true, av.emplace_back(argv[i]);
25  else if ( strncmp(argv[i],"-dry-run",4) == 0 ) dry = true, av.emplace_back(argv[i]);
26  else if ( strncmp(argv[i],"-visopt",4) == 0 ) visopt = argv[++i];
27  else if ( strncmp(argv[i],"-level", 4) == 0 ) level = argv[++i];
28  else if ( strncmp(argv[i],"-option",4) == 0 ) opt = argv[++i];
29  else if ( strncmp(argv[i],"-detector",4) == 0 ) detector = argv[++i];
30  else av.emplace_back(argv[i]);
31  }
32  if ( !dry ) {
33  av.emplace_back("-interactive");
34  av.emplace_back("-plugin");
35  av.emplace_back("DD4hep_GeometryWebDisplay");
36  if ( !opt.empty() ) av.emplace_back("-opt"), av.emplace_back(opt.c_str());
37  if ( !level.empty() ) av.emplace_back("-level"), av.emplace_back(level.c_str());
38  if ( !visopt.empty() ) av.emplace_back("-visopt"), av.emplace_back(visopt.c_str());
39  if ( !detector.empty() ) av.emplace_back("-detector"), av.emplace_back(detector.c_str());
40  }
41  return dd4hep::execute::main_plugins("DD4hep_GeometryWebDisplay", av.size(), (char**)&av[0]);
42 }
main
int main(int argc, char **argv)
Definition: webdisplay.cpp:18
run_plugin.h
dd4hep::execute::main_plugins
int main_plugins(const char *name, int argc, char **argv)
Main entry point as a program.
Definition: run_plugin.h:418