52 lines
988 B
C++
52 lines
988 B
C++
#include "StdAfx.h"
|
|
#include "XBlockTableRecordZone.h"
|
|
|
|
XBlockTableRecordZone::XBlockTableRecordZone()
|
|
{
|
|
m_nActiveRefCount = 0;
|
|
}
|
|
|
|
XBlockTableRecordZone::~XBlockTableRecordZone()
|
|
{
|
|
|
|
}
|
|
|
|
void XBlockTableRecordZone::setActive(bool bActive)
|
|
{
|
|
bActive ? m_nActiveRefCount++ : m_nActiveRefCount--;
|
|
}
|
|
|
|
bool XBlockTableRecordZone::isActive()
|
|
{
|
|
return m_nActiveRefCount > 0 ? true : false;
|
|
}
|
|
|
|
bool XBlockTableRecordZone::getGeomExtents(const AcDbObjectId& id,AcDbExtents& ext)
|
|
{
|
|
typedef std::map<AcDbObjectId,AcDbExtents>::iterator IT;
|
|
IT it = m_mapIdToExt.find(id);
|
|
|
|
if ( it != m_mapIdToExt.end())
|
|
{
|
|
ext = (*it).second;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool XBlockTableRecordZone::setGeomExtents(const AcDbObjectId& id,AcDbExtents& ext)
|
|
{
|
|
m_mapIdToExt.erase(id);
|
|
|
|
std::pair<AcDbObjectId,AcDbExtents> pairT;
|
|
pairT.first = id;
|
|
pairT.second = ext;
|
|
m_mapIdToExt.insert(pairT);
|
|
return true;
|
|
}
|
|
|
|
void XBlockTableRecordZone::remove(const AcDbObjectId& id)
|
|
{
|
|
m_mapIdToExt.erase(id);
|
|
}
|