#ifndef ABSTRACTELEMENTDEFINITION_SEEN #define ABSTRACTELEMENTDEFINITION_SEEN #include #include #include #include "nomdElements.h" #include "abstractSoftware.h" #include "UAP/UAPNode.hpp" #include "AMLtools.h" using namespace std; class abstractElement { protected : int nbParam_; string* parametersString_; string defaultSpecificName_; string specificName_; nomdElements elementName_; double defaultLength_; double defaultAperture_; double phaseStepMax_; double lenghtElem_; // cm double aperture_; // cm double stepmaxcm_; void setDefaultValues(); void setDefaults(); inline UAPNode* setAMLelementHeader(UAPNode* elementNode) { UAPNode* ele = elementNode->addChild("element"); ele->addAttribute("name",specificName_); UAPNode* node = ele->addChild("description"); node->addAttribute("type",elementName_.getGenericLabel()); return ele; } inline bool checkAMLelementGenericName(UAPNode* entree) { if ( !entree ) return false; string nonGenerique; AMLtools::readAMLParameterAttribut(entree, "description", "type", nonGenerique); if ( nonGenerique != elementName_.getGenericLabel() ) { cout << " abstractElement::checkAMLelementGenericName ERREUR d'element : " << nonGenerique << " ? attendu : " << elementName_.getGenericLabel() << endl; return false; } specificName_ = entree->getAttribute("name")->getValue(); return true; } public : abstractElement(); abstractElement(string lab); virtual ~abstractElement(); void setParameters(double ll,double aper); nomdElements getNomdElement() const; int getNbParams() const; void setLabel(string lab); string getLabel() const; double getLenghtOfElement() const; virtual void setPhaseStep(double); virtual double getInitialKineticEnergy() const; virtual void setParametersString(string* param) = 0; virtual string* getParametersString() const = 0; // virtual string FileOutputFlow() const = 0; virtual vector< pair > > parametersToSoftware () const =0; // virtual void FileInput(ifstream& ifs) = 0; virtual string print() = 0; virtual void InputRep(UAPNode* root) = 0; virtual void FileAMLInput(UAPNode* entree) = 0; }; #endif