查看单个帖子
旧 2009-05-04, 07:23 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】determining extents when creating entities

determining extents when creating entities
determining extents when creating entities
in the previous version, which i downloaded february 9, 2005, i was able to add extents for an entity using addblockext(). in 1.13, this method apparently does not exist. what is the recommended approach for determinig the extents of an individual entity? for the entire drawing?
my previous code is:
code:
oddbblocktablerecordptr pblock = blockid_.saveopenobject (oddb::kforwrite);
oddbcircleptr pcircle = oddbcircle::createobject();
pblock->appendoddbentity(pcircle);
pcircle->setcenter(centerf);
pcircle->setradius(radiusf);
extents_.addblockext (pblock);
thanks for any help.
both oddbentity and oddbblocktablerecord have getgeomextents() method. oddbblocktablerecord::getgeomextents() iterates through entities so it's better to call it once after all entities are appended.
if you want to perform zoom extents getgeomextents() is not the best way. some entities may have viewport-dependent geometry, in a viewport some entities may be invisible because their layer is frozen etc.
oddbviewport, oddbviewporttablerecord, oddbviewtablerecord and odgsview have odabstractviewpe protocol extension which has methods viewextents(), zoomextents()
to perform zoom extents in paper viewport (oddbviewport) or model viewport (oddbviewporttablerecord) its better to use odabstractviewpe::zoomextents().
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)