| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #include "stdafx.h"
- #include "HoleBSEImgClr.h"
- #include "BSEImgClr.h"
- namespace OTSINTERFACE {
- CHoleBSEImgClr::CHoleBSEImgClr()
- {
- m_HoleBSEImg = new CHoleBSEImgPtr(new CHoleBSEImg());
- }
- CHoleBSEImgClr::CHoleBSEImgClr(System::Drawing::Rectangle^ a_rectImage, int a_nHoleID) // constructor
- {
- CHoleBSEImgPtr d = GetHoleBSEImgPtr();
- CRect* r = new CRect(a_rectImage->Left, a_rectImage->Top, a_rectImage->Right, a_rectImage->Bottom);
- m_LpBSEImg = new CBSEImgPtr(new CBSEImg(r));
- d->SetHoleID(a_nHoleID);
- }
- CHoleBSEImgClr::CHoleBSEImgClr(CHoleBSEImgPtr a_pHoleBSEImg) // copy constructor
- {
- ASSERT(a_pHoleBSEImg);
- if (!a_pHoleBSEImg)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("CHoleBSEImgClr: Generate CHoleBSEImgClr pointer failed."));
- return;
- }
-
-
- m_HoleBSEImg = new CHoleBSEImgPtr(a_pHoleBSEImg);
-
- }
- CHoleBSEImgClr::CHoleBSEImgClr(CHoleBSEImg* a_pSource) // copy constructor
- {
- ASSERT(a_pSource);
- if (!a_pSource)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("CHoleBSEImgClr: Generate CHoleBSEImgClr pointer failed."));
- return;
- }
- m_HoleBSEImg = new CHoleBSEImgPtr(new CHoleBSEImg(a_pSource));
- }
- CHoleBSEImgClr::~CHoleBSEImgClr()
- {
- if (m_HoleBSEImg != nullptr)
- {
- delete m_HoleBSEImg;
- m_HoleBSEImg = nullptr;
- }
- }
- CHoleBSEImgClr::!CHoleBSEImgClr()
- {
- if (m_HoleBSEImg != nullptr)
- {
- delete m_HoleBSEImg;
- m_HoleBSEImg = nullptr;
- }
- }
- int CHoleBSEImgClr::GetHoleID()
- {
- int nParticleType = -1;
- if (m_HoleBSEImg != nullptr)
- {
- nParticleType = (int)m_HoleBSEImg->get()->GetHoleID();
- }
- return nParticleType;
- }
- void CHoleBSEImgClr::SetHoleID(int a_nHoleID)
- {
- if (m_HoleBSEImg != nullptr)
- {
- m_HoleBSEImg->get()->SetHoleID(a_nHoleID);
- }
- }
- // get CHoleBSEImgPtr
- CHoleBSEImgPtr CHoleBSEImgClr::GetHoleBSEImgPtr()
- {
- return *m_HoleBSEImg;
- }
-
- }
|