File indexing completed on 2026-04-09 07:48:58
0001 #pragma once
0002
0003 #include <string>
0004 #include "plog/Severity.h"
0005
0006 struct CSGFoundry ;
0007 struct CSGPrim ;
0008 struct CSGNode ;
0009 struct float4 ;
0010 struct float3 ;
0011 struct quad4 ;
0012 struct qat4 ;
0013 struct CSGGrid ;
0014 struct SCanvas ;
0015
0016 #include "CSG_API_EXPORT.hh"
0017
0018 struct CSG_API CSGQuery
0019 {
0020 static const plog::Severity LEVEL ;
0021 static const float SD_CUT ;
0022 static const int VERBOSE ;
0023 static std::string Label();
0024 static std::string Desc( const quad4& isect, const char* label, bool* valid_intersect=nullptr );
0025
0026 CSGQuery(const CSGFoundry* fd);
0027
0028 void init();
0029 void selectPrim(unsigned solidIdx, unsigned primIdxRel );
0030 void selectPrim(const CSGPrim* pr );
0031
0032 int getSelectedType() const ;
0033 int getSelectedTreeHeight() const ;
0034 const CSGNode* getSelectedTreeNode( int nodeIdxRel ) const ;
0035
0036 const CSGNode* getSelectedNode( int nodeIdxRel ) const ;
0037
0038 void dump(const char* msg) const ;
0039
0040
0041 std::string descPrim() const ;
0042 void dumpPrim(const char* msg="CSGQuery::dumpPrim") const ;
0043 CSGGrid* scanPrim(int resolution) const ;
0044
0045
0046 float distance(const float3& position ) const ;
0047 float operator()(const float3& position) const ;
0048 void distance( quad4& isect, const float3& ray_origin ) const ;
0049
0050 bool intersect( quad4& isect, float t_min, const quad4& p ) const ;
0051 bool intersect( quad4& isect, float t_min, const float3& ray_origin, const float3& ray_direction, unsigned gsid ) const ;
0052
0053 bool simtrace( quad4& isect ) const ;
0054 bool intersect_again( quad4& isect, const quad4& prev_isect ) const ;
0055
0056 void post(const char* outdir);
0057
0058 static bool IsSpurious( const quad4& isect );
0059
0060
0061 const CSGFoundry* fd ;
0062 const CSGPrim* prim0 ;
0063 const CSGNode* node0 ;
0064 const float4* plan0 ;
0065 const qat4* itra0 ;
0066
0067 const CSGPrim* select_prim ;
0068 float4 select_prim_ce ;
0069 int select_nodeOffset ;
0070 int select_prim_numNode ;
0071 const CSGNode* select_root_node ;
0072 int select_root_typecode ;
0073 int select_root_subNum ;
0074 bool select_is_tree ;
0075
0076
0077
0078 };
0079
0080