EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicStlFactory Class Reference

#include <EicRoot/blob/master/eic/cad/EicStlFactory.h>

+ Inheritance diagram for EicStlFactory:
+ Collaboration diagram for EicStlFactory:

Public Types

enum  StlFileType { Undefined, BinaryStl, AsciiStl, AsciiSlp }
 

Public Member Functions

 EicStlFactory (const char *volume_name, const char *geometry_file_name, const EicCadFileConfig *config, bool acknowledge_config_file_scaling=true)
 
 EicStlFactory ()
 
 ~EicStlFactory ()
 
gEntrymgroups (void)
 
void _ConstructGeometry (TGeoVolume *mother, TVector3 shift, bool swapXY=false, std::vector< TGeoVolume * > *volumes=0)
 
int CreateRootFile (TGeoVolume *mother, const char *bname)
 

Private Member Functions

void ImportBinaryStlFile (FILE *fin, unsigned trCount, double scale=1.0)
 
void ImportAsciiStlSlpFile (double scale=1.0)
 
void PreAllocateFacet (unsigned solidId, const TGeoMedium *medium, const double vCoord1[], const double vCoord2[], const double vCoord3[])
 
void DumpTmpStlFile (EicStlAssembly *assembly, TString &stlActualFileName)
 

Private Attributes

FairLoggermLogger
 
StlFileType mType
 
const EicCadFileConfigmConfig
 
gEntry mGroups
 
TString mVolumeName
 
TString mGeometryName
 

Detailed Description

Definition at line 26 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 26 of file EicStlFactory.h

Member Enumeration Documentation

Either binary or ASCII STL, as well as ASCII SLP files are allowed as input; STL/SLP is decided based on file extension, binary/ASCII based on file length

Enumerator:
Undefined 
BinaryStl 
AsciiStl 
AsciiSlp 

Definition at line 37 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 37 of file EicStlFactory.h

Constructor & Destructor Documentation

EicStlFactory::EicStlFactory ( const char *  volume_name,
const char *  geometry_file_name,
const EicCadFileConfig config,
bool  acknowledge_config_file_scaling = true 
)

Definition at line 258 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 258 of file EicStlFactory.cxx

References _BINARY_STL_HEADER_SIZE_, AsciiSlp, AsciiStl, BinaryStl, FairLogger::Fatal(), EicMediaHub::fSingleMedium, FairLogger::GetLogger(), ImportAsciiStlSlpFile(), ImportBinaryStlFile(), mConfig, MESSAGE_ORIGIN, mGeometryName, EicCadFileConfig::mhub(), mLogger, mType, EicCadFileConfig::scale(), and EicCadFileConfig::units().

+ Here is the call graph for this function:

EicStlFactory::EicStlFactory ( )
inline

Definition at line 31 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 31 of file EicStlFactory.h

EicStlFactory::~EicStlFactory ( )
inline

Definition at line 33 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 33 of file EicStlFactory.h

Member Function Documentation

void EicStlFactory::_ConstructGeometry ( TGeoVolume *  mother,
TVector3  shift,
bool  swapXY = false,
std::vector< TGeoVolume * > *  volumes = 0 
)

Definition at line 470 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 470 of file EicStlFactory.cxx

References EicStlMediaGroup::assemblies(), CreateTetrahedron(), DumpTmpStlFile(), FairLogger::Fatal(), EicStlKey::GetData(), EicCadFileConfig::GetStlVertexMergingTolerance(), in, it, EicStlVertex::key(), tetgenio::load_stl(), mConfig, MESSAGE_ORIGIN, mGeometryName, mGroups, mLogger, eic::mm, mVolumeName, name, tetgenio::numberofpoints, tetgenio::numberoftetrahedra, EicStlMediaGroup::SplitIntoAssemblies(), swapXYfun(), tetrahedralize(), EicStlMediaGroup::vertices(), vtx(), and wireframe().

Referenced by EicCadFile::ConstructGeometry().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int EicStlFactory::CreateRootFile ( TGeoVolume *  mother,
const char *  bname 
)

Definition at line 621 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 621 of file EicStlFactory.cxx

References EicStlMediaGroup::assemblies(), CreateTetrahedron(), DumpTmpStlFile(), EicMediaHub::fSingleMedium, EicCadFileConfig::GetStlVertexMergingTolerance(), in, it, tetgenio::load_stl(), mConfig, mGroups, EicCadFileConfig::mhub(), mVolumeName, name, tetgenio::numberofpoints, tetgenio::numberoftetrahedra, printf(), EicStlMediaGroup::SplitIntoAssemblies(), and tetrahedralize().

