Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:19

0001 // ./SPlace_test.sh 
0002 
0003 
0004 #include <cstdlib>
0005 #include "SPlace.h"
0006 
0007 const char* FOLD = getenv("FOLD") ; 
0008 const char* TEST = getenv("TEST") ; 
0009 const char* OPTS = getenv("OPTS") ; 
0010 
0011 
0012 const char* Name()
0013 {
0014     std::stringstream ss ; 
0015     ss << TEST << ".npy" ; 
0016     std::string s = ss.str(); 
0017     return strdup(s.c_str()) ; 
0018 }
0019 
0020 
0021 void test_AroundCylinder()
0022 {
0023     double sc = 5. ; 
0024     double radius = sc ; 
0025     double halfheight = sc ; 
0026 
0027     NP* tr = SPlace::AroundCylinder(OPTS, radius, halfheight ); 
0028     tr->save(FOLD, Name()); 
0029 }
0030 
0031 void test_AroundSphere()
0032 {
0033     double sc = 5. ; 
0034     double radius = sc ; 
0035     double item_arclen = 1. ; 
0036     unsigned num_ring = 8 ;
0037 
0038     NP* tr = SPlace::AroundSphere(OPTS, radius, item_arclen, num_ring); 
0039     tr->save(FOLD, Name()); 
0040 }
0041 
0042 
0043 int main(int argc, char** argv)
0044 {
0045     if(strcmp(TEST,"AroundCylinder")==0) test_AroundCylinder(); 
0046     if(strcmp(TEST,"AroundSphere")==0)   test_AroundSphere(); 
0047     return 0 ; 
0048 }