乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 23|回复: 1

请问dwgInFields()函数有什么的作用?

[复制链接]

8

主题

17

帖子

2

银币

初来乍到

Rank: 1

铜币
49
发表于 2011-2-14 18:15:00 | 显示全部楼层 |阅读模式
有谁知道dwgInFields()函数有什么作用、怎么用的、什么时候用么?
大牛们帮解释下哦
回复

使用道具 举报

0

主题

37

帖子

2

银币

初来乍到

Rank: 1

铜币
37
发表于 2011-2-15 15:42:00 | 显示全部楼层
This function is called by dwgIn(). Its purpose is to allow the object to read in its data.
There is a fixed set of steps that should be followed when implementing your own version of this function:
Call assertWriteEnabled().
Call the parent class's dwgInFields() passing it pFiler. If this returns Acad::eOk, then continue; otherwise, immediately return whatever the parent class's dwgInFields() returned.
Use pFiler to call the appropriate AcDbDwgFiler methods to read in the object's data items. It is essential that the same number of data items be read in, and in the same order, as those that are written out via dwgOutFields().

Following these steps results in all base classes having their implementations of this function called as well, thus reading in all the object's data in class hierarchical order.
The actual AcDbObject::dwgInFields() implementation takes care of reading in the object's handle as well as its persistent reactor, extension dictionary, and xdata information.
This function should return Acad::eOk if successful. In your own custom class implementations of this function, it's easiest to just return pFiler->filerStatus().

Note
The designer of an application class may want to have the RECOVER and AUDIT commands fix the data in a custom class, in cases where its data is corrupted, or objects referred to from the custom object are invalid. If this is desired, then the dwgInFields() method for the custom class should be tolerant to invalid data (for example, null objectIds where non-null data is expected), and not return an error status when it is possible to recover from the errors. During RECOVER and AUDIT, the audit() method subsequently are called for the object, giving it an opportunity to fix its data and return to a reasonable state.
Exercise care in this decision, as currently there exists no flag to inform dwgInFields() whether it is being called during RECOVER, or during another process; for example, OPEN. This implies that a too tolerant version of dwgInFields() may allow an invalid object to be read in, that may or may not be audited later.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-6-29 14:09 , Processed in 1.038995 second(s), 67 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表