Files
envi-code/SourceCode/Code2026/AdsXRx/XArchMatchProp.cpp
T

63 lines
1.5 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
//-----------------------------------------------------------------------------+
2026-09-28 15:28:50 +08:00
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : XArchMatchProp.cpp
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
2026-10-04 00:04:20 +08:00
// = Description: 匹配属性类的定义
2026-09-28 15:28:50 +08:00
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "XArchMatchProp.h"
#include "AecEntity.h"
#include "AecCurveEntity.h"
XArchMatchProp::~XArchMatchProp()
{
}
2026-10-04 00:04:20 +08:00
// 提供对格式刷的支持
2026-09-28 15:28:50 +08:00
void XArchMatchProp::copyProperties(AcDbEntity* pSrcEntity,
AcDbEntity* pTrgEntity,
unsigned int gMatchFlag) const
{
if (pTrgEntity->isKindOf(AecEntity::desc()))
{
((AecEntity *)pTrgEntity)->CopyPropertiesFrom(pSrcEntity, gMatchFlag);
}
else if (pTrgEntity->isKindOf(AecCurveEntity::desc()))
{
((AecEntity *)pTrgEntity)->CopyPropertiesFrom(pSrcEntity, gMatchFlag);
}
else
{
2026-10-04 00:04:20 +08:00
// 颜色
2026-09-28 15:28:50 +08:00
if (gMatchFlag & kColorFlag)
{
pTrgEntity->setColorIndex(pSrcEntity->colorIndex());
}
2026-10-04 00:04:20 +08:00
// 图层
2026-09-28 15:28:50 +08:00
if (gMatchFlag & kLayerFlag)
{
pTrgEntity->setLayer(pSrcEntity->layerId());
}
2026-10-04 00:04:20 +08:00
// 线型
2026-09-28 15:28:50 +08:00
if (gMatchFlag & kLtypeFlag)
{
pTrgEntity->setLinetype(pSrcEntity->linetypeId());
}
2026-10-04 00:04:20 +08:00
// 线型比例
2026-09-28 15:28:50 +08:00
if (gMatchFlag & kLtscaleFlag)
{
pTrgEntity->setLinetypeScale(pSrcEntity->linetypeScale());
}
2026-10-04 00:04:20 +08:00
// 可见性
2026-09-28 15:28:50 +08:00
pTrgEntity->setVisibility(pSrcEntity->visibility());
}
}