请教高手,如何调用AcDbEntity::worldDraw()???急急急。
Up a level to AcDbEntityAcDbEntity::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.
页:
[1]