Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:52

0001 /**
0002 CSGFoundry_CreateFromSimTest.cc
0003 ================================
0004 
0005 Creates CSGFoundry from SSim and SSim/stree
0006 
0007 1. SSim::Load
0008 2. populates CSGFoundry with CSGFoundry::CreateFromSim using
0009    the SSim that CSGFoundry instanciation adopts
0010 3. saves CSGFoundry to $FOLD
0011 
0012 **/
0013 
0014 #include <csignal>
0015 #include "OPTICKS_LOG.hh"
0016 #include "SSim.hh"
0017 #include "spath.h"
0018 #include "stree.h"
0019 #include "CSGFoundry.h"
0020 
0021 
0022 int main(int argc, char** argv)
0023 {
0024     OPTICKS_LOG(argc, argv);
0025 
0026     SSim* sim = SSim::Load() ;
0027     std::cout << "sim.tree.desc" << std::endl << sim->tree->desc() ;
0028 
0029     CSGFoundry* fd = CSGFoundry::CreateFromSim() ; // adopts SSim::INSTANCE
0030     fd->save("$FOLD") ;
0031 
0032     bool fd_expect = fd->sim == sim ;
0033     assert( fd_expect  );
0034     if(!fd_expect) std::raise(SIGINT);
0035 
0036     return 0 ;
0037 }
0038 
0039 
0040