126 lines
2.5 KiB
C++
126 lines
2.5 KiB
C++
//------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2011, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TDbExtentsZoneCell类
|
|
// = Version : ver1.0
|
|
// = Author : cet
|
|
// = CreateDate : 2011-08-12
|
|
// = Description: 分区单元类实现
|
|
// = Maintainers:
|
|
//
|
|
//------------------------------------------------------------------------+
|
|
|
|
#include "StdAfx.h"
|
|
#ifdef TASD
|
|
#include "TDbExtentsZoneCell.h"
|
|
|
|
TDbExtentsZoneCell::TDbExtentsZoneCell()
|
|
{
|
|
memset(m_szDxf, 0, 20 * sizeof(TCHAR));
|
|
}
|
|
|
|
TDbExtentsZoneCell::TDbExtentsZoneCell( const TDbExtentsZoneCell& src )
|
|
{
|
|
m_id = src.m_id;
|
|
m_ptMax = src.m_ptMax;
|
|
m_ptMin = src.m_ptMin;
|
|
_tcsncpy(m_szDxf, src.m_szDxf, 20);
|
|
}
|
|
|
|
TDbExtentsZoneCell::~TDbExtentsZoneCell()
|
|
{
|
|
|
|
}
|
|
|
|
TDbExtentsZoneCell& TDbExtentsZoneCell::operator=( const TDbExtentsZoneCell& src )
|
|
{
|
|
if ((void *)this == (void*)&src)
|
|
{
|
|
return *this;
|
|
}
|
|
|
|
m_id = src.m_id;
|
|
m_ptMax = src.m_ptMax;
|
|
m_ptMin = src.m_ptMin;
|
|
_tcsncpy(m_szDxf, src.m_szDxf, 20);
|
|
return *this;
|
|
}
|
|
|
|
bool TDbExtentsZoneCell::operator==( const TDbExtentsZoneCell& src )
|
|
{
|
|
bool bRet = false;
|
|
if (m_id == src.m_id && m_ptMin == src.m_ptMin
|
|
&& m_ptMax == src.m_ptMax && _tcscmp(m_szDxf, src.m_szDxf) == 0)
|
|
{
|
|
bRet = true;
|
|
}
|
|
return bRet;
|
|
}
|
|
|
|
AcDbObjectId TDbExtentsZoneCell::GetObjectId() const
|
|
{
|
|
return m_id;
|
|
}
|
|
|
|
void TDbExtentsZoneCell::SetObjectId( AcDbObjectId idObj )
|
|
{
|
|
m_id = idObj;
|
|
}
|
|
|
|
AcGePoint3d TDbExtentsZoneCell::GetPtMin() const
|
|
{
|
|
return m_ptMin;
|
|
}
|
|
|
|
void TDbExtentsZoneCell::SetPtMin( AcGePoint3d ptMin )
|
|
{
|
|
m_ptMin = ptMin;
|
|
}
|
|
|
|
AcGePoint3d TDbExtentsZoneCell::GetPtMax() const
|
|
{
|
|
return m_ptMax;
|
|
}
|
|
|
|
void TDbExtentsZoneCell::SetPtMax( AcGePoint3d ptMax )
|
|
{
|
|
m_ptMax = ptMax;
|
|
}
|
|
|
|
CString TDbExtentsZoneCell::GetDxf() const
|
|
{
|
|
CString sDxf(m_szDxf);
|
|
return sDxf;
|
|
}
|
|
|
|
void TDbExtentsZoneCell::SetDxf( LPCTSTR szDxf )
|
|
{
|
|
if (szDxf != NULL)
|
|
{
|
|
_tcsncpy(m_szDxf, szDxf, 20);
|
|
}
|
|
}
|
|
|
|
Acad::ErrorStatus TDbExtentsZoneCell::dwgInFields( AcDbDwgFiler* pFiler )
|
|
{
|
|
AcDbSoftPointerId id ;
|
|
pFiler->readItem(&id);
|
|
m_id = id;
|
|
pFiler->readItem(&m_ptMin);
|
|
pFiler->readItem(&m_ptMax);
|
|
TCHAR *pChar = NULL;
|
|
pFiler->readString(&pChar);
|
|
memcpy(m_szDxf, pChar, 20);
|
|
acutDelString(pChar);
|
|
return Acad::eOk;
|
|
}
|
|
|
|
Acad::ErrorStatus TDbExtentsZoneCell::dwgOutFields( AcDbDwgFiler* pFiler ) const
|
|
{
|
|
AcDbSoftPointerId id = m_id;
|
|
pFiler->writeItem(id);
|
|
pFiler->writeItem(m_ptMin);
|
|
pFiler->writeItem(m_ptMax);
|
|
pFiler->writeString(m_szDxf);
|
|
return Acad::eOk;
|
|
}
|
|
#endif |