00001 /*************************************************************************** 00002 DDLBox.cc - description 00003 ------------------- 00004 begin : Wed Oct 24 2001 00005 email : case@ucdhep.ucdavis.edu 00006 ***************************************************************************/ 00007 00008 /*************************************************************************** 00009 * * 00010 * DDDParser sub-component of DDD * 00011 * * 00012 ***************************************************************************/ 00013 00014 00015 00016 // ------------------------------------------------------------------------- 00017 // Includes 00018 // ------------------------------------------------------------------------- 00019 #include "DDLBox.h" 00020 #include "DDLElementRegistry.h" 00021 #include "DDLLogicalPart.h" 00022 00023 // DDCore dependencies 00024 #include "DetectorDescription/Core/interface/DDName.h" 00025 #include "DetectorDescription/Core/interface/DDSolid.h" 00026 #include "DetectorDescription/Base/interface/DDdebug.h" 00027 00028 #include "DetectorDescription/ExprAlgo/interface/ExprEvalSingleton.h" 00029 00030 //#include <strstream> 00031 #include <string> 00032 00033 // Default constructor 00034 DDLBox::DDLBox() 00035 { 00036 } 00037 00038 // Default desctructor 00039 DDLBox::~DDLBox() 00040 { 00041 } 00042 00043 // Upon ending a Box element, call DDCore giving the box name, and dimensions. 00044 void DDLBox::processElement (const std::string& type, const std::string& nmspace) 00045 { 00046 DCOUT_V('P', "DDLBox::processElement started"); 00047 00048 ExprEvalInterface & ev = ExprEvalSingleton::instance(); 00049 DDXMLAttribute atts = getAttributeSet(); 00050 00051 DDName ddname = getDDName(nmspace); 00052 DDSolid ddbox = DDSolidFactory::box(ddname 00053 , ev.eval(nmspace, atts.find("dx")->second) 00054 , ev.eval(nmspace, atts.find("dy")->second) 00055 , ev.eval(nmspace, atts.find("dz")->second)); 00056 // Attempt to make sure Solid elements can be in LogicalPart elements. 00057 DDLSolid::setReference(nmspace); 00058 00059 DCOUT_V('P', "DDLBox::processElement completed"); 00060 }