00001 /*************************************************************************** 00002 DDLMaterial.cc - description 00003 ------------------- 00004 begin : Wed Oct 3 2002 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 "DDLMaterial.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/DDMaterial.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 DDLMaterial::DDLMaterial() 00035 { 00036 } 00037 00038 // Default desctructor 00039 DDLMaterial::~DDLMaterial() 00040 { 00041 } 00042 00043 void DDLMaterial::setReference (const std::string& nmspace) 00044 { 00045 // in case it there were any rMaterials 00046 DDLElementRegistry::getElement("rMaterial")->clear(); 00047 00048 // Attempt to make sure Material elements can be in LogicalPart elements. 00049 if (DDLElementRegistry::getElement("LogicalPart")->size() > 0) 00050 { 00051 DDXMLElement* refmat = DDLElementRegistry::getElement("rMaterial"); 00052 std::vector<std::string> names; 00053 std::vector<std::string> values; 00054 names.push_back("name"); 00055 DDXMLAttribute atts = getAttributeSet(); 00056 values.push_back(atts.find("name")->second); 00057 refmat->loadAttributes("rMaterial", names, values, nmspace); 00058 } 00059 // clear THIS material's values. 00060 clear(); 00061 00062 DCOUT_V('P', "DDLMaterial::setReference completed"); 00063 }