11#include <framework/core/Module.h>
16class G4VPhysicalVolume;
51 void event()
override;
56 void assignName(std::vector<std::string>*,
unsigned int,
const G4String&,
int);
65 void writeLVModelNode(G4LogicalVolume*,
const std::string&,
unsigned long long);
68 void writePVModelNode(G4VPhysicalVolume*,
const std::string&,
unsigned long long);
83 void writePolyhedron(G4VSolid*, G4Polyhedron*,
const std::string&,
unsigned long long);
86 void writeSolidToLV(
const std::string&,
const std::string&,
bool,
unsigned long long,
unsigned long long,
unsigned long long);
89 void writeSolidToPV(
const std::string&,
const std::string&,
bool,
unsigned long long,
unsigned long long,
unsigned long long);
92 void writeLVToPV(
const std::string&,
const std::string&,
unsigned long long,
unsigned long long);
95 void writePVToParentLV(
const std::string&,
const std::string&,
unsigned long long,
unsigned long long);
98 void writePVToParentPV(
const std::string&,
const std::string&,
unsigned long long,
unsigned long long);
126 std::vector<unsigned long long>*
m_PVID{
nullptr};
129 std::vector<unsigned long long>*
m_LVID{
nullptr};
132 std::vector<unsigned long long>*
m_MatID{
nullptr};
std::vector< unsigned int > * m_PVCount
Count of number of instances of each physical volume.
void writePVToParentLV(const std::string &, const std::string &, unsigned long long, unsigned long long)
Write FBX connection for each physical-volume daughter of a parent logical volume.
std::vector< unsigned long long > * m_LVID
Unique identifiers for logical volumes (Model nodes with links to Geometry and Material)
void writeLVToPV(const std::string &, const std::string &, unsigned long long, unsigned long long)
Write FBX connection for the (unique) logical volume of a physical volume.
void addConnections(G4VPhysicalVolume *, int)
Write FBX connections among all of the nodes in the tree (recursive)
FBXWriterModule()
Constructor of the module.
void initialize() override
Initialize at the start of a job.
std::vector< unsigned int > * m_LVReplicas
Count of number of replicas of each logical volume associated with a replicated physical volume.
void event() override
Called for each event: this runs the FBX writer only for the first event.
void addModels(G4VPhysicalVolume *, int)
Process one physical volume for FBX-node writing (recursive)
std::vector< unsigned int > * m_PVReplicas
Count of number of replicas of each replicated physical volume.
std::ofstream m_File
Output file.
void writeSolidToPV(const std::string &, const std::string &, bool, unsigned long long, unsigned long long, unsigned long long)
Write FBX connection for each physical volume's solid and color info (bypass singleton logical volume...
bool m_UsePrototypes
User-specified flag to select whether to write and re-use logical- and physical-volume prototypes onc...
std::vector< unsigned long long > * m_PVID
Unique identifiers for physical volumes (Model nodes with transformation information)
bool m_First
Once-only flag to write FBX only on the first event.
void writePreamble(int, int, int)
Write FBX at the start of the file.
std::vector< bool > * m_Visible
Flag to indicate that the logical volume is visible.
void writePVModelNode(G4VPhysicalVolume *, const std::string &, unsigned long long)
Write FBX definition for each physical volume.
std::vector< bool > * m_LVUnique
Flag to indicate that a logical volume is referenced at most once (eligible for bypass)
void assignName(std::vector< std::string > *, unsigned int, const G4String &, int)
Create unique and legal name for each solid, logical volume, physical volume.
std::vector< unsigned int > * m_SolidCount
Count of number of instances of each solid (typically 1)
void writeLVModelNode(G4LogicalVolume *, const std::string &, unsigned long long)
Write FBX definition for each logical volume.
void countEntities(G4VPhysicalVolume *)
Count the physical volumes, logical volumes, materials and solids (recursive)
std::string m_Filename
User-specified output filename.
std::vector< std::string > * m_PVName
Modified (legal-character and unique) physical-volume name.
std::vector< unsigned int > * m_SolidReplicas
Count of number of replicas of each solid (extras for replicas with modified solids)
std::vector< std::string > * m_SolidName
Modified (legal-character and unique) solid name.
std::vector< unsigned long long > * m_SolidID
Unique identifiers for solids (Geometry nodes)
std::vector< unsigned int > * m_LVCount
Count of number of instances of each logical volume.
std::vector< unsigned long long > * m_MatID
Unique identifiers for logical volumes' color information (Material nodes)
void writeMaterialNode(int, const std::string &)
Write FBX definition for each logical volume's color information.
void writePVToParentPV(const std::string &, const std::string &, unsigned long long, unsigned long long)
Write FBX connection for each physical-volume daughter of a parent physical volume (bypass singleton ...
HepPolyhedron * getBooleanSolidPolyhedron(G4VSolid *)
Create polyhedron for a boolean solid (recursive)
std::vector< std::string > * m_LVName
Modified (legal-character and unique) logical-volume name.
void writeGeometryNode(G4VSolid *, const std::string &, unsigned long long)
Write FBX definition for each solid's polyhedron.
void writePolyhedron(G4VSolid *, G4Polyhedron *, const std::string &, unsigned long long)
Write FBX definition for the solid's polyhedron.
void writeSolidToLV(const std::string &, const std::string &, bool, unsigned long long, unsigned long long, unsigned long long)
Write FBX connection for each logical volume's solid and color info.
Abstract base class for different kinds of events.