Commit in slic on MAIN
include/G4CmdQueue.hh+2-11.11 -> 1.12
src/G4CmdQueue.cc+44-11.12 -> 1.13
   /G4Application.cc+9-11.67 -> 1.68
+55-3
3 modified files
JM: Add -G option for dumping GDML from command line.

slic/include
G4CmdQueue.hh 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- G4CmdQueue.hh	19 Oct 2005 22:51:08 -0000	1.11
+++ G4CmdQueue.hh	17 May 2006 23:14:56 -0000	1.12
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/G4CmdQueue.hh,v 1.11 2005/10/19 22:51:08 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/G4CmdQueue.hh,v 1.12 2006/05/17 23:14:56 jeremy Exp $
 
 #ifndef slic_G4CmdQueue_hh
 #define slic_G4CmdQueue_hh
@@ -75,6 +75,7 @@
     void setInitialize();
     void reorderBeamOn();
     void reorderLimits();
+    void reorder_dumpGDML();
 
   private:
 

slic/src
G4CmdQueue.cc 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- G4CmdQueue.cc	19 Oct 2005 22:51:15 -0000	1.12
+++ G4CmdQueue.cc	17 May 2006 23:14:56 -0000	1.13
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/G4CmdQueue.cc,v 1.12 2005/10/19 22:51:15 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/G4CmdQueue.cc,v 1.13 2006/05/17 23:14:56 jeremy Exp $
 #include "G4CmdQueue.hh"
 
 #include "G4UImanager.hh"
@@ -40,6 +40,7 @@
   {
     reorderBeamOn();
     reorderLimits();
+    reorder_dumpGDML();
   }
 
   void G4CmdQueue::reorderBeamOn()
@@ -69,6 +70,48 @@
     }
   }
 
+  void G4CmdQueue::reorder_dumpGDML()
+  {
+    bool gotdump = false;
+    std::string dumpstr = std::string("/lcdd/dumpGDML");
+
+    CmdVecType::iterator iter = m_commands.begin();
+    for ( ;
+	  iter != m_commands.end();
+	  iter++ ) {
+      std::string cmd = *iter;
+
+      if ( cmd.find(dumpstr) != std::string::npos ) {
+	gotdump = true;
+	break;
+      }
+    }
+
+    if (gotdump) {
+      m_commands.erase(iter);
+    }
+    else {
+      return;
+    }
+
+    bool gotInit = false;
+    iter = m_commands.begin();
+    for ( ;
+	  iter != m_commands.end();
+	  iter++ ) {
+      std::string cmd = *iter;
+
+      if ( cmd.find("/run/initialize") != std::string::npos ) {
+	gotInit = true;
+	break;
+      }
+    }
+
+    if ( gotInit ) {
+      m_commands.insert(iter + 1, dumpstr);
+    }
+  }
+
   void G4CmdQueue::reorderLimits()
   {
     bool gotLimits = false;

slic/src
G4Application.cc 1.67 -> 1.68
diff -u -r1.67 -r1.68
--- G4Application.cc	17 May 2006 02:51:46 -0000	1.67
+++ G4Application.cc	17 May 2006 23:14:56 -0000	1.68
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/G4Application.cc,v 1.67 2006/05/17 02:51:46 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/G4Application.cc,v 1.68 2006/05/17 23:14:56 jeremy Exp $
 #include "G4Application.hh"
 
 // slic
@@ -591,5 +591,13 @@
 					 0,
 					 1);
     cmd_mgr->addCmd(rndSeed, "/random/seed");
+
+    // Dump the loaded Geant4 geometry to a GDML file.
+    CmdLineOpt* dumpgdml = new CmdLineOpt("G",
+					  "dump-gdml",
+					  "Dump geometry to GDML file.",
+					  0,
+					  1);
+    cmd_mgr->addCmd(dumpgdml, "/lcdd/dumpGDML");
   }
 }
CVSspam 0.2.8