637 lines
15 KiB
C++
637 lines
15 KiB
C++
#include "stdafx.h"
|
|
#include "dbproxy.h"
|
|
#include "geassign.h"
|
|
#include "acgi.h"
|
|
#include "TDbHvacDuct.h"
|
|
#include "THImpHvacDuct.h"
|
|
#include "TDbInterfaceMsgWrite.h"
|
|
|
|
#define VERSION_HVACDUCT 1
|
|
|
|
//{{AFX_ARX_MACRO
|
|
ACRX_DXF_DEFINE_MEMBERS( TDbHvacDuct, TDbPipeBase,
|
|
AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent,
|
|
AcDbProxyEntity::kAllAllowedBits,
|
|
ATS_DBHVACDUCT, "图形无法解析, 请下载上华软件|网址: www.shanghuasoft.com");
|
|
//}}AFX_ARX_MACRO
|
|
|
|
TDbHvacDuct::TDbHvacDuct()
|
|
{
|
|
//{{AFX_ARX_DATA_INIT(TDbHvacDuct)
|
|
//}}AFX_ARX_DATA_INIT
|
|
|
|
m_pImpPipeBase = new THImpHvacDuct(this);
|
|
m_XDataMap.SetAt(KEY_DXF, _T("ATS_DBHVACDUCT"));
|
|
}
|
|
|
|
TDbHvacDuct::~TDbHvacDuct()
|
|
{
|
|
if (m_pImpPipeBase != NULL)
|
|
{
|
|
delete m_pImpPipeBase;
|
|
m_pImpPipeBase = NULL;
|
|
}
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::dxfOutFields(AcDbDxfFiler* pFiler) const
|
|
{
|
|
assertReadEnabled();
|
|
Acad::ErrorStatus es;
|
|
|
|
if ((es = TDbPipeBase::dxfOutFields(pFiler)) != Acad::eOk)
|
|
return es;
|
|
|
|
// Write subclass marker.
|
|
pFiler->writeItem(AcDb::kDxfSubclass, _T("TDbHvacDuct"));
|
|
|
|
// Write version number.
|
|
pFiler->writeItem(AcDb::kDxfInt16, (Adesk::UInt16) VERSION_HVACDUCT);
|
|
// add begin
|
|
if( g_nProductId == 15 )
|
|
{
|
|
TDb::HvacSectType eSectType;
|
|
GetSpecialtyDataReadOnly()->GetAt(HVAC_SectType, (int&)eSectType);
|
|
pFiler->writeItem(AcDb::kDxfXXInt16, eSectType); // 截面类型
|
|
}
|
|
// add end by cq 2015-06-03 增加dxf数据强化"过滤选择"功能
|
|
|
|
return es;
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::dxfInFields(AcDbDxfFiler* pFiler)
|
|
{
|
|
assertWriteEnabled();
|
|
struct resbuf rb;
|
|
|
|
if ((TDbPipeBase::dxfInFields(pFiler) != Acad::eOk) ||
|
|
!pFiler->atSubclassData(_T("TDbHvacDuct")))
|
|
return pFiler->filerStatus();
|
|
|
|
// Read version number.
|
|
pFiler->readItem(&rb);
|
|
if (rb.restype != AcDb::kDxfInt16)
|
|
{
|
|
pFiler->pushBackItem();
|
|
pFiler->setError(Acad::eInvalidDxfCode,
|
|
_T("Error: expected object version group code %d"),
|
|
AcDb::kDxfInt16);
|
|
return pFiler->filerStatus();
|
|
}
|
|
else
|
|
{
|
|
Adesk::UInt16 version = rb.resval.rint;
|
|
if (version > VERSION_HVACDUCT)
|
|
return Acad::eMakeMeProxy;
|
|
}
|
|
return pFiler->filerStatus();
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::dwgOutFields(AcDbDwgFiler* pFiler) const
|
|
{
|
|
assertReadEnabled();
|
|
Acad::ErrorStatus es;
|
|
|
|
// Call dwgOutFields from TDbInterfacesObj
|
|
if ((es = TDbPipeBase::dwgOutFields(pFiler)) != Acad::eOk)
|
|
{
|
|
return es;
|
|
}
|
|
|
|
// Write version number.
|
|
pFiler->writeItem((Adesk::UInt16) VERSION_HVACDUCT);
|
|
|
|
return pFiler->filerStatus();
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::dwgInFields(AcDbDwgFiler* pFiler)
|
|
{
|
|
assertWriteEnabled();
|
|
Acad::ErrorStatus es;
|
|
|
|
// Call dwgInFields from TDbInterfacesObj
|
|
if ((es = TDbPipeBase::dwgInFields(pFiler)) != Acad::eOk)
|
|
{
|
|
return es;
|
|
}
|
|
|
|
// Read version number.
|
|
Adesk::UInt16 version;
|
|
pFiler->readItem(&version);
|
|
if (version > VERSION_HVACDUCT)
|
|
return Acad::eMakeMeProxy;
|
|
|
|
switch (version)
|
|
{
|
|
case (1):
|
|
{
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
return pFiler->filerStatus();
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::subGetTransformedCopy( const AcGeMatrix3d& xform,
|
|
AcDbEntity*& pEnt) const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
pEnt = new TDbHvacDuct;
|
|
(TDbHvacDuct*)pEnt->copyFrom(this);
|
|
pEnt->transformBy(xform);
|
|
|
|
return Acad::eOk;
|
|
}
|
|
|
|
void TDbHvacDuct::erased( const AcDbObject* dbObj, Adesk::Boolean pErasing /*= true*/ )
|
|
{
|
|
if (Adesk::kFalse == pErasing)
|
|
return;
|
|
#if ADS > 20
|
|
bool bWrite = false;
|
|
#else
|
|
BOOL bWrite = FALSE;
|
|
#endif
|
|
if (!isWriteEnabled())
|
|
{
|
|
Acad::ErrorStatus eState = upgradeFromNotify(bWrite);
|
|
if (eState != Acad::eOk)
|
|
return;
|
|
|
|
assertWriteEnabled();
|
|
removePersistentReactor(dbObj->id());
|
|
downgradeToNotify(bWrite);
|
|
}
|
|
else
|
|
{
|
|
assertWriteEnabled();
|
|
removePersistentReactor(dbObj->id());
|
|
}
|
|
}
|
|
Acad::ErrorStatus TDbHvacDuct::getSplitCurves(const AcGeDoubleArray& params,
|
|
AcDbVoidPtrArray& curveSegments) const
|
|
{
|
|
Acad::ErrorStatus eSta = Acad::eNotImplementedYet;
|
|
assertReadEnabled();
|
|
TDbXDataMap* pMap = GetSpecialtyDataReadOnly();
|
|
if (NULL == pMap)
|
|
return Acad::eNotImplementedYet;
|
|
|
|
HvacDuctType eType = eStraight;
|
|
pMap->GetAt(HDCT_Type, (int&)eType);
|
|
if (eType == eStraight)
|
|
eSta = TDbPipeBase::getSplitCurves(params, curveSegments);
|
|
else
|
|
{
|
|
Acad::ErrorStatus eSta = Acad::eOk;
|
|
if (m_pImpPipeBase != NULL)
|
|
{
|
|
AcDbVoidPtrArray curvePtrs;
|
|
eSta = m_pImpPipeBase->getSplitCurves(params,curvePtrs);
|
|
|
|
TDbPipeBase* pPipeBase = NULL;
|
|
AcDbArc* pArc = NULL;
|
|
AcGePoint3d ptSta, ptEnd, ptCent;
|
|
double dBulge(0.0), dRad(0.0), dDist(0.0);
|
|
double dStaAngle(0.0), dEndAngle(0.0);
|
|
AcGeVector3d vtNormal;
|
|
|
|
for (int i = 0;i < curvePtrs.length();i++)
|
|
{
|
|
pArc = AcDbArc::cast((AcRxObject*)curvePtrs.at(i));
|
|
if (pArc != NULL)
|
|
{
|
|
pPipeBase = (TDbPipeBase*)isA()->create();
|
|
if (pPipeBase != NULL)
|
|
{
|
|
pPipeBase->GetSpecialtyData()->CopyFrom(GetSpecialtyDataReadOnly());
|
|
pPipeBase->ReCreateByXDataMap();
|
|
|
|
dRad = pArc->radius();
|
|
dDist = dRad;
|
|
ptCent = pArc->center();
|
|
dStaAngle = pArc->startAngle();
|
|
dEndAngle = pArc->endAngle();
|
|
|
|
vtNormal = pArc->normal();
|
|
pArc->getStartPoint(ptSta);
|
|
pArc->getEndPoint(ptEnd);
|
|
pPipeBase->SetStartPoint(ptSta);
|
|
pPipeBase->SetEndPoint(ptEnd);
|
|
|
|
if (dEndAngle < dStaAngle)
|
|
dEndAngle += PI*2;
|
|
|
|
dBulge = tan(fabs(dEndAngle - dStaAngle) * 0.25);
|
|
TDbXDataMap* pMap = pPipeBase->GetSpecialtyData();
|
|
if (NULL != pMap)
|
|
{
|
|
pMap->SetAt(HDCT_Bulge, dBulge);
|
|
pMap->SetAt(HDCT_Type, eSoft);
|
|
}
|
|
|
|
pPipeBase->GetSpecialtyData()->SetAt(KEY_THISID,NULL);
|
|
pPipeBase->setLayer(layerId());
|
|
pPipeBase->SetDashLayer(DashLayer());
|
|
pPipeBase->SetCenterLayer(CenterLayer());
|
|
curveSegments.append(pPipeBase);
|
|
}
|
|
delete pArc;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
UpdateRalatCover();
|
|
|
|
return eSta;
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::getSplitCurves(const AcGePoint3dArray& points,
|
|
AcDbVoidPtrArray& curveSegments) const
|
|
{
|
|
Acad::ErrorStatus eSta = Acad::eNotImplementedYet;
|
|
assertReadEnabled();
|
|
TDbXDataMap* pMap = GetSpecialtyDataReadOnly();
|
|
if (NULL == pMap)
|
|
return Acad::eNotImplementedYet;
|
|
|
|
HvacDuctType eType = eStraight;
|
|
pMap->GetAt(HDCT_Type, (int&)eType);
|
|
if (eType == eStraight)
|
|
eSta = TDbPipeBase::getSplitCurves(points, curveSegments);
|
|
else
|
|
{
|
|
if (m_pImpPipeBase != NULL)
|
|
{
|
|
AcDbVoidPtrArray curvePtrs;
|
|
eSta = m_pImpPipeBase->getSplitCurves(points,curvePtrs);
|
|
|
|
TDbPipeBase* pPipeBase = NULL;
|
|
AcDbArc* pArc = NULL;
|
|
AcGePoint3d ptSta, ptEnd, ptCent;
|
|
double dBulge(0.0), dRad(0.0);
|
|
double dStaAngle(0.0), dEndAngle(0.0);
|
|
for (int i = 0;i < curvePtrs.length();i++)
|
|
{
|
|
pArc = (AcDbArc*)curvePtrs.at(i);
|
|
if (pArc != NULL)
|
|
{
|
|
pPipeBase = (TDbPipeBase*)isA()->create();
|
|
if (pPipeBase != NULL)
|
|
{
|
|
pPipeBase->GetSpecialtyData()->CopyFrom(GetSpecialtyDataReadOnly());
|
|
pPipeBase->ReCreateByXDataMap();
|
|
|
|
dRad = pArc->radius();
|
|
ptCent = pArc->center();
|
|
dStaAngle = pArc->startAngle();
|
|
dEndAngle = pArc->endAngle();
|
|
|
|
pArc->getStartPoint(ptSta);
|
|
pArc->getEndPoint(ptEnd);
|
|
pPipeBase->SetStartPoint(ptSta);
|
|
pPipeBase->SetEndPoint(ptEnd);
|
|
|
|
if (dEndAngle < dStaAngle)
|
|
dEndAngle += PI*2;
|
|
dBulge = tan((dEndAngle - dStaAngle) * 0.25);
|
|
TDbXDataMap* pMap = pPipeBase->GetSpecialtyData();
|
|
if (NULL != pMap)
|
|
{
|
|
pMap->SetAt(HDCT_Bulge, dBulge);
|
|
pMap->SetAt(HDCT_Type, eSoft);
|
|
}
|
|
|
|
pPipeBase->GetSpecialtyData()->SetAt(KEY_THISID,NULL);
|
|
pPipeBase->setLayer(layerId());
|
|
pPipeBase->SetDashLayer(DashLayer());
|
|
pPipeBase->SetCenterLayer(CenterLayer());
|
|
curveSegments.append(pPipeBase);
|
|
}
|
|
delete pArc;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
UpdateRalatCover();
|
|
|
|
return eSta;
|
|
}
|
|
|
|
// 更新跟自身有关系的实体遮挡显示
|
|
void TDbHvacDuct::UpdateRalatCover() const
|
|
{
|
|
AcDbPolyline* pPolyLine = MakePolyCurve();
|
|
if (NULL == pPolyLine)
|
|
return;
|
|
|
|
PickSet ssEnt;
|
|
struct resbuf *pointlist;
|
|
RBList rbMask = ads_buildlist( -4, _T("<or"),
|
|
-4, _T("<and"), RTDXF0, _T("ATS_DBHVACDUCT"), -4, _T("and>"),
|
|
-4, _T("<and"), RTDXF0, _T("ATS_DBHFITTING"), -4, _T("and>"),
|
|
-4, _T("<and"), RTDXF0, _T("ATS_DBHEQUIPMENT"), -4, _T("and>"),
|
|
-4, _T("or>"), NULL);
|
|
|
|
AcGePoint3d ptTmp;
|
|
pPolyLine->getPointAt(0, ptTmp);
|
|
ads_point ptAds;
|
|
ptAds[0] = ptTmp.x;
|
|
ptAds[1] = ptTmp.y;
|
|
ptAds[2] = ptTmp.z;
|
|
pointlist = acutBuildList(RTPOINT, ptAds, NULL);
|
|
|
|
struct resbuf *resTmp2;
|
|
resTmp2 = pointlist;
|
|
for (UINT i = 1; i < pPolyLine->numVerts(); i++)
|
|
{
|
|
struct resbuf *resTmp1;
|
|
pPolyLine->getPointAt(i, ptTmp);
|
|
ptAds[0] = ptTmp.x;
|
|
ptAds[1] = ptTmp.y;
|
|
ptAds[2] = ptTmp.z;
|
|
resTmp1 = acutBuildList(RTPOINT, ptAds, NULL);
|
|
resTmp2->rbnext = resTmp1;
|
|
resTmp2 = resTmp1;
|
|
}
|
|
|
|
acedSSGet(_T("CP"), pointlist, NULL, rbMask, ssEnt);
|
|
acutRelRb(pointlist);
|
|
|
|
long l(0);
|
|
for (l = 0; l < ssEnt.Length(); l++)
|
|
{
|
|
OPENOBJ_BEGIN(ssEnt[l], AcDb::kForRead, TDbInterfacesObj, pIfObj);
|
|
if (NULL != pIfObj)
|
|
{
|
|
pIfObj->UpdateCoverDisplay();
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::ExplodeOrDraw3d( XExplodeDraw &mode ) const
|
|
{
|
|
TDbXDataMap* pMap = GetSpecialtyDataReadOnly();
|
|
|
|
ASSERT(NULL != pMap);
|
|
HvacModelType eType = eModel;
|
|
pMap->GetAt(HVAC_ModeType, (int&)eType);
|
|
if (eSystem == eType)
|
|
return Acad::eNotImplementedYet;
|
|
|
|
return TDbPipeBase::ExplodeOrDraw3d(mode);
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::ExplodeOrDraw2d( XExplodeDraw &mode ) const
|
|
{
|
|
// 两端绘制一个点,放在一个显示的图层,用于完全遮挡管时,可以选择上实体
|
|
// 炸开时或导出低版本(比最初实体版本低)时不绘制
|
|
BOOL bExplore(FALSE);
|
|
GetGlobalContext()->GetAt(HVAC_IsExplodeDraw, bExplore);
|
|
|
|
if (!bExplore && g_nSaveTArchVer >= GetFirstVersion())
|
|
{
|
|
AcDbObjectId idLayer = layerId();
|
|
|
|
AcColorSettings corSet;
|
|
acedGetCurrentColors(&corSet);
|
|
int nBlue = GetBValue(corSet.dwGfxModelBkColor);
|
|
int nRed = GetRValue(corSet.dwGfxModelBkColor);
|
|
int nGreen = GetGValue(corSet.dwGfxModelBkColor);
|
|
AcCmColor acCor;
|
|
acCor.setRGB(nRed, nGreen, nBlue);
|
|
|
|
AcDbPoint ptDb;
|
|
ptDb.setLayer(idLayer);
|
|
if (acCor.colorIndex() == 7) // 白色背景时,原来白色会变为黑色
|
|
ptDb.setColorIndex(255);
|
|
else
|
|
ptDb.setColor(acCor);
|
|
|
|
AcGeVector3d vtNormal = normal();
|
|
if (vtNormal.isPerpendicularTo(TAuxTools::GetUcsZvt())) // 立管
|
|
{
|
|
AcDbPolyline* pPolyLine = MakePolyCurve();
|
|
if (NULL != pPolyLine)
|
|
{
|
|
unsigned int i(0);
|
|
for (i = 0; i < pPolyLine->numVerts(); i++)
|
|
{
|
|
AcGePoint3d pt;
|
|
if (pPolyLine->getPointAt(i, pt) == Acad::eOk)
|
|
{
|
|
ptDb.setPosition(pt);
|
|
mode.DrawEntity(ptDb);
|
|
}
|
|
}
|
|
|
|
delete pPolyLine;
|
|
pPolyLine = NULL;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// change by hh 2011-06-24 倾斜软风管有问题这两个函数有问题
|
|
// 牵扯较广 暂使用别的方法代替
|
|
//AcGePoint3d ptSta, ptEnd;
|
|
//getStartPoint(ptSta);
|
|
//getEndPoint(ptEnd);
|
|
AcGePoint3d ptSta = m_pImpPipeBase->StartPoint();
|
|
AcGePoint3d ptEnd = m_pImpPipeBase->EndPoint();
|
|
|
|
ptDb.setPosition(ptSta);
|
|
mode.DrawEntity(ptDb);
|
|
|
|
ptDb.setPosition(ptEnd);
|
|
mode.DrawEntity(ptDb);
|
|
}
|
|
}
|
|
|
|
return TDbPipeBase::ExplodeOrDraw2d(mode);
|
|
}
|
|
|
|
// 炸开
|
|
Acad::ErrorStatus TDbHvacDuct::subExplode( AcDbVoidPtrArray& entitySet ) const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
GetGlobalContext()->SetAt(HVAC_IsExplodeDraw, TRUE);
|
|
Acad::ErrorStatus eStatu = TDbPipeBase::subExplode(entitySet);
|
|
GetGlobalContext()->SetAt(HVAC_IsExplodeDraw, FALSE);
|
|
|
|
return eStatu;
|
|
}
|
|
|
|
BOOL TDbHvacDuct::IsVertical() const
|
|
{
|
|
AcGeVector3d vtUcsZ = TAuxTools::GetUcsZvt();
|
|
AcGeVector3d vtDirect = EndPoint() - StartPoint();
|
|
if (vtDirect.isParallelTo(vtUcsZ))
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
void TDbHvacDuct::WriteSizeChangeMsg(double dNewWidth, double dNewHeigh,
|
|
AcGeVector3d vtOff /*= AcGeVector3d(0,0,0)*/ )
|
|
{
|
|
// 创建接口更改消息
|
|
TInterfaceModifyMsg iMsg;
|
|
iMsg.SetSize(dNewWidth, dNewHeigh);
|
|
iMsg.SetMsgValidate(TRUE);
|
|
iMsg.SetMoveGripOffset(vtOff);
|
|
iMsg.SetInterfaceOper(eSize);
|
|
iMsg.SetMsgOperateOn(objectId());
|
|
|
|
// 尺寸更改,宽高方向
|
|
AcGeVector3d vtNormal = normal();
|
|
AcGeVector3d vtDirect = EndPoint() - StartPoint();
|
|
AcGeVector3d vtWidthChange = vtDirect.crossProduct(vtNormal);
|
|
vtWidthChange.normalize();
|
|
iMsg.SetSizeDir(vtWidthChange, vtNormal);
|
|
|
|
// 写入接口更改消息
|
|
TDbInterfaceMsgWrite msgWrite;
|
|
msgWrite.WriteInterfaceMsg(iMsg);
|
|
}
|
|
|
|
void TDbHvacDuct::WriteMoveTransMsg(AcGeVector3d vtMove)
|
|
{
|
|
if (vtMove.length() > 1e-6)
|
|
{
|
|
TInterfaceModifyMsg iMsg;
|
|
iMsg.SetMsgPoint(TAuxTools::Mid(StartPoint(), EndPoint()));
|
|
iMsg.SetGripPosition(eMid);
|
|
iMsg.SetMsgValidate(TRUE);
|
|
iMsg.SetTransform(vtMove);
|
|
iMsg.SetMoveGripOffset(vtMove);
|
|
iMsg.SetInterfaceOper(TDb::eMoveGripPoint);
|
|
iMsg.SetMsgOperateOn(objectId());
|
|
|
|
// 写入接口更改消息
|
|
TDbInterfaceMsgWrite msgWrite;
|
|
msgWrite.WriteInterfaceMsg(iMsg);
|
|
}
|
|
}
|
|
|
|
//BEGIN==================================================================
|
|
void TDbHvacDuct::UpdateDimData()
|
|
{
|
|
// 更新反应器中其他标注
|
|
const AcDbVoidPtrArray* pArrVoidPt = NULL; // 反应器数组
|
|
void* pReactSome = NULL; // 反应器指针
|
|
AcDbObjectId objId; // 反应器对应实体id
|
|
TDbXDataMap* pXDataMap;
|
|
|
|
pArrVoidPt = this->reactors();
|
|
if (NULL == pArrVoidPt || pArrVoidPt->length() < 1)
|
|
return;
|
|
|
|
int i(0);
|
|
for (i = 0; i < pArrVoidPt->length(); i++)
|
|
{
|
|
pReactSome = pArrVoidPt->at(i);
|
|
if (acdbIsPersistentReactor(pReactSome))
|
|
{
|
|
objId = acdbPersistentReactorObjectId(pReactSome);
|
|
OPENOBJ_BEGIN(objId, AcDb::kForWrite, TDbHvacDimension, pDim);
|
|
if (NULL != pDim)
|
|
{
|
|
pXDataMap = this->GetSpecialtyDataReadOnly();
|
|
pDim->UpdateDataMap(pXDataMap);
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
}
|
|
}
|
|
//END====================================================================
|
|
void TDbHvacDuct::MoveNextToAirLet( AcGeVector3d vtMove )
|
|
{
|
|
// 处理风管壁连接的风口联动情况 暂
|
|
AcDbObjectIdArray idArrAir;
|
|
TAuxTools::GetAirLetByDuct(this, idArrAir);
|
|
|
|
int i(0);
|
|
for (i = 0; i < idArrAir.length(); i++)
|
|
{
|
|
OPENOBJ_BEGIN(idArrAir[i], AcDb::kForWrite, TDbHvacEquipment, pAir);
|
|
if (NULL != pAir)
|
|
{
|
|
pAir->subTransformBy(vtMove);
|
|
}
|
|
OPENOBJ_END();
|
|
}
|
|
}
|
|
|
|
Acad::ErrorStatus TDbHvacDuct::GetClipBoundary(TGGePoly2D& poly)const
|
|
{
|
|
if(NULL == m_pImpPipeBase)
|
|
return Acad::eNotImplementedYet;
|
|
|
|
return m_pImpPipeBase->GetClipBoundary(poly);
|
|
}
|
|
|
|
bool TDbHvacDuct::IsMeClip()const
|
|
{
|
|
if(NULL == m_pImpPipeBase)
|
|
return false;
|
|
|
|
return m_pImpPipeBase->IsMeClip();
|
|
}
|
|
|
|
bool TDbHvacDuct::IsClipMe(const TEntityBase* pEn)const//ok是否被裁剪
|
|
{
|
|
if(NULL == m_pImpPipeBase)
|
|
return false;
|
|
|
|
return m_pImpPipeBase->IsClipMe(pEn);
|
|
}
|
|
|
|
// 以下4个函数,调用内部实现类的接口Lixl add 2012-3-10
|
|
BOOL TDbHvacDuct::IsArcDuct() const
|
|
{
|
|
THImpHvacDuct* pImpDuct = static_cast<THImpHvacDuct*>(m_pImpPipeBase);
|
|
if (NULL != pImpDuct)
|
|
{
|
|
return pImpDuct->IsArcDuct();
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
AcGePoint3d TDbHvacDuct::GetDirect( AcGeVector3d& vtStart, AcGeVector3d& vtEnd )
|
|
{
|
|
AcGePoint3d ptMid = AcGePoint3d::kOrigin;
|
|
|
|
THImpHvacDuct* pImpDuct = static_cast<THImpHvacDuct*>(m_pImpPipeBase);
|
|
if (NULL != pImpDuct)
|
|
ptMid = pImpDuct->GetDirect(vtStart, vtEnd);
|
|
|
|
return ptMid;
|
|
}
|
|
|
|
AcGePoint3d TDbHvacDuct::GetCirCenter() const
|
|
{
|
|
AcGePoint3d ptCenter = AcGePoint3d::kOrigin;
|
|
|
|
THImpHvacDuct* pImpDuct = static_cast<THImpHvacDuct*>(m_pImpPipeBase);
|
|
if (NULL != pImpDuct)
|
|
ptCenter = pImpDuct->GetCirCenter();
|
|
return ptCenter;
|
|
}
|
|
|
|
BOOL TDbHvacDuct::InitArc( AcDbArc &arc ) const
|
|
{
|
|
THImpHvacDuct* pImpDuct = static_cast<THImpHvacDuct*>(m_pImpPipeBase);
|
|
if (NULL != pImpDuct)
|
|
{
|
|
if (pImpDuct->InitArc(arc))
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|