- UID
- 7273
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-7-4
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2002-11-14 09:14:29
|
显示全部楼层
下面是目录objectrx---------samples-------------dataxtsn下的一段话,来不及翻译了,估计大家都看得懂:
(C) Copyright 2001 by Autodesk, Inc.
To store data on an existing object, there are two common mechanisms in
use:
1 - Use Protocol Extension to attach/manipulate Xdata on the object for
which the data is needed.
2 - Define an AcDbObject class to be stored in the extension dictionary
of the object for which the data is needed.
These methods are logically equivalent operations, but they have different
qualities and capacities, which need to be compared to the requirements of
the problem.
The basic difference is that Protocol Extension Xdata has less storage
overhead, but a limited capacity (i.e. Xdata has a 16k per object limit),
while Extension Dictionaries have essentially unlimited storage capacity
but more storage overhead.
In the two sample programs provided in this directory, we are using the
mechanisms to effectively add a string variable to any instance of
AcDbObject. In this trivial endeavor, the Protocol Extension Xdata
version, the specific code is roughly 260 lines versus about 200 lines for
the Extension Dictionary version, including comments. So, both mechanisms
require the same amount of code. The Protocol Extension Xdata form is
considerably more compact in storage overhead. But imagine
a version where either 200K per object was required, or over a hundred
distinct heterogenous fields were needed. That custom object, with
compiled-in random access to all those fields wouldn't look nearly as bad
as the corresponding resbuf chain parser for Xdata.
下面还有一段key points,可是这里已经超长了,而且又不能连续发贴,真是郁闷!
等有人回复了之后我再贴吧 |
|