#ifndef AGDDSOLIDHH #define AGDDSOLIDHH #include #include #include "ExpatInterface/Element.h" #include "agddSection.hh" //#include "agddBase.hh" #include "agddVolume.hh" #include "agddAttribute.hh" #include "agddMaterial.hh" #include "agddInnerStruct.hh" #include "DWUnits.hh" namespace agdd { class Solid : public Volume { private: Material * _materialPtr; Attribute _materialAtt; InnerStruct * _innerStruct; public: explicit Solid(const string & shape, agdd::Section & sec) : Volume(shape, sec), _materialPtr(0), _materialAtt("material", Attribute::required), _innerStruct(0) { }; virtual void putMeIn(xml::Element & parent) = 0; protected: void willAppendTheRestTo(xml::Element & elt) { cout << "Appending Solid information ... " << flush; //material // LESTER This will change when material is defined properly. if (_materialPtr) { // we point to a true material elt.addAttribute("material", _materialPtr->getName()); } else { // We have to use an externally defined material. _materialAtt.addAttributeTo(&elt); } //innerstruct // LESTER Omit for the moment cout << "done." << endl; }; public: Solid & setMaterial(const std::string & name) { cerr << "WARNING. You are supplying me with the NAME of " << "a material (possibly beacuse the material is defined " << "elsewhere) rather than a REFERENCE to a material. " << "This means that I have no way of checking the " << "validity of this reference." << endl; assert(name!=static_cast("")); _materialAtt.setValue(name); return *this; }; Solid & setMaterial(Material & mat) { _materialPtr = &mat; return *this; }; Solid & setInnerStruct() ; // LESTER Must complete. }; } #endif