DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


Light Visual Basic .NET Sample

Overview

Implementation

LightForm.OnFormLoad() retrieves IArray interface, controlling the array of all lights in the model. The IArray is obtained as "LightSourceArray" property from IPropertyArray, which in turn is queried from IModel interface. The IArray pointer is kept in m_iArrLights member of the form class. 

The ILightSource interface m_iLightSource implemented by the current light source is retrieved in LightForm.UpdateSourceInfo().

New lights are added or removed in LightForm.SetLightSourceCount(int nCount) using methods of IArray.

Tools > "Modify Popup Menu" menu option starts CustomizeMenuForm which uses IMenu_KC and IMenuItem_KC to manipulate the menu.

Notice also the LightForm.OnKernelCADEvent DG Kernel Event handler, which intercepts the menu commands. When user selects Surface or Wireframe commands the handler updates the relevant radio buttons on the dialogue to keep it synchronized with the component state. Notice also how the Save As command is blocked by e.param1 = True; because the command is handled by the application itself.

See also: Menu, ILightSource, Visual C++ Samples,    All samples.