Cross View C++ Sample
Overview
Details Of Application Design
To separate implementations the application uses classes
HighImplementation, MidImplementation and LowImplementation
which are inherited from common Implementation base class. The
form / dialog class keeps instances of each. Member m_implementation
keeps reference to the currently active implementation which changes depending
on selection of radio button in the Implementation group.
The form / dialog class uses calls to overridable / virtual Activate(),
UpdateCrossEntityView() and Setup() methods to delegate the relevant task to
the currently active implementation class.
Implementation
The most critical work is done inside UpdateCrossEntityView()
of the form/dialog which is called on "Update Cross-Entity View" button clicks
and also on start of the application or when implementation type is changed. The
method delegates the call to UpdateCrossEntityView() of the
currently active implementation class via virtual call.
In case of Low level implementation LowImplementation.AlignViewPlane()
method uses IFrame.SetAxes to align
z and x axes of the Eye Frame for two
dimensional style of view
Cross entity plane is rendered using the first
clipping plane of the pipe entity. The clipping plane is not enabled
because it used only for rendering purpose. Preparation of the plane is done in
SetupRenderingPlane() method of the form/dialog
Notice also the way frame
of the 2D View is rendered inside of OnClientDraw(). It uses
IGraphicItem queried from
IView
in CreateFrameGraphicItem().
|