178 lines
3.5 KiB
C++
178 lines
3.5 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TDbEntity.cpp
|
|
// = Version : ver2.0
|
|
// = Author : xlc
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 上华非曲线对象基类的定义
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "TDbEntity.h"
|
|
#include "TConfigBase.h"
|
|
#include "TchGlobalFunc.h"
|
|
#include "TchPrivateGlobalFunc.h"
|
|
|
|
ACRX_NO_CONS_DEFINE_MEMBERS(ATSEntity, AcDbEntity);
|
|
TCH_IMPLEMENT_MEMBERS(TDbEntity, AcDbEntity);
|
|
|
|
TDbEntity::TDbEntity()
|
|
{
|
|
|
|
}
|
|
|
|
Adesk::UInt32 TDbEntity::subSetAttributes(AcGiDrawableTraits * traits)
|
|
{
|
|
Adesk::UInt32 nRet = AcDbEntity::subSetAttributes(traits);
|
|
nRet = TEntityBase::SetAttributes(traits, nRet);
|
|
|
|
return nRet;
|
|
}
|
|
|
|
Adesk::UInt32 TDbEntity::subViewportDrawLogicalFlags(AcGiViewportDraw * vd)
|
|
{
|
|
Adesk::UInt32 nRet = AcDbEntity::subViewportDrawLogicalFlags(vd);
|
|
nRet = TEntityBase::ViewportDrawLogicalFlags(vd, nRet);
|
|
|
|
return nRet;
|
|
}
|
|
|
|
void TDbEntity::UnionScale(double nScale)
|
|
{
|
|
assertWriteEnabled();
|
|
AcGeMatrix3d mat;
|
|
mat.setToScaling(nScale);
|
|
subTransformBy(mat);
|
|
}
|
|
|
|
#if ADS > 15
|
|
|
|
void TDbEntity::subGripStatus(const AcDb::GripStat status)
|
|
{
|
|
assertReadEnabled();
|
|
TEntityBase::GripStatus(status);
|
|
}
|
|
|
|
Acad::ErrorStatus TDbEntity::subGetGripPoints(AcDbGripDataPtrArray& grips,
|
|
const double curViewUnitSize,
|
|
const int gripSize,
|
|
const AcGeVector3d& curViewDir,
|
|
const int bitflags) const
|
|
{
|
|
assertReadEnabled();
|
|
return TEntityBase::GetGripPoints(grips,curViewUnitSize,gripSize,curViewDir,bitflags);
|
|
}
|
|
|
|
Acad::ErrorStatus TDbEntity::subMoveGripPointsAt(const AcDbVoidPtrArray& appData,
|
|
const AcGeVector3d& offset,
|
|
const int bitflags)
|
|
{
|
|
assertWriteEnabled();
|
|
return TEntityBase::MoveGripPointsAt(appData,offset,bitflags);
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
BOOL TDbEntity::TBaseConvertFrom(const AcDbText *pText)
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
AcDbEntity* TDbEntity::TBaseCreateWipeOut()
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
const TCHAR * TDbEntity::TBaseGetText() const
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
void TDbEntity::TBaseSetText(const TCHAR *pszText)
|
|
{
|
|
|
|
}
|
|
|
|
TADSGePoint3d TDbEntity::TBaseGetLocation() const
|
|
{
|
|
return TADSGePoint3d();
|
|
}
|
|
|
|
void TDbEntity::TBaseSetLocation(TADSGePoint3d pt)
|
|
{
|
|
|
|
}
|
|
|
|
void TDbEntity::TBaseSetRotation(double nRot)
|
|
{
|
|
|
|
}
|
|
|
|
double TDbEntity::TBaseGetRotation() const
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
TGGiClipBoundary::ClipType TDbEntity::GetClipType()const
|
|
{
|
|
return TGGiClipBoundary::kClipIn;
|
|
}
|
|
|
|
AcDbObjectId TDbEntity::InitLayer(LPCTSTR pszLayer, BOOL bApplyChange )
|
|
{
|
|
AcDbObjectId idLay;
|
|
TConfigBase* pBase = GetGlobalConfigBase();
|
|
if (pBase != NULL)
|
|
{
|
|
idLay = pBase->InitLayer(pszLayer,bApplyChange);
|
|
}
|
|
|
|
return idLay;
|
|
}
|
|
//t20
|
|
TDbXDataMap* TDbEntity::GetSpecialtyData()
|
|
{
|
|
if (isWriteEnabled())
|
|
{
|
|
assertWriteEnabled();
|
|
}
|
|
else
|
|
{
|
|
assertReadEnabled();
|
|
}
|
|
return &m_XDataMap;
|
|
}
|
|
|
|
TDbXDataMap* TDbEntity::GetSpecialtyDataReadOnly() const
|
|
{
|
|
assertReadEnabled();
|
|
return (TDbXDataMap*)&m_XDataMap;
|
|
}
|
|
|
|
BOOL TDbEntity::SetAt(LPCTSTR pszKey,TXData& XData)
|
|
{
|
|
assertWriteEnabled();
|
|
TDbXDataMap* pXMap = GetSpecialtyData();
|
|
if (pXMap != NULL)
|
|
{
|
|
pXMap->SetAt(pszKey,XData);
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
BOOL TDbEntity::GetAt(LPCTSTR pszKey,TXData& XData) const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
TDbXDataMap* pXMap = GetSpecialtyDataReadOnly();
|
|
if (pXMap != NULL)
|
|
{
|
|
return pXMap->GetAt(pszKey,XData);
|
|
}
|
|
return FALSE;
|
|
}
|
|
|