Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /**
0002 CSGIntersectSolidTest
0003 =======================
0004 
0005 Used scripts such as CSG/csg_geochain.sh 
0006 
0007 With GEOM envvar : Typically small test solids
0008 ------------------------------------------------
0009 
0010 When this executable is run with the GEOM envvar defined 
0011 small test geometries are created with CSGFoundry::MakeGeom.
0012 
0013 These geometries are created by conversion of G4VSolid with 
0014 GeoChain/translate.sh or directly in CSGSolid/Prim/Node with CSGMaker 
0015 (this is similar to CSGOptiX/cxs_geochain.sh)
0016 
0017 Without GEOM envvar : Typically full geometries (can be small too) 
0018 --------------------------------------------------------------------
0019 
0020 "Standard" CSGFoundry geometries are loaded from the OPTICKS_KEY 
0021 identified geocache. NB the GGeo geocache must first be converted into 
0022 CSGFoundry by CSG_GGeo/run.sh
0023 
0024 * TODO: change to doing the cg translation automatically ? 
0025 
0026 Single Solid Intersect Test
0027 ------------------------------
0028 
0029 Single solid testing of CSG intersects obtained using 
0030 code intended for GPU but running on CPU in order to facilitate 
0031 convenient debugging.
0032 
0033 **/
0034 
0035 #include "OPTICKS_LOG.hh"
0036 #include "SSys.hh"
0037 #include "SOpticksResource.hh"
0038 #include "SOpticks.hh"
0039 
0040 #include "CSGGeometry.h"
0041 
0042 int main(int argc, char** argv)
0043 {
0044     OPTICKS_LOG(argc, argv); 
0045 
0046     const char* cfbase = SOpticksResource::CFBase(); 
0047 
0048     bool with_geom = SSys::getenvbool("CSGGeometry_GEOM") ; 
0049     LOG(info) << " with_geom " << with_geom << " cfbase " << cfbase ;
0050 
0051     CSGGeometry geom(with_geom ? nullptr : cfbase) ;
0052     if(geom.rc != 0 ) return 0 ; 
0053 
0054     geom() ; 
0055 
0056     const char* msg = "CSG/tests/CSGIntersectSolidTest.cc" ; 
0057     SOpticks::WriteCFBaseScript(cfbase, msg); 
0058 
0059     return 0 ; 
0060 }
0061 
0062