File indexing completed on 2026-04-09 07:49:42
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "SCUDA_Mesh.h"
0025 #include "SOPTIX_BuildInput_Mesh.h"
0026 #include "SOPTIX_Options.h"
0027
0028 struct SOPTIX_MeshGroup
0029 {
0030 static int Initialize();
0031
0032 int irc ;
0033 const SCUDA_MeshGroup* cmg ;
0034 std::vector<const SOPTIX_BuildInput*> bis ;
0035
0036 std::string desc() const ;
0037 size_t num_buildInputs() const ;
0038
0039 SOPTIX_MeshGroup( const SCUDA_MeshGroup* cmg );
0040 void init();
0041
0042 static SOPTIX_MeshGroup* Create( const SMeshGroup* mg );
0043 };
0044
0045 inline int SOPTIX_MeshGroup::Initialize()
0046 {
0047 if(SOPTIX_Options::Level()>0) std::cout << "-SOPTIX_MeshGroup::Initialize\n" ;
0048 return 0 ;
0049 }
0050
0051
0052 inline std::string SOPTIX_MeshGroup::desc() const
0053 {
0054 int num_bi = bis.size() ;
0055 std::stringstream ss ;
0056 ss << "[SOPTIX_MeshGroup::desc num_bi " << num_bi << std::endl ;
0057 for(int i=0 ; i < num_bi ; i++)
0058 {
0059 const SOPTIX_BuildInput* bi = bis[i] ;
0060 ss << "bi[" << i << "]" << std::endl ;
0061 ss << bi->desc() << std::endl ;
0062 }
0063 ss << "]SOPTIX_MeshGroup::desc num_bi " << num_bi << std::endl ;
0064 std::string str = ss.str() ;
0065 return str ;
0066 }
0067
0068 inline size_t SOPTIX_MeshGroup::num_buildInputs() const
0069 {
0070 return bis.size() ;
0071 }
0072
0073
0074
0075
0076
0077
0078
0079 inline SOPTIX_MeshGroup::SOPTIX_MeshGroup( const SCUDA_MeshGroup* _cmg )
0080 :
0081 irc(Initialize()),
0082 cmg(_cmg)
0083 {
0084 init();
0085 }
0086
0087 inline void SOPTIX_MeshGroup::init()
0088 {
0089 if(SOPTIX_Options::Level()>0) std::cout << "[SOPTIX_Meshgroup::init\n" ;
0090 size_t num_part = cmg->num_part() ;
0091 for(size_t i=0 ; i < num_part ; i++)
0092 {
0093 const SOPTIX_BuildInput* bi = new SOPTIX_BuildInput_Mesh(cmg, i);
0094 bis.push_back(bi);
0095 }
0096 if(SOPTIX_Options::Level()>0) std::cout << "]SOPTIX_Meshgroup::init\n" ;
0097 }
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109 inline SOPTIX_MeshGroup* SOPTIX_MeshGroup::Create( const SMeshGroup* mg )
0110 {
0111 SCUDA_MeshGroup* cmg = SCUDA_MeshGroup::Upload(mg) ;
0112 SOPTIX_MeshGroup* xmg = new SOPTIX_MeshGroup( cmg );
0113 return xmg ;
0114 }
0115
0116