161 lines
3.4 KiB
C++
161 lines
3.4 KiB
C++
#include "stdafx.h"
|
|
#include "TDbEImpFittingCreatorService.h"
|
|
#include "TDbXDataMap.h"
|
|
|
|
#include "TEImpCabReducer.h"
|
|
#include "TEImpCabElbow.h"
|
|
#include "TEImpCabTee.h"
|
|
#include "TEImpCabCross.h"
|
|
#include "TEImpCabletry.h"
|
|
#include "TEImpEquipment.h"
|
|
#include "TEImpCabOffset.h"
|
|
#include "TEImpBracket.h"
|
|
#include "TEImpCabEnclosure.h"
|
|
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[]=__FILE__;
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
ACRX_CONS_DEFINE_MEMBERS(TDbEImpFittingCreatorService,TDbFittingCreatorService, 0)
|
|
|
|
TDbEImpFittingCreatorService::TDbEImpFittingCreatorService()
|
|
{
|
|
}
|
|
|
|
TDbEImpFittingCreatorService::~TDbEImpFittingCreatorService()
|
|
{
|
|
}
|
|
|
|
TImpSpecFitting* TDbEImpFittingCreatorService::CreateSpecialFitting(TDbXDataMap* pXDataMap,AcDbEntity* pOwner)
|
|
{
|
|
TImpSpecFitting* pNewFitting = NULL;
|
|
if (pXDataMap != NULL)
|
|
{
|
|
int nKind = -1;
|
|
pXDataMap->GetAt(KEY_RUNTIME,nKind);
|
|
|
|
try
|
|
{
|
|
switch(nKind)
|
|
{
|
|
case TDb::eElbow:
|
|
{
|
|
pNewFitting = new TEImpCabElbow;
|
|
pNewFitting->m_pXDataMap = pXDataMap;
|
|
pNewFitting->m_pOwnerEnt = pOwner;
|
|
break;
|
|
}
|
|
case TDb::eTee:
|
|
{
|
|
pNewFitting = new TEImpCabTee;
|
|
pNewFitting->m_pXDataMap = pXDataMap;
|
|
pNewFitting->m_pOwnerEnt = pOwner;
|
|
break;
|
|
}
|
|
case TDb::eReduce:
|
|
{
|
|
pNewFitting = new TEImpCabReducer;
|
|
pNewFitting->m_pXDataMap = pXDataMap;
|
|
pNewFitting->m_pOwnerEnt = pOwner;
|
|
}
|
|
break;
|
|
case TDb::eCross:
|
|
{
|
|
pNewFitting = new TEImpCabCross;
|
|
pNewFitting->m_pXDataMap = pXDataMap;
|
|
pNewFitting->m_pOwnerEnt = pOwner;
|
|
}
|
|
break;
|
|
case TDb::eOffset:
|
|
{
|
|
pNewFitting = new TEImpCabOffset;
|
|
pNewFitting->m_pXDataMap = pXDataMap;
|
|
pNewFitting->m_pOwnerEnt = pOwner;
|
|
}
|
|
break;
|
|
case TDb::eEnclosure:
|
|
{
|
|
//终端封头(桥架) axc add 2014-04-21
|
|
pNewFitting = new TEImpCabEnclosure;
|
|
pNewFitting->m_pXDataMap = pXDataMap;
|
|
pNewFitting->m_pOwnerEnt = pOwner;
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
catch(...)
|
|
{
|
|
acedAlert(_T("系统内存不足! new 失败!"));
|
|
return NULL;
|
|
}
|
|
}
|
|
return pNewFitting;
|
|
}
|
|
|
|
TDbImpPipeBase* TDbEImpFittingCreatorService::CreateSpecialPipe(TDbXDataMap* pXDataMap,AcDbEntity* pOwner)
|
|
{
|
|
TDbImpPipeBase* pNewPipe = NULL;
|
|
if (pXDataMap != NULL)
|
|
{
|
|
int nKind = -1;
|
|
pXDataMap->GetAt(KEY_RUNTIME,nKind);
|
|
|
|
if (nKind == TDb::eCabletry)
|
|
{
|
|
pNewPipe = new TEImpCabletry;
|
|
pNewPipe->m_pXDataMap = pXDataMap;
|
|
pNewPipe->m_pOwnerEnt = pOwner;
|
|
}
|
|
}
|
|
return pNewPipe;
|
|
}
|
|
|
|
TImpSpecEquipment* TDbEImpFittingCreatorService::CreateSpecialEquipment(TDbXDataMap* pXDataMap,AcDbEntity* pOwner)
|
|
{
|
|
TImpSpecEquipment* pNewEquipment = NULL;
|
|
if (pXDataMap != NULL)
|
|
{
|
|
int nKind = -1;
|
|
pXDataMap->GetAt(KEY_RUNTIME,nKind);
|
|
|
|
try
|
|
{
|
|
switch(nKind)
|
|
{
|
|
case TDb::eEquipment:
|
|
{
|
|
pNewEquipment = new TEImpEquipment;
|
|
pNewEquipment->m_pXDataMap = pXDataMap;
|
|
pNewEquipment->m_pOwnerEnt = pOwner;
|
|
break;
|
|
}
|
|
case TDb::eSupport:
|
|
case TDb::eBracket:
|
|
{
|
|
pNewEquipment = new TEImpBracket;
|
|
pNewEquipment->m_pXDataMap = pXDataMap;
|
|
pNewEquipment->m_pOwnerEnt = pOwner;
|
|
break;
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
catch(...)
|
|
{
|
|
acedAlert(_T("系统内存不足! new 失败!"));
|
|
return NULL;
|
|
}
|
|
}
|
|
return pNewEquipment;
|
|
}
|
|
|
|
TImpSpecPart* TDbEImpFittingCreatorService::CreateSpecialPart(TDbXDataMap* pXDataMap,AcDbEntity* pOwner)
|
|
{
|
|
return NULL;
|
|
} |