123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- #pragma once
- #include "OTSParticle.h"
- #include "OTSFeatureClr.h"
- #include <PosXrayClr.h>
- #include <msclr\marshal.h>
- #include <msclr\marshal_cppstd.h>
- 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<std::string>(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<std::string>(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<std::string>(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<std::string>(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<std::string>(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<COTSParticleClr^> COTSParticleListClr;
- }
|