G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
Loading...
Searching...
No Matches
G4OCCT_STEPSolid_impl.hh File Reference

Firewall bridge between the DD4hep plugin TU and G4OCCT/OCCT. More...

#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  G4OCCT_Vertex
 Plain vertex: three doubles — no OCCT or ROOT/DD4hep types. More...
 
struct  G4OCCT_Triangle
 A single triangular facet: three vertices. More...
 
struct  G4OCCT_STEPSolidGeometry
 

Functions

G4OCCT_STEPSolidGeometry G4OCCT_ImportSTEPSolid (const std::string &name, const std::string &path)
 

Detailed Description

Firewall bridge between the DD4hep plugin TU and G4OCCT/OCCT.

Including DD4hep headers (which transitively include ROOT's TString.h) in the same translation unit as G4OCCT headers (which transitively include opencascade/Standard_CString.hxx) produces a hard error:

ROOT declares: extern void Printf(const char <em>fmt, ...); OCCT declares: Standard_EXPORT int Printf(const char theFormat, ...);

Functions that differ only in return type cannot be overloaded. The firewall pattern keeps the two include worlds in separate TUs. This header is included in both the DD4hep-facing plugin TU and the OCCT impl TU; it must not pull in either DD4hep/ROOT or G4OCCT/OCCT.

Definition in file G4OCCT_STEPSolid_impl.hh.

Function Documentation

◆ G4OCCT_ImportSTEPSolid()

G4OCCT_STEPSolidGeometry G4OCCT_ImportSTEPSolid ( const std::string &  name,
const std::string &  path 
)

Import a STEP file, tessellate it, and return the triangle mesh in mm. Throws std::runtime_error on failure or empty mesh.

Definition at line 26 of file G4OCCT_STEPSolid_impl.cc.

References G4OCCTSolid::FromSTEP(), G4OCCTSolid::GetOCCTShape(), G4OCCT_STEPSolidGeometry::triangles, and G4OCCT_Triangle::v.

Referenced by create_step_solid().