Skip to content
Snippets Groups Projects
Commit 4473ca8b authored by clantz's avatar clantz
Browse files

removed explicit CADMesh dependencies

parent bd29ebf1
No related branches found
No related tags found
No related merge requests found
......@@ -19,14 +19,6 @@ endif()
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package (ROOT REQUIRED)
include(${ROOT_USE_FILE})
#----------------------------------------------------------------------------
# Find CADMesh
find_package(cadmesh)
include_directories(${CADMESH_INCLUDE_DIRS})
if(CADMESH_INCLUDE_DIRS)
add_definitions(-DCADMESH)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
......@@ -44,7 +36,7 @@ file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
# Add the executable, and link it to the Geant4 libraries
#
add_executable(lightGuide lightGuide.cc ${sources} ${headers})
target_link_libraries(lightGuide ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} cadmesh )
target_link_libraries(lightGuide ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} )
add_executable(plotHisto ${DEPENDENCIES} Analysis/plotHisto.cc)
TARGET_LINK_LIBRARIES(plotHisto ${ROOT_LIBRARIES})
......
......@@ -40,10 +40,6 @@
#include "G4GDMLParser.hh"
#include "G4RunManager.hh"
#ifdef CADMESH
#include "CADMesh.hh"
#endif
#include "Materials.hh"
#include "DetectorMessenger.hh"
......@@ -80,10 +76,6 @@ class DetectorConstruction : public G4VUserDetectorConstruction
G4LogicalVolume* m_logicHalfWorld;
G4VPhysicalVolume* m_physHalfWorld;
#ifdef CADMESH
CADMesh* m_mesh;
#endif
G4LogicalVolume* m_logicLightGuide;
G4VPhysicalVolume* m_physLightGuide;
......
......@@ -74,10 +74,6 @@ DetectorConstruction::DetectorConstruction()
m_filler = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR");
m_GasMPT = new G4MaterialPropertiesTable();
m_filler->SetMaterialPropertiesTable(m_GasMPT);
#ifdef CADMESH
m_mesh = 0;
#endif
}
......@@ -282,27 +278,17 @@ void DetectorConstruction::UseCADModel(G4String fileName){
if(m_logicLightGuide) delete m_logicLightGuide;
if(m_physLightGuide) delete m_physLightGuide;
G4String fileType = fileName.substr( fileName.last('.') + 1, fileName.size() - fileName.last('.'));
#ifdef CADMESH
if(fileType == "stl"){
if(m_mesh != 0) delete m_mesh;
m_mesh = new CADMesh((char*) fileName.c_str());
m_mesh->SetScale(mm);
m_mesh->SetOffset( G4ThreeVector(-20*cm, 0, 0) );
m_mesh->SetReverse(false);
m_logicLightGuide =
new G4LogicalVolume(m_mesh->TessellatedMesh(), //solid
materials->Al, //material
"LightGuide"); //name
G4String fileType;
if(fileName.last('.') != std::string::npos){
fileType = fileName.substr( fileName.last('.') + 1, fileName.size() - fileName.last('.'));
}else{
fileType = "geom";
}
#endif
if(fileType == "gdml"){
m_Parser.Read(fileName);
}
if(fileType == "step"){
if(fileType == "geom"){
m_logicLightGuide = m_Parser.ParseST(fileName,materials->Air,materials->Al);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment