123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- #include "stdafx.h"
- #include "OTSSegmentClr.h"
- #include "OTSSegment.h"
- #include "../OTSLog/COTSUtilityDllFunExport.h"
- namespace OTSCLRINTERFACE {
- using namespace OTSDATA;
- COTSSegmentClr::COTSSegmentClr()
- {
- m_Segment = new COTSSegmentPtr(new COTSSegment());
- }
- COTSSegmentClr::COTSSegmentClr(long a_nHeight, long a_nStart, long a_nLength) // constructor
- {
- m_Segment = new COTSSegmentPtr(new COTSSegment(a_nHeight, a_nStart, a_nLength));
- }
- COTSSegmentClr::COTSSegmentClr(COTSSegmentPtr a_pSegment) // copy constructor
- {
-
- ASSERT(a_pSegment);
- if (!a_pSegment)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSParticleClr: Generate COTSParticleClr pointer failed."));
- return;
- }
-
-
- m_Segment = new COTSSegmentPtr(a_pSegment);
-
-
- }
- COTSSegmentClr::COTSSegmentClr(COTSSegmentClr^ a_pSource)
- {
- auto src = a_pSource->GetOTSSegmentPtr();
- m_Segment = new COTSSegmentPtr(new COTSSegment(src.get()));
- }
- COTSSegmentClr::COTSSegmentClr(COTSSegment* a_pSource) // copy constructor
- {
- ASSERT(a_pSource);
- if (!a_pSource)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSegmentClr: Generate COTSSegmentClr pointer failed."));
- return;
- }
- m_Segment = new COTSSegmentPtr(new COTSSegment(a_pSource));
- }
-
- COTSSegmentPtr COTSSegmentClr::GetOTSSegmentPtr()
- {
- return *m_Segment;
- }
- COTSSegmentClr::~COTSSegmentClr()
- {
- if (m_Segment != nullptr)
- {
- delete m_Segment;
- m_Segment = nullptr;
- }
- }
- COTSSegmentClr::!COTSSegmentClr()
- {
- if (m_Segment != nullptr)
- {
- delete m_Segment;
- m_Segment = nullptr;
- }
- }
- long COTSSegmentClr::GetHeight()
- {
- long nHeight = -1;
- if (m_Segment != nullptr)
- {
- nHeight = m_Segment->get()->GetHeight();
- }
- return nHeight;
- }
- void COTSSegmentClr::SetHeight(long a_nHeight)
- {
- if (m_Segment != nullptr)
- {
- m_Segment->get()->SetHeight(a_nHeight);
- }
- }
- long COTSSegmentClr::GetStart()
- {
- long nStart = -1;
- if (m_Segment != nullptr)
- {
- nStart =m_Segment->get()->GetStart();
- }
- return nStart;
- }
- void COTSSegmentClr::SetStart(long a_nStart)
- {
- if (m_Segment != nullptr)
- {
- m_Segment->get()->SetStart(a_nStart);
- }
- }
- long COTSSegmentClr::GetLength()
- {
- long nLength = -1;
- if (m_Segment != nullptr)
- {
- nLength = m_Segment->get()->GetLength();
- }
- return nLength;
- }
- void COTSSegmentClr::SetLength(long a_nLength)
- {
- if (m_Segment != nullptr)
- {
- m_Segment->get()->SetLength(a_nLength);
- }
- }
- long COTSSegmentClr::GetEnd()
- {
- long nEnd = -1;
- if (m_Segment != nullptr)
- {
- nEnd = m_Segment->get()->GetEnd();
- }
- return nEnd;
- }
- void COTSSegmentClr::SetEnd(long end)
- {
-
- if (m_Segment != nullptr)
- {
- m_Segment->get()->SetEnd(end);
- }
- }
- void COTSSegmentClr::UpDownConection(COTSSegmentClr^ otherSeg)
- {
- auto seg = otherSeg->GetOTSSegmentPtr();
- m_Segment->get()->UpDownConection(seg.get());
- }
- }
|