#pragma once #include "OTSParticle.h" #include "OTSFeatureClr.h" #include #include #include namespace OTSCLRINTERFACE { using namespace System; using namespace System::Drawing; using namespace OTSDATA; using namespace msclr::interop; using namespace System::Runtime::InteropServices; public ref class COTSParticleClr { public: // constructor COTSParticleClr(); // constructor COTSParticleClr(COTSParticlePtr); // copy constructor COTSParticleClr(COTSParticleClr^); COTSParticleClr(COTSParticle*); ~COTSParticleClr(); !COTSParticleClr(); COTSParticlePtr GetOTSParticlePtr(); //can only be used in C++, because the original C++ type. // rectangle System::Drawing::Rectangle^ GetParticleRect(); void SetParticleRect(System::Drawing::Rectangle^ a_rectParticle); //Type int GetType(); void SetType(int a_nType); //Type int GetClassifyId(); void SetClassifyId(int a_nType); //area double GetActualArea(); void SetArea(double a_dArea); // gray BYTE GetAveGray(); void SetAveGray(BYTE a_cAveGray); // x-ray position System::Drawing::Point^ GetXRayPos(); void SetXRayPos(System::Drawing::Point^ a_pXRayPos); void CalXrayPos() { m_Particle->get()->CalXRayPos(); } void SetAbsolutPos(System::Drawing::Point^ a_pAbsPos); System::Drawing::Point^ GetAbsolutPos() { return gcnew System::Drawing::Point(m_Particle->get()->GetAbsolutPos().x, m_Particle->get()->GetAbsolutPos().y); } // feature COTSFeatureClr^ GetFeature(); void SetFeature(COTSFeatureClr^ a_pFeautre); void SetXray(CPosXrayClr^ xray); CPosXrayClr^ GetXray(); // tag id int GetTagId(); void SetTagId(int a_nTagId); // search id int GetSearchId(); void SetSearchId(int a_nSearchId); // analysis id int GetAnalysisId(); void SetAnalysisId(int a_nAnalysisId); // field id int GetFieldId(); void SetFieldId(int a_nFieldId); /*double GetArea() { return m_Particle->get()->GetArea(); }*/ double GetDMAX() { return m_Particle->get()->GetDMax(); } void SetDMAX(double val) { return m_Particle->get()->SetDMax(val); } double GetDMIN() { return m_Particle->get()->GetDMin(); } void SetDMIN(double val) { return m_Particle->get()->SetDMin(val); } double GetDMPERP() { return m_Particle->get()->GetDPerp(); } void SetDMPERP(double val) { return m_Particle->get()->SetDPerp(val); } double GetDINSCR() { return m_Particle->get()->GetDInscr (); } void SetDINSCR(double val) { return m_Particle->get()->SetDInscr(val); } double GetDMEAN() { return m_Particle->get()->GetDMean(); } void SetDMEAN(double val) { return m_Particle->get()->SetDMean(val); } double GetDELONG() { return m_Particle->get()->GetDElong(); } void SetDELONG(double val) { return m_Particle->get()->SetDElong(val); } double GetDPRIMETER() { return m_Particle->get()->GetPerimeter(); } void SetDPRIMETER(double val) { return m_Particle->get()->SetPerimeter(val); } double GetORIENTATION() { return m_Particle->get()->GetOrientation(); } void SetORIENTATION(double val) { return m_Particle->get()->SetOrientation(val); } double GetEqualCircleDiameter() { return m_Particle->get()->GetEqualCircleDiameter(); } double GetFeretDiameter() { return m_Particle->get()->GetFeretDiameter(); } void SetFeretDiameter(double val) { return m_Particle->get()->SetFeretDiameter(val); } String^ GetTypeName() { return gcnew String(m_Particle->get()->TypeName().c_str()); } void SetTypeName(String^ val) { std::string val1 = marshal_as(val); return m_Particle->get()->TypeName(val1); } String^ GetTypeColor() { return gcnew String(m_Particle->get()->TypeColor().c_str()); } void SetTypeColor(String^ val) { std::string val1 = marshal_as(val); return m_Particle->get()->TypeColor(val1); } String^ GetSubParticles() { return gcnew String(m_Particle->get()->GetSubParticles().c_str()); } void SetSubParticles(String^ val) { std::string val1 = marshal_as(val); return m_Particle->get()->SetSubParticles(val1); } String^ GetGrpName() { return gcnew String(m_Particle->get()->GetGroupName().c_str()); } void SetGrpName(String^ val) { std::string val1 = marshal_as(val); return m_Particle->get()->SetGroupName(val1); } String^ GetGrpColor() { return gcnew String(m_Particle->get()->GetGroupColor().c_str()); } void SetGrpColor(String^ val) { std::string val1 = marshal_as(val); return m_Particle->get()->SetGroupColor(val1); } int GetGrpId() { return m_Particle->get()->GetGroupId(); } void SetGrpId(int grpid) { m_Particle->get()->SetGroupId(grpid); } protected: COTSParticlePtr* m_Particle; }; typedef System::Collections::Generic::List COTSParticleListClr; }