Referenced by EicCadWizard::CreateStlSolidRootFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EicStlFactory::DumpTmpStlFile ( EicStlAssembly assembly,
TString &  stlActualFileName 
)
private

Definition at line 334 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 334 of file EicStlFactory.cxx

References EicStlAssembly::facets(), FairLogger::Fatal(), EicStlFacet::GetNormal(), MESSAGE_ORIGIN, mLogger, sign(), and EicStlFacet::vertices().

Referenced by _ConstructGeometry(), and CreateRootFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EicStlFactory::ImportAsciiStlSlpFile ( double  scale = 1.0)
private

Definition at line 120 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 120 of file EicStlFactory.cxx

References AsciiSlp, AsciiStl, buffer, color, EicMediaHub::fSingleMedium, EicMediaHub::GetMedium(), ip(), mConfig, mGeometryName, EicCadFileConfig::mhub(), mType, and PreAllocateFacet().

Referenced by EicStlFactory().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EicStlFactory::ImportBinaryStlFile ( FILE *  fin,
unsigned  trCount,
double  scale = 1.0 
)
private

Definition at line 77 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 77 of file EicStlFactory.cxx

References EicMediaHub::fSingleMedium, mConfig, EicCadFileConfig::mhub(), and PreAllocateFacet().

Referenced by EicStlFactory().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

gEntry& EicStlFactory::mgroups ( void  )
inline

Definition at line 39 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 39 of file EicStlFactory.h

References mGroups.

Referenced by EicCompositeShape::LocalFillBuffer3D().

+ Here is the caller graph for this function:

void EicStlFactory::PreAllocateFacet ( unsigned  solidId,
const TGeoMedium *  medium,
const double  vCoord1[],
const double  vCoord2[],
const double  vCoord3[] 
)
private

Facet allocation call during STL file input stage

Parameters
solidId0-based index of "solid - endsolid" block in the ASCII STL/SLP files; 0 for binary STL
mediummedium pointer
vCoord11-st vertex coordinates
vCoord22-d vertex coordinates
vCoord33-d vertex coordinates

Definition at line 32 of file EicStlFactory.cxx.

View newest version in sPHENIX GitHub at line 32 of file EicStlFactory.cxx

References EicStlMediaGroup::AddVertex(), Acts::Test::at, EicStlKey::GetData(), EicStlVertex::key(), EicStlMediaGroup::mFbuffer, mGroups, v1, v2, v3, EicStlMediaGroup::vertices(), vtx(), EicStlMediaGroup::xCoord, EicStlMediaGroup::yCoord, and EicStlMediaGroup::zCoord.

Referenced by ImportAsciiStlSlpFile(), and ImportBinaryStlFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

const EicCadFileConfig* EicStlFactory::mConfig
private

Definition at line 54 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 54 of file EicStlFactory.h

Referenced by _ConstructGeometry(), CreateRootFile(), EicStlFactory(), ImportAsciiStlSlpFile(), and ImportBinaryStlFile().

TString EicStlFactory::mGeometryName
private

Definition at line 60 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 60 of file EicStlFactory.h

Referenced by _ConstructGeometry(), EicStlFactory(), and ImportAsciiStlSlpFile().

gEntry EicStlFactory::mGroups
private

Ordered map of medium-separated objects

Definition at line 57 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 57 of file EicStlFactory.h

Referenced by _ConstructGeometry(), CreateRootFile(), mgroups(), and PreAllocateFacet().

FairLogger* EicStlFactory::mLogger
private

Definition at line 46 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 46 of file EicStlFactory.h

Referenced by _ConstructGeometry(), DumpTmpStlFile(), and EicStlFactory().

StlFileType EicStlFactory::mType
private

Input STL/SLP file type

Definition at line 49 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 49 of file EicStlFactory.h

Referenced by EicStlFactory(), and ImportAsciiStlSlpFile().

TString EicStlFactory::mVolumeName
private

Definition at line 59 of file EicStlFactory.h.

View newest version in sPHENIX GitHub at line 59 of file EicStlFactory.h

Referenced by _ConstructGeometry(), and CreateRootFile().


The documentation for this class was generated from the following files: