Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 /**
0003 CSGScan.h : CPU testing of GPU csg_intersect impl
0004 ==================================================
0005 
0006 
0007 **/
0008 
0009 #include <string>
0010 #include <vector>
0011 #include "squad.h"
0012 #include "NPFold.h"
0013 
0014 #include "CSG_API_EXPORT.hh"
0015 
0016 struct CSGFoundry ; 
0017 struct CSGSolid ; 
0018 struct CSGParams ; 
0019 
0020 struct CSG_API CSGScan
0021 {
0022     CSGScan( const CSGFoundry* fd_, const CSGSolid* solid_, const char* opt );   
0023 
0024     void initGeom_h(); 
0025     void initRays_h(const char* opts_); 
0026 
0027     void initGeom_d(); 
0028     void initRays_d(); 
0029     void initParams_d(); 
0030 
0031     void add_scan(std::vector<quad4>& qq, const char* opt);
0032     void add_axis_scan(std::vector<quad4>& qq); 
0033     void add_circle_scan(std::vector<quad4>& qq); 
0034     void add_rectangle_scan(std::vector<quad4>& qq); 
0035     void _add_rectangle_scan(std::vector<quad4>& qq, float t_min, unsigned n, float halfside, float y ) ;
0036 
0037     void add_q(std::vector<quad4>& qq, const float t_min, const float3& ray_origin, const float3& ray_direction );
0038     void add_q(std::vector<quad4>& qq, const float t_min, const float3& ray_origin, const std::vector<float3>& dirs );
0039 
0040     void intersect_h();
0041 
0042     void intersect_d();
0043     void download(); 
0044 
0045     std::string brief() const ;
0046     std::string brief(CSGParams* s) const ;
0047     void dump( const quad4& rec ); 
0048 
0049     NPFold* serialize_(CSGParams* s) const ; 
0050     NPFold* serialize() const ; 
0051     void save(const char* base) const ;
0052 
0053     const CSGFoundry* fd ; 
0054     const CSGPrim*    prim0 ; 
0055     const CSGNode*    node0 ; 
0056     const CSGSolid*   so ;
0057  
0058     int primIdx0 ; 
0059     int primIdx1 ; 
0060     int primIdx ; 
0061     const CSGPrim* prim ; 
0062     int nodeOffset ; 
0063     const CSGNode* node ; 
0064 
0065     CSGParams* h ;
0066     CSGParams* d ;
0067     CSGParams* d_d ;
0068     CSGParams* c ;
0069 
0070  
0071 };
0072 
0073