Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:49:28

0001 #pragma once
0002 /**
0003 CSGCopy
0004 =========
0005 
0006 
0007 identical_bbox_cheat:true
0008     when the elv selection SBitSet has all bits set it means
0009     there is no selection so identical:true 
0010     
0011     In that case have observed small 0.002 mm shifts in 
0012     large bbox dimension values as a result of the copy : 
0013     causing CSGCopyTest.sh to fail when using exact comparisons. 
0014 
0015     As a shortcut to fixing the small bbox shift issue 
0016     can instead cheat and copy the bbox from the src when it
0017     is known that there is no selection being applied. 
0018 
0019 **/
0020 
0021 struct SBitSet ; 
0022 struct CSGFoundry ; 
0023 struct s_bb ; 
0024 
0025 #include "plog/Severity.h"
0026 #include "CSG_API_EXPORT.hh"
0027 
0028 struct CSG_API CSGCopy
0029 {
0030     static const plog::Severity LEVEL ; 
0031     static const int DUMP_RIDX ; 
0032     static const int DUMP_NPS ; // 3-bits bitfield (node,prim,solid)  7:111 6:110 5:101 4:100 3:011 2:010 1:001 0:000 
0033 
0034     static unsigned Dump( unsigned sSolidIdx ); 
0035     static CSGFoundry* Clone( const CSGFoundry* src ); 
0036     static CSGFoundry* Select(const CSGFoundry* src, const SBitSet* elv ); 
0037 
0038     const CSGFoundry* src ; 
0039     unsigned          sNumSolid ; 
0040     int*              solidMap ;  
0041     unsigned          sSolidIdx ; 
0042     const SBitSet*    elv ; 
0043     bool              identical ; // when elv->is_all_set dst should be identical to src 
0044     bool              identical_bbox_cheat ;       
0045 
0046     CSGFoundry* dst ; 
0047 
0048     CSGCopy(const CSGFoundry* src, const SBitSet* elv); 
0049     virtual ~CSGCopy(); 
0050 
0051     std::string desc() const ; 
0052     void copy() ; 
0053 
0054 #ifdef WITH_S_BB
0055     void copySolidPrim(s_bb& solid_bb, int dPrimOffset, const CSGSolid* sso ); 
0056     void copyPrimNodes(s_bb& prim_bb, const CSGPrim* spr ); 
0057     void copyNode(     s_bb& prim_bb, unsigned nodeIdx ); 
0058 #else
0059     void copySolidPrim(AABB& solid_bb, int dPrimOffset, const CSGSolid* sso ); 
0060     void copyPrimNodes(AABB& prim_bb, const CSGPrim* spr ); 
0061     void copyNode(     AABB& prim_bb, unsigned nodeIdx ); 
0062 #endif
0063     void copySolidInstances();
0064 
0065  
0066 };
0067 
0068