Home Page > Programming Samples and Tutorials > Visual Basic Samples > Cross View
Cross View VB6 Sample
Cross View Visual Basic 6 Sample
Overview
Details Of Application Design
The Samples\VB\CrossView folder of the installation directory contains three
separate project folders for High,
Mid and Low level implementations
Normals calculation is implemented only in the Low level.
The CrossViewForm uses calls to Activate(),
UpdateCrossSectionView() and Setup() methods to delegate the relevant task to
the specific implementation class.
Low implementation of the sample provides also a way to display and test mapping
of 2D coordinates of Crsosssection view (right hand window) and coordinates the
correspondent point in 3D space. Low level transforms coordinates of the
crossection line to 2D coordinates in the local frane which defines the plane.
Implementation
The most critical work is done inside UpdateCrossSectionView()
of the form which is called on "Update Cross-Section View" button clicks
and also on start of the application or when implementation type is changed. The
method delegates the call to UpdateCrossSectionView() 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 section plane is rendered using the first
clipping plane of the pipe section. 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().
|