Class Hierarchy
AcGsView
C++
class AcGsView;
File
gs.h
Description
An AcGsView object corresponds to a portion of a GUI window, a set of camera parameters that define a view, and a collection of objects to be viewed. More specifically, an AcGsView can be used to represent an AutoCAD viewport.
An AcGsView is added to an AcGsDevice. A view may belong to only a single device at a time. Views need to be told what they are viewing. The client adds and removes (AcGiDrawable, AcGsModel) pairs corresponding to the viewed piece of the specified model. Each AcGsView has a RenderMode that corresponds to the algorithm employed when drawing geometry in that view.
An AcGsView has two states: interactive and non-interactive. By default, an AcGsView is non-interactive. This means that all methods are executed immediately upon calling and return only when completed. All return values are trustworthy and all methods can be invoked.
A call to beginInteractivity transforms an AcGsView into the interactive state as well as specifying a frame rate that the view will attempt to maintain (or exceed). To do this, it queues up all view modifications and update calls, handling them asynchronously. It is important to observe here that the minimum acceptable frame rate is often different from the user input rate (such as how fast the mouse is sampled). As a result of the queuing and asynchronous processing of view modifications, it is not safe to call methods that query the view state or modify the view state (such as add() or remove()). The only reliable calls are setViewport(), setView(), setEnableFrontClip(), setFrontClip(), setEnableBackClip(), setBackClip, setMode(), dolly(), roll(), orbit(), zoom(), pan(), update(), flush(), and endInteractivity(). At the return from a call to endInteractivity(), an interactive AcGsView will have been transformed to a non-interactive state.
AcGsView objects support front and back clipping planes. These planes are view-aligned; their normals are coincident with the eye vector. The planes maintain this orientation throughout modifications to the eye vector (in other words, they remain view-aligned). When the front clipping plane is enabled, it cuts all geometry in the direction specified by travelling from the camera target to the camera position. Conversely, when the back clipping plane is enabled, it cuts all geometry in the direction specified by travelling from the camera position to the camera target.
The AcGsView class should be used for accessing the full-view description in perspective mode. It contains all the neccessary query functions for the view definition, clipping planes, and view matrices.