123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- #include "stdafx.h"
- #include "HoleBSEImg.h"
- namespace OTSDATA {
- IMPLEMENT_SERIAL(CHoleBSEImg, CObject, 1)
- CHoleBSEImg::CHoleBSEImg()
- {
- Init();
- }
- CHoleBSEImg::CHoleBSEImg(CRect a_rectImage, int a_nHoleID, CPoint a_poiPosition) // constructor
- {
- Init();
- // set image rectangle and create memory for image data
- SetImageRect(a_rectImage);
- m_nHoleID = a_nHoleID;
- m_poiPosition = a_poiPosition;
- }
- CHoleBSEImg::CHoleBSEImg(const CHoleBSEImg& a_oSource) // copy constructor
- {
- // can't copy itself
- if (&a_oSource == this)
- {
- return;
- }
- // copy data over
- Duplicate(a_oSource);
- }
- CHoleBSEImg::CHoleBSEImg(CHoleBSEImg* a_poSource) // copy constructor
- {
- // input check
- ASSERT(a_poSource);
- if (!a_poSource)
- {
- return;
- }
- // can't copy itself
- if (a_poSource == this)
- {
- return;
- }
- // copy data over
- Duplicate(*a_poSource);
- }
- CHoleBSEImg& CHoleBSEImg::operator=(const CHoleBSEImg& a_oSource) // =operator
- {
- // cleanup
- Cleanup();
- // copy the class data over
- Duplicate(a_oSource);
- // return class
- return *this;
- }
- CHoleBSEImg::~CHoleBSEImg()
- {
- // cleanup
- Cleanup();
- }
- // sterilizations
- void CHoleBSEImg::Serialize(CArchive& ar)
- {
- // store?
- if (ar.IsStoring())
- {
- // store
- ar << m_nHoleID;
- ar << m_poiPosition;
- }
- else
- {
- // load
- ar >> m_nHoleID;
- ar >> m_poiPosition;
- }
- // base object serialization
- CBSEImg::Serialize(ar);
- }
- /*void CHoleBSEImg::Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode)
- {
- xmls::xInt xnHoleID;
- xmls::xPoint xpoiPosition;
- Register("HoleID", &xnHoleID);
- Register("Position", &xpoiPosition);
- if (isStoring)
- {
- xnHoleID = m_nHoleID;
- xpoiPosition = m_poiPosition;
- Slo::Serialize(true, classDoc, rootNode);
- }
- else
- {
- xmls::Slo::Serialize(false, classDoc, rootNode);
- m_nHoleID = xnHoleID.value();
- m_poiPosition = xpoiPosition.value();
- }
- }*/
- // cleanup
- void CHoleBSEImg::Cleanup()
- {
- }
- // Initialization
- void CHoleBSEImg::Init()
- {
- // base class initialization
- CBSEImg::Init();
- // initialization
- m_nHoleID = 0;
- m_poiPosition = CPoint(0, 0);
- }
- // duplication
- void CHoleBSEImg::Duplicate(const CHoleBSEImg& a_oSource)
- {
- // initialization
- Init();
- // base class duplication
- CBSEImg::Duplicate(a_oSource);
- // copy data over
- m_nHoleID = a_oSource.m_nHoleID;
- m_poiPosition = a_oSource.m_poiPosition;
- }
- }
|