63 lines
1.6 KiB
C++
63 lines
1.6 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TArchMatchProp.cpp
|
|
// = Version : ver2.0
|
|
// = Author : xlc
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 匹配属性类的定义
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "TArchMatchProp.h"
|
|
#include "TDbEntity.h"
|
|
#include "TDbCurveEntity.h"
|
|
|
|
TArchMatchProp::~TArchMatchProp()
|
|
{
|
|
|
|
}
|
|
|
|
// 提供对格式刷的支持
|
|
void TArchMatchProp::copyProperties(AcDbEntity* pSrcEntity,
|
|
AcDbEntity* pTrgEntity,
|
|
unsigned int gMatchFlag) const
|
|
{
|
|
if (pTrgEntity->isKindOf(TDbEntity::desc()))
|
|
{
|
|
((TDbEntity *)pTrgEntity)->CopyPropertiesFrom(pSrcEntity, gMatchFlag);
|
|
}
|
|
else if (pTrgEntity->isKindOf(TDbCurveEntity::desc()))
|
|
{
|
|
((TDbEntity *)pTrgEntity)->CopyPropertiesFrom(pSrcEntity, gMatchFlag);
|
|
}
|
|
else
|
|
{
|
|
// 颜色
|
|
if (gMatchFlag & kColorFlag)
|
|
{
|
|
pTrgEntity->setColorIndex(pSrcEntity->colorIndex());
|
|
}
|
|
|
|
// 图层
|
|
if (gMatchFlag & kLayerFlag)
|
|
{
|
|
pTrgEntity->setLayer(pSrcEntity->layerId());
|
|
}
|
|
|
|
// 线型
|
|
if (gMatchFlag & kLtypeFlag)
|
|
{
|
|
pTrgEntity->setLinetype(pSrcEntity->linetypeId());
|
|
}
|
|
|
|
// 线型比例
|
|
if (gMatchFlag & kLtscaleFlag)
|
|
{
|
|
pTrgEntity->setLinetypeScale(pSrcEntity->linetypeScale());
|
|
}
|
|
|
|
// 可见性
|
|
pTrgEntity->setVisibility(pSrcEntity->visibility());
|
|
}
|
|
} |