明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1817|回复: 1

请教高手,如何调用AcDbEntity::worldDraw()???急急急。

[复制链接]
发表于 2003-8-21 23:45:00 | 显示全部楼层 |阅读模式
发表于 2003-8-25 13:19:00 | 显示全部楼层
Up a level to AcDbEntity         
AcDbEntity::worldDraw Function virtual Adesk::Boolean

worldDraw(

AcGiWorldDraw* mode);

mode Input pointer to fully initialized AcGiWorldDraw object

Function usage

Whenever a regeneration of the entity's graphics is required, AutoCAD calls this function to generate the graphics primitives that will represent this entity on screen. This function will then provide a generic set of 3D graphics primitives that AutoCAD will adjust for each viewport's parameters as they are displayed.

If this function returns Adesk::kFalse, then AutoCAD calls the AcGiViewportDraw() function once for each viewport that is currently active in the AutoCAD editor.

It is possible for an ObjectARX application to call this function (for example, in order to get the face information for an AcDb3dSolid entity), but it will need to provide a fully functional AcGiViewportDraw object and the AcGiWorldGeometry, and AcGiSubentityTraits objects for which it provides references. The only way to do this is to derive custom classes from these three AcGi classes. The acgisamp.cpp sample program supplied with the ObjectARX SDK demonstrates how to do this.

Function implementation in derived classes

The AcGiWorldDraw object pointed to by pMode as well as the AcGiWorldGeometry and AcGiSubentityTraits objects available from the AcGiWorldDraw object are all provided to allow this function to generate whatever graphics primitives are desired to represent the entity in a viewport independent manner (that is, one 3D image is used for all viewports and is adjusted by AutoCAD for all the different parameters in the different viewports). Chapter 10 in the ObjectARX Developer's Guide explains how to use these classes.

If this function generates the graphics image to be used for display, then it should return Adesk::kTrue.

If the entity intends to do viewport dependent graphics primitives, then this function should simply return Adesk::kFalse. This will cause AutoCAD to call the entity's viewportDraw() method once for each viewport that's currently active.

If this method is not overridden in classes derived from AcDbEntity, then entities of such classes will not display on screen.

Default implementation

Immediately returns Adesk::kTrue.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 17:48 , Processed in 0.168149 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表