- UID
- 236231
- 积分
- 86
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-4-1
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
定义成员:
AcGePoint3d mFirst, mSecond, mThree, mFour;
AcGePoint3d mCenter;
Acad::ErrorStatus cascoCEntity::dwgInFields(AcDbDwgFiler* pFiler)
{
assertWriteEnabled();
Acad::ErrorStatus es;
// Call dwgInFields from AcDbEntity
if ((es = AcDbEntity::dwgInFields(pFiler)) != Acad::eOk) {
return es;
}
// Read version number.
Adesk::UInt16 version;
pFiler->readItem(&version);
if (version > VERSION_CASCOCENTITY)
return Acad::eMakeMeProxy;
// Read the data members.
switch (version)
{
case (1):
// TODO: here you can file datamembers not
// created by the ObjectARX Add-In.
pFiler->readItem(&version);
pFiler->readItem(&mCenter);
pFiler->readItem(&mFirst);
pFiler->readItem(&mSecond);
pFiler->readItem(&mThree);
pFiler->readItem(&mFour);
break;
}
return pFiler->filerStatus();
}
Acad::ErrorStatus cascoCEntity::dwgOutFields(AcDbDwgFiler* pFiler) const
{
assertReadEnabled();
Acad::ErrorStatus es;
// Call dwgOutFields from AcDbEntity
if ((es = AcDbEntity::dwgOutFields(pFiler)) != Acad::eOk) {
return es;
}
// Write version number.
pFiler->writeItem((Adesk::UInt16) VERSION_CASCOCENTITY);
// Write the data members.
// TODO: here you can file datamembers not
// created by the ObjectARX Add-In.
pFiler->writeItem(mCenter);
pFiler->writeItem(mFirst);
pFiler->writeItem(mSecond);
pFiler->writeItem(mThree);
pFiler->writeItem(mFour);
return pFiler->filerStatus();
}
Acad::ErrorStatus cascoCEntity::dxfInFields(AcDbDxfFiler* pFiler)
{
assertWriteEnabled();
struct resbuf rb;
if ((AcDbEntity::dxfInFields(pFiler) != Acad::eOk) ||
!pFiler->atSubclassData("cascoCEntity"))
return pFiler->filerStatus();
// Read version number.
pFiler->readItem(&rb);
if (rb.restype != AcDb::kDxfInt16) {
pFiler->pushBackItem();
pFiler->setError(Acad::eInvalidDxfCode,
"nError: expected object version group code %d",
AcDb::kDxfInt16);
return pFiler->filerStatus();
} else {
Adesk::UInt16 version = rb.resval.rint;
if (version > VERSION_CASCOCENTITY)
return Acad::eMakeMeProxy;
}
// TODO: here you can file datamembers not
// created by the ObjectARX Add-In.
pFiler->readItem(&rb);
if (rb.restype != AcDb::kDxfXCoord)
mCenter = asPnt3d(rb.resval.rpoint);
pFiler->readItem(&rb);
if (rb.restype != AcDb::kDxfXCoord +1)
mFirst = asPnt3d(rb.resval.rpoint);
pFiler->readItem(&rb);
if (rb.restype != AcDb::kDxfXCoord +2)
mSecond = asPnt3d(rb.resval.rpoint);
pFiler->readItem(&rb);
if (rb.restype != AcDb::kDxfXCoord +3)
mThree= asPnt3d(rb.resval.rpoint);
pFiler->readItem(&rb);
if (rb.restype == AcDb::kDxfXCoord +4)
mFour = asPnt3d(rb.resval.rpoint);
return pFiler->filerStatus();
}
Acad::ErrorStatus cascoCEntity::dxfOutFields(AcDbDxfFiler* pFiler) const
{
assertReadEnabled();
Acad::ErrorStatus es;
if ((es = AcDbEntity::dxfOutFields(pFiler)) != Acad::eOk)
return es;
// Write subclass marker.
pFiler->writeItem(AcDb::kDxfSubclass, "cascoCEntity");
// Write version number.
pFiler->writeItem(AcDb::kDxfInt16, (Adesk::UInt16) VERSION_CASCOCENTITY);
// TODO: here you can file datamembers not
// created by the ObjectARX Add-In.
pFiler->writeItem(AcDb::kDxfXCoord, mCenter);
pFiler->writeItem(AcDb::kDxfXCoord, mFirst);
pFiler->writeItem(AcDb::kDxfXCoord, mSecond);
pFiler->writeItem(AcDb::kDxfXCoord, mThree);
pFiler->writeItem(AcDb::kDxfXCoord, mFour);
return es;
}
请问我这个自定义实体类保存读取出错在哪儿?
还有本例中夹点函数、拉伸函数、变换函数以及对象捕捉点函数如何编程?
Acad::ErrorStatus cascoCEntity::getGripPoints(AcGePoint3dArray& gripPoints,
AcDbIntArray& osnapModes,
AcDbIntArray& geomIds) const
{。。。。}
Acad::ErrorStatus cascoCEntity::getStretchPoints(AcGePoint3dArray& stretchPoints) const
{。。。。}
Acad::ErrorStatus cascoCEntity::moveGripPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset)
{。。。。}
Acad::ErrorStatus cascoCEntity::moveStretchPointsAt(const AcDbIntArray& indices,
const AcGeVector3d& offset)
{。。。。}
请各位大侠帮帮忙呀,求求你们了。 |
|