Since AcGi is just an interface specification, it can be used for many different purposes. In AutoCAD the AcGi specification has several different implementations, each with a specific purpose. The 2D-display pipe is used to generate the 2D images displayed on the screen, and there is a different 3D system for the persistently rendered views. In addition to these display-related implementations, there are several others, including any that you may develop.
It is important to be aware of two other AcGi implementations used by the database engine. The first is for proxy graphics generation and the second is used to explode an object into basic ObjectDBX ™ entities. The proxy graphics implementation is used when a custom object is saved, to store the graphics in a metafile that can be replayed when the drawing is loaded on a system where the custom application is not available. The explode implementation is used by the explode mechanism and to discover boundaries within a complex object.
It might be important for you to distinguish between these different implementations. Therefore, AcGi exposes a viewport regeneration type that can be queried from your subWorldDraw() method.
The viewport regeneration type, referred to as the regentype, is set by AutoCAD. You can query its value using the AcGiWorldDraw::regenType() function. Values for AcGiRegenType are
- kAcGiStandardDisplay is the typical drawing mode and is used when the user issues a REGEN command or edits an entry. Entities should be rendered in wireframe in this mode.
- kAcGiHideOrShadeCommand performs hidden line removal and indicates that the HIDE or SHADE command is in effect. Entities should be rendered using faces in this mode.
- kAcGiShadedDisplay uses materials and lighting models to create a realistically shaded image of a 3D model and is used when the user issues a RENDER command. Entities should be rendered using faces in this mode.
- kAcGiForExplode is the type used for an explode operation.
- kAcGiSaveWorldDrawForProxy is the type used for the generation of proxy graphics. In this case all of your rendering should be done in subWorldDraw() since subViewportDraw() is not supported for proxy graphics.
- eAcGiRegenTypeInvalid indicates an invalid regeneration type.