Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 /**
0003 CSGGrid.h : signed distance field grid 
0004 =======================================
0005 
0006 * NB: no other CSG dependency, can and should be relocated down to sysrap if still needed 
0007 * instance returned from CSGQuery::scanPrim which is used by CSGGeometry::saveSignedDistanceField
0008 
0009 ::
0010 
0011     epsilon:GeoChain blyth$ opticks-f CSGGrid.h 
0012     ./CSG/CSGGeometry.cc:#include "CSGGrid.h"
0013     ./CSG/CSGGrid.cc:#include "CSGGrid.h"
0014     ./CSG/CSGQuery.cc:#include "CSGGrid.h"
0015     ./CSG/CMakeLists.txt:    CSGGrid.h
0016     ./CSG/CSGGrid.h:CSGGrid.h : signed distance field grid 
0017     epsilon:opticks blyth$ 
0018 
0019 
0020 **/
0021 
0022 #include <functional>
0023 struct float4 ; 
0024 struct float3 ; 
0025 struct NP ; 
0026 
0027 #include "CSG_API_EXPORT.hh"
0028 
0029 struct CSG_API CSGGrid
0030 {
0031     static const char* BASE ; 
0032 
0033     float4 ce ;
0034     float margin ; 
0035     int nx ; 
0036     int ny ; 
0037     int nz ; 
0038     float3 gridscale ; 
0039     int ni ; 
0040     int nj ; 
0041     int nk ; 
0042     NP* sdf ; 
0043     float* sdf_v ; 
0044     NP* xyzd ; 
0045     float* xyzd_v ; 
0046 
0047     CSGGrid( const float4& ce_, int nx_, int ny_, int nz_ ); 
0048 
0049     void init(); 
0050     void init_meta(); 
0051     void scan( std::function<float(const float3&)> sdf  ) ; 
0052 
0053     void save(const char* geom, const char* base=nullptr) const ; 
0054 }; 
0055 
0056