Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #pragma once
0002 /**
0003 CSGGeometry
0004 =============
0005 
0006 CSGGeometry is a higher level wrapper for CSGFoundry which 
0007 avoids repetition of geometry setup, loading and querying mechanics. 
0008 
0009 
0010 ::
0011 
0012     epsilon:opticks blyth$ opticks-f CSGGeometry.h 
0013     ./CSG/CSGGeometry.cc:#include "CSGGeometry.h"
0014     ./CSG/CMakeLists.txt:    CSGGeometry.h
0015     ./CSG/tests/CSGIntersectSolidTest.cc:#include "CSGGeometry.h"
0016     ./CSG/tests/CSGSignedDistanceFieldTest.cc:#include "CSGGeometry.h"
0017     ./CSG/tests/CSGGeometryTest.cc:#include "CSGGeometry.h"
0018     ./CSG/tests/CSGGeometryFromGeocacheTest.cc:#include "CSGGeometry.h"
0019     ./GeoChain/GeoChain.cc:#include "CSGGeometry.h"
0020 
0021 
0022 **/
0023 
0024 #include <vector>
0025 #include <string>
0026 
0027 struct CSGFoundry ; 
0028 struct CSGQuery ; 
0029 struct CSGDraw ; 
0030 struct float4 ; 
0031 
0032 #include "plog/Severity.h"
0033 #include "CSG_API_EXPORT.hh"
0034 
0035 struct CSG_API CSGGeometry 
0036 {
0037     static const plog::Severity LEVEL ;   
0038     static std::string Desc( const CSGFoundry* fd ); 
0039     static const char* OutDir(const char* cfbase, const char* geom, const char* sopr);  
0040 
0041     const char* default_geom ; 
0042     const char* default_sopr ; 
0043     const char* geom ; 
0044     const char* sopr ; 
0045     const char* cfbase ; 
0046     const char* outdir ; 
0047     const char* name ; 
0048 
0049     const CSGFoundry* fd ; 
0050     const CSGQuery*   q ;  
0051     float4*          ce ; 
0052 
0053     CSGDraw*    d ;    // cannot be const because of canvas
0054 
0055     std::vector<int>* sxyzw ;
0056     std::vector<int>* sxyz ; 
0057     bool no_selection ; 
0058     int sx ;  
0059     int sy ;  
0060     int sz ;  
0061     int sw ;  
0062     int rc ; 
0063 
0064     void operator()(); 
0065     CSGGeometry(const char* default_cfbase = nullptr, const CSGFoundry* fd_ = nullptr); 
0066 
0067     void init(); 
0068     void init_fd(); 
0069     void init_selection();  
0070 
0071 
0072     void saveSignedDistanceField() const ; 
0073 
0074 
0075     void centerExtentGenstepIntersect() ; // invokes one of the below
0076     void saveCenterExtentGenstepIntersect(float t_min) const ; 
0077     void intersectSelected(const char* path); 
0078 
0079 
0080     void dump(const char* msg="CSGGeometry::dump") const ; 
0081 
0082     std::string desc() ; 
0083 
0084 
0085 };
0086 
0087 
0088