110 lines
1.7 KiB
C++
110 lines
1.7 KiB
C++
#include "StdAfx.h"
|
|
#ifdef TASD
|
|
#include "TAssocMsg.h"
|
|
|
|
|
|
TAssocMsg::TAssocMsg() : m_idAssoc(AcDbObjectId::kNull), \
|
|
m_xform(AcGeMatrix3d::kIdentity), \
|
|
m_eMethodType(TAssocMsg::kMovegrippoint), \
|
|
m_ptTarget(AcGePoint3d::kOrigin)
|
|
{
|
|
|
|
}
|
|
|
|
TAssocMsg::~TAssocMsg()
|
|
{
|
|
|
|
}
|
|
|
|
TAssocMsg& TAssocMsg::operator = (const TAssocMsg& src)
|
|
{
|
|
if (this != &src)
|
|
{
|
|
m_idAssoc = src.m_idAssoc;
|
|
m_xform = src.m_xform;
|
|
m_eMethodType = src.m_eMethodType;
|
|
m_ptTarget = src.m_ptTarget;
|
|
m_vtOffest = src.m_vtOffest;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
bool TAssocMsg::operator==( const TAssocMsg &src )
|
|
{
|
|
if (m_idAssoc == src.m_idAssoc && m_eMethodType == src.m_eMethodType)
|
|
{
|
|
if (m_eMethodType == kEdit || m_eMethodType == kAppend)
|
|
{
|
|
return true;
|
|
}
|
|
else if (m_eMethodType == kTransform)
|
|
{
|
|
if (m_xform.isEqualTo(src.m_xform))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
else if (m_eMethodType == kMovegrippoint)
|
|
{
|
|
if (m_ptTarget == src.m_ptTarget && m_vtOffest == src.m_vtOffest)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void TAssocMsg::SetAssocId(AcDbObjectId id)
|
|
{
|
|
m_idAssoc = id;
|
|
}
|
|
|
|
AcDbObjectId TAssocMsg::GetAssocId() const
|
|
{
|
|
return m_idAssoc;
|
|
}
|
|
|
|
void TAssocMsg::SetMatrix(AcGeMatrix3d xForm)
|
|
{
|
|
m_xform = xForm;
|
|
}
|
|
|
|
AcGeMatrix3d TAssocMsg::GetMatrix() const
|
|
{
|
|
return m_xform;
|
|
}
|
|
|
|
void TAssocMsg::SetMethod(MethodType eMethodType)
|
|
{
|
|
m_eMethodType = eMethodType;
|
|
}
|
|
|
|
TAssocMsg::MethodType TAssocMsg::GetMethod() const
|
|
{
|
|
return m_eMethodType;
|
|
}
|
|
|
|
void TAssocMsg::SetTarget(AcGePoint3d pt)
|
|
{
|
|
m_ptTarget = pt;
|
|
}
|
|
|
|
AcGePoint3d TAssocMsg::GetTarget() const
|
|
{
|
|
return m_ptTarget;
|
|
}
|
|
|
|
void TAssocMsg::SetOffset(AcGeVector3d vtOffset)
|
|
{
|
|
m_vtOffest = vtOffset;
|
|
}
|
|
|
|
AcGeVector3d TAssocMsg::GetOffset()const
|
|
{
|
|
return m_vtOffest;
|
|
}
|
|
#endif
|