#pragma once #include #include #include "element.h" #include #include "Posxray.h" using namespace std; using namespace OTSDATA; class PartSTDRuleItem :public xmls::ISlo { public: std::map& GetMapElements(); virtual void Serialize(bool isStoring, tinyxml2::XMLDocument* classDoc, tinyxml2::XMLElement* rootNode) override; std::string GetHardness() const { return m_Hardness; } void SetHardness(std::string val) { m_Hardness = val; } std::string GetDensity() const { return m_Density; } void SetDensity(std::string val) { m_Density = val; } std::string GetElectrical_conductivity() const { return m_Electrical_conductivity; } void SetElectrical_conductivity(std::string val) { m_Electrical_conductivity = val; } int GetID() const { return ID; } void SetID(int val) { ID = val; } std::string GetName() const { return m_name; } void SetName(std::string val) { m_name = val; } std::string GetColor() const { return m_color; } void SetColor(std::string val) { m_color = val; } int GetGrpID() const { return m_grpId; } void SetGrpID(int val) { m_grpId = val; } std::string GetGrpName() const { return m_grpName; } void SetGrpName(std::string val) { m_grpName = val; } std::string GetGrpColor() const { return m_grpColor; } void SetGrpColor(std::string val) { m_grpColor = val; } std::vector GetUsingImgPropertyNameList() { return m_ImgPropertyList; } void SetUsingImgPropertyNameList(std::vector val) { m_ImgPropertyList = val; } std::vector GetUsingOtherpropertyList() { return m_OtherpropertyList; } void SetUsingOtherpropertyList(std::vector val) { m_OtherpropertyList = val; } std::vector GetUsingConstants() const { return m_usingConstants; } std::string GetExpressionStr() const { return m_expressionStr; } void SetExpressionStr(std::string val) { m_expressionStr = val; } CElementsList GetKeyElementList() const { return m_KeyelementList; } void SetKeyElementList(CElementsList val) { m_KeyelementList = val; } CElementsList GetSubElementList() const { return m_SubelementList; } void SetSubElementList(CElementsList val) { m_SubelementList = val; } CElementsList GetAllSortedEleList(); std::string GetFormula() const { return m_Formula; } void SetFormula(std::string val) { m_Formula = val; } std::string GetElement() const { return m_Element; } void SetElement(std::string val) { m_Element = val; } double GetBSE() const { return m_BSE; } void SetBSE(double val) { m_BSE = val; } void AddXraySpectrum(CPosXrayPtr xray); void SetIsElementAnalysis(bool isanalysis) { m_elementAnalysis = isanalysis; }; bool GetIsElementAnalysis() { return m_elementAnalysis; }; double CalculateSimilarity(CPosXrayPtr xray); private: double GetCosValue(CPosXrayPtr posXray, CPosXrayPtr posXray1, int iDataLen1); int ID; std::string m_name; std::string m_color; int m_grpId; std::string m_grpName; std::string m_grpColor; CElementsList m_KeyelementList; CElementsList m_SubelementList; std::vector m_ImgPropertyList; std::vector m_OtherpropertyList; std::vector m_usingConstants; std::string m_expressionStr; std::map m_mapEleItems; std::string m_Hardness; std::string m_Density; std::string m_Electrical_conductivity; double m_BSE; std::string m_Formula; std::string m_Element; bool m_elementAnalysis; CPosXrayList m_spectrums; }; typedef std::shared_ptr PartSTDRuleItemPtr; typedef std::vector PartSTDRuleItemList;