Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 
0003 #include "CSGEnum.h"
0004 
0005 #if defined(__CUDACC__) || defined(__CUDABE__)
0006 #else
0007 #include "plog/Severity.h"
0008 #include <string>
0009 #include "CSG_API_EXPORT.hh"
0010 #endif
0011 
0012 
0013 /**
0014 CSGSolid
0015 ==========
0016 
0017 Currently this is not uploaded to GPU, but still coding like 
0018 it might be in future, ie keep it simple, no refs, 
0019 128 bit (16 byte) alignment
0020 
0021 Extract from notes in externals/optix7sdk.bash::
0022 
0023     CSGOptiX uses one GAS for each CSGSolid ("compound" of numPrim CSGPrim)
0024     and that one GAS always has only one buildInput which references
0025     numPrim SBT records which have "sbt-geometry-acceleration-structure-index" 
0026     of (0,1,2,...,numPrim-1)  
0027 
0028 
0029 Saving/loading the vector of CSGSolid in CSGFoundry
0030 is done by CSGFoundry::save,load,loadArray.
0031 Due to this no pointers are used in the below
0032 and the layout/alignment is kept simple for trivial 
0033 debug access from python.  
0034 
0035 **/
0036 
0037 struct CSG_API CSGSolid   // Composite shape 
0038 {
0039     char        label[16] ;   // sizeof 4 int 
0040     // raw use of so->label risks funny chars at slot 16, and truncation :  use getLabel() to avoid 
0041 
0042     int         numPrim ; 
0043     int         primOffset ;
0044     int         type = STANDARD_SOLID ;       
0045 
0046     char        intent = '\0' ;     
0047     char        pad0 = '\0' ; 
0048     char        pad1 = '\0' ; 
0049     char        pad2 = '\0' ; 
0050 
0051 
0052     float4      center_extent ; 
0053 
0054 
0055 #if defined(__CUDACC__) || defined(__CUDABE__)
0056 #else
0057     static const plog::Severity LEVEL ;  
0058 
0059     const char* getLabel() const ; 
0060     bool labelMatch(const char* label) const ;  
0061 
0062     //char getLabelPrefix() const ; 
0063     char getIntent() const ;  // 'R' 'F' 'T'   used for forced triangulation
0064     void setIntent(char _intent); 
0065 
0066     static void CopyIntent( CSGSolid* d,  const CSGSolid* s ); 
0067 
0068     static bool IsDiff( const CSGSolid& a , const CSGSolid& b ); 
0069     static CSGSolid Make( const char* label_, int numPrim_, int primOffset_=-1 ); 
0070     static std::string MakeLabel(const char* typ0, unsigned idx0, char delim='_' );  
0071     static std::string MakeLabel(char typ0, unsigned idx0 );  
0072     static int         ParseLabel(const char* label, char& typ0, unsigned& idx0 );  
0073     int                get_ridx() const ; 
0074  
0075     static std::string MakeLabel(char typ0, unsigned idx0, char typ1, unsigned idx1 );  
0076     static std::string MakeLabel(char typ0, unsigned idx0, char typ1, unsigned idx1, char typ2, unsigned idx2 );  
0077     std::string desc() const ; 
0078 
0079 #endif
0080 
0081 };
0082 
0083