File indexing completed on 2026-04-09 07:49:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <csignal>
0011 #include "OPTICKS_LOG.hh"
0012 #include "ssys.h"
0013 #include "SEventConfig.hh"
0014 #include "SEvt.hh"
0015 #include "QEvt.hh"
0016
0017 struct QEvt_Lifecycle_Test
0018 {
0019 static int EventLoop();
0020 };
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 int QEvt_Lifecycle_Test::EventLoop()
0032 {
0033 SEvt* sev = SEvt::Create_EGPU() ;
0034
0035 assert( sev );
0036
0037 sev->setFramePlaceholder();
0038
0039
0040
0041
0042
0043
0044 QEvt* event = new QEvt ;
0045
0046 int num_event = SEventConfig::NumEvent() ;
0047 std::cout << " num_event " << num_event << std::endl ;
0048
0049 for(int i = 0 ; i < num_event ; i++)
0050 {
0051
0052
0053
0054 int eventID = i ;
0055
0056 sev->beginOfEvent(eventID);
0057
0058
0059
0060 NP* igs = sev->makeGenstepArrayFromVector();
0061 int rc = event->setGenstepUpload_NP(igs);
0062 assert( rc == 0 );
0063 if(rc!=0) std::raise(SIGINT);
0064
0065
0066
0067
0068
0069 sev->endOfEvent(eventID);
0070 }
0071 return 0 ;
0072 }
0073
0074 int main(int argc, char** argv)
0075 {
0076 OPTICKS_LOG(argc, argv);
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 bool overwrite = false ;
0088
0089 SEventConfig::SetInputPhoton("RainXZ_Z230_10k_f8.npy");
0090
0091 ssys::setenvvar("GEOM", "TEST_CC", overwrite );
0092
0093 return QEvt_Lifecycle_Test::EventLoop() ;
0094 }