KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Model Structure
Securing Models
Collapse Import/ExportImport/Export
Import and Export
Collapse Adanced Data ExchangeAdanced Data Exchange
Data Flow Sample
STL Tree
IDataContext Interface
ISTLDataContext Interface
Collapse Scene ItemsScene Items
Items
3D Text
Smart Labels
View Points
Collapse MeasurementsMeasurements
Measurements
Persistent Measurements
Grid
Collapse SectionsSections
Sections
Section Types
Collapse 2D2D
Overlays
2D Models
2D Items
Point Sets
Collapse Line and Curve SectionsLine and Curve Sections
Line Strips
Line Section
3DS Curves
Collapse Surface and Solid SectionsSurface and Solid Sections
Surfaces
Collapse Mesh SectionsMesh Sections
Mesh Section
Mesh
Surface Of Revolution
BRep 3D Objects
Collapse BRep BSpline objectsBRep BSpline objects
Bspline objects
BSpline Faces
BRep Section
Pipes
Collapse 3DS Sections3DS Sections
3D Section
Profiles
Surface Patches
Surfaces and Patch Strips
Collapse AttributesAttributes
Material
Clipping Planes
Symmetries (Arrays)
Textures
Collapse OperationsOperations
Boolean Operations
Surface Trim
Cut Surface
Collapse MovementsMovements
Movements
Kinematic Sections
Collision Detection
3D Grid
Collapse Mathematical ObjectsMathematical Objects
Pure Geometric Objects
Points and Vectors
Planes
Collapse CurvesCurves
Straight Lines
3D Circle
Ellipse
Free-Form Curves
Arc Spline Curves
Frames
Transfroms
Oriented Boxes
Collapse 2D Elements2D Elements
Geometric Elements
Arcs
Line Strips
Collapse Basics of 3D GraphicsBasics of 3D Graphics
Concepts
3D View
2D View
Viewing Volume
Birds Eye View
Viewing Plane
Perspective View
Background
Collapse AlgorithmsAlgorithms
Euclidean Shortest Path
Collapse User DataUser Data
Layers
Object User Data
Model User Data
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Topological Modifications
Programming commands
Dynamic model restructuring
Dynamic Object Creation
Generator of 3D Sections
Generator of SOR Objects
Model class
Selection
Selection Event
External Models
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
IKO_Standard_Object
IKO_Model
IKO_TopExp_Explorer
Collapse BRepExtremaBRepExtrema
IKO_BRepExtrema_DistShapeShape
Collapse Geom2dGeom2d
IKO_Geom_CylindricalSurface
IKO_Geom_ElementarySurface
IKO_Geom2d_Circle
IKO_Geom2d_Conic
IKO_Geom2d_Curve
IKO_Geom2d_Geometry
IKO_Geom2d_Line
Collapse GeomGeom
IKO_Geom_BSplineCurve
IKO_Geom_BSplineSurface
Collapse GPGP
IKO_gp_Ax1
IKO_gp_Ax2
IKO_gp_Ax22d
IKO_gp_Ax2d
IKO_gp_Ax3
IKO_gp_Circ2d
IKO_gp_GTrsf2d
IKO_gp_Lin2d
IKO_gp_Mat2d
IKO_gp_Object
IKO_gp_Sphere
IKO_gp_Cone
IKO_gp_Torus
IKO_gp_Trsf
IKO_gp_Cylinder
IKO_gp_Pln
IKO_gp_Circ
IKO_gp_Trsf2d
Collapse GeomAPIGeomAPI
IKO_GeomAPI_PointsToBSpline
IKO_GeomAPI_Interpolate
Collapse TColStdTColStd
IKO_TColStd_Array1
IKO_TColStd_Array1OfInteger
Collapse TColgpTColgp
IKO_TColgp_Array1OfPnt
IKO_TColgp_Array1OfVec
Collapse BRepBRep
IKO_BRep_Builder
Collapse BRepBuilderAPIBRepBuilderAPI
IKO_BRep_Builder
IKO_BRepBuilderAPI_MakeWire
IKO_BRepBuilderAPI_MakeEdge
Collapse BRepOffsetAPIBRepOffsetAPI
IKO_BRepOffsetAPI_ThruSections
Collapse BRepPrimAPIBRepPrimAPI
IKO_BRepPrimAPI_MakePrism
Collapse ModModelingAlgorithmsModModelingAlgorithms
IKO_BRepGProp_Face
Collapse TopoDSTopoDS
IKO_TopoDS_Shape
IKO_TopoDS_Edge
IKO_TopoDS_Face
IKO_TopoDS_Wire
Collapse DataData
Collapse Import / ExportImport / Export
IDataConvert_KC
ICADFormat_KC
IDataContext
ISTLDataContext
IFormatVersionDataContext
Collapse User Data User Data
ILayers
IDataSource
IDataTable
IRecordSet
IDataMods
IUserData
IMatrixData
Collapse MovementMovement
IKinematicSection_KC
IMove_KC
IKinematicSet_KC
ICutEffect_KC
ISpinEffect_KC
Collapse FramesFrames
I3DObject
IFrame
IFrame2
IFrame3
IFrameEx
Collapse Oriented ObjectsOriented Objects
IObjectOriented
ISphere_KC
IBox
Collapse SectionsSections
Collapse ItemsItems
IItem
ILabel3D_KC
IDynamicScreenItem_KC
IDynamicScreenItemManager_KC
ISmartLabelManager_KC
ISection
ISection2
ISectionPointSet
ISectionLineStrip
ITextSection_KC
IPipeSection
ILineSection_KC
IObjectPosition_KC
ISticky_KC
ILabelSection_KC
IModelHealer_KC
IPointCloud_KC
IProfiledElement_KC
Collapse Mesh interfacesMesh interfaces
IMesh
IMeshTopol
ISimplex
IMeshMods
IVertex
IMeshEx
IIterator
IMeshPointKC
ISurfacePointKC
ISurfaceMetric_KC
IVertexEx_KC
IEdge_KC
ISimplexEx_KC
IMeshAlgor
IMeshShading_KC
Collapse GeneralGeneral
Collapse Collections InterfacesCollections Interfaces
IArray
IArray2
IList
IListUnkn_KC
IRelation
IArrayNum
IArray3D
IRefMap_KC
IObject_KC
ITypeBasic_KC2
IModelSearch_KC
IBitmap
IBlob
IKCContext
IKCContext2
IError_KC
IKCStack
ILineStyle_KC
IMenu_KC
IMenuItem_KC
IGlobalAPI_KC
IControlInitialisationContext_KC
IRange
IRectangleAxisAligned_KC
Collapse Topological InterfacesTopological Interfaces
IStripTopol
I3DSectionGenerator
ISORSectionGenerator 
IDIObjGenerator
Collapse Viewing InterfacesViewing Interfaces
IView
IView2
IViewPoint
IViewPointArray
ILookAt
IViewModal
ILook
ILookEx
IMeasurement_KC
IPick
ISelection_KC
IRectangleColor_KC
I2DView_KC
I2DView2_KC
I2DEditor_KC
IPrint_KC
IVirtualView
IGraphicItem
Collapse Lines And CurvesLines And Curves
ILine
ILineGeom
ILineMetr
ICurve
ICurveFreeForm
ICurveFreeFormEx
IArcSpline3DCurve
IArc
IArcEx
ICircle3D_KC2
IEllipse_KC
Collapse Symmetry InterfacesSymmetry Interfaces
ISymmetries
ISymmetry
IAxialSymmetry
Collapse Clipping plane interfacesClipping plane interfaces
IClipArray
IClipPlane
Collapse AlgorithmsAlgorithms
IEuclideanShortestPath_KC
Collapse 2D Geometry2D Geometry
ILine2D
IArc
IArcEx
IStripArcLine_KC
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Sample List
3DBugger
BoolOp
PlanarOps
Calculator
Capture
Cannon
Clip
Cloud
Collision
Collision Path
Cross View
Data Flow
Data Flow
Deploy Tutorial
DiffSurface
Direct User Access Demo
DIView
eMotion
Euclidean Shortest Path
Gear
Label
LabelEx
Layers
Light
Lines
LowDim
Make Your Move
Measure
Mesh Mods
MeshOps
Metrics
MiniCAD
Modal
Modeling Curves
Morph
Object Array
Overlay
Patch
Patchwork
Pick
Point Of View
BoolOp
Profile
Rotation
Pipes
Layers
Shape Explorer
Smart Labels
Strip Topology
Surface Metrics
Symmetry
Transform
Texture
Turbine
TwoD
User Data
View Point
WpfCAD
Zoom
Collapse DeploymentDeployment
Deploy Tutorial
DeployModule
DeployWixBasic
WixDeploy
Collapse .NET Samples.NET Samples
Collapse C# SamplesC# Samples
Patch Tutorial
MiniCAD Sample
Strip Topology Sample
DI View Sample
Modal View Sample
Modeling Curves
Label
LabelEx
Pick
Object Array
Data Flow
Profile
Cross View
Low Dim
Morph
Clip
BoolOp
Collision
Collision Path
3DBugger
Data Flow
Shape Explorer
Smart Labels
Symmetry Sample
Cannon
View Point Sample
Capture
User Data
Layers
Zoom
Collapse Visual Basic SamplesVisual Basic Samples
Patch Tutorial
DI View Sample
MiniCAD Sample
Object Array Sample
BoolOp
Data Flow
Pipes
Transform
Measure
Mesh Mods
Mesh Ops
Metrics
Morph
TwoD
eMotion
Cross View
3DBugger Tutorial
Collision
Collision Path
Light
Patchwork
Capture
Collapse WPFWPF
Clip
Mesh Ops
Measure
Lines
LowDim
WPF
Patch
Collapse Delphi SamplesDelphi Samples
3DBugger
BoolOp
Calculator
Patch Sample
Modelling Curves
MiniCAD Sample
Morph
Shape Explorer
Object Array
Metrics
Cannon
Pipes
Patchwork
Collision
Collapse C++ SamplesC++ Samples
3DBugger
BoolOp
Cannon
Capture
Cloud
Collision
Collision Path
Cross View
DI View Sample
eMotion
Gear Sample
Label
LabelEx
Light Sample
Measure
Mesh Ops
MiniCAD Sample
Modal Sample
Modeling Curves
Object Array Sample
Overlay Sample
Patch Tutorial
Pick
Point Of View
Planar Ops
Rotation Sample
Profile Sample
Shape Explorer
Smart Labels
Strip Topology Sample
Layers
Lines
LowDim
Metrics
Metrics2
Morph Sample
Patchwork
Pipes
Symmetry Sample
Texture Sample
Transform
TwoD
Turbine Sample
User Data
View Point Sample
Zoom Sample
Collapse Visual Basic SamplesVisual Basic Samples
Patch
DI View
MiniCAD
Data Flow
Cross View
Cloud
Planar Ops
Calculator
Light
Pick
Object Array
Label
Symmetry
Transform
Morph
Line Strip
Capture
Collapse Delphi SamplesDelphi Samples
KernelCAD and Delphi
3DBugger
Data Flow
BoolOp
Calculator
Cannon
Collision
Label
LabelEx
Metrics
MiniCAD
ModelingCurves
Object Array
Patch
Patchwork
Pipes
Collapse 3D Debugger3D Debugger
Creating and editing models
Editing Generic 3D Objects
Topological Commands
Model Explorer
Export / Import
Modeling Tips
3D Debugger
Collapse EditorsEditors
Form View
3D View
Collapse 2D Editors2D Editors
Crossection View
Profile View
Drum View
Collapse DialogsDialogs
3D Curve Dialog
Symmetry Collection Editor
Clip Editor
Material Editor
Surface options dialog
Collapse Modelling TutorialsModelling Tutorials
Table Tutorial
Mouse Tutorial
Collapse DeploymentDeployment
Redistribution
Registration
Deploy Module Tutorial
WixDeploy Tutorial
DeployWixBasic
Deploy Tutorial
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Methods and Properties
Methods and Properties of KernelCAD

ActiveX Interface of the KernelCAD Control

Properties:

ModelPath
ShowGlobalAxes
ShowLocalAxes
DIBackColor
RenderSolid
EmbeddedModel
TransparBackgrEnabled

Methods:

GetModel
Save
SaveAs
UpdateSurface
GetView
RequestClientDraw
RequestEvent
UpdateView

Events:

MouseDown
MouseMove
MouseUp
ClientDraw
CurrentObjectChanged
Extended Mouse Events
KernelCADEvent Event
 

Properties


ModelPath Property

Type: String
 
Remarks:
 
ModelPath string is the main property of the control. It contains the path of an existing model file or empty string. When the property is assigned a new value the control automatically loads the model and updates the 3D window. A message is displayed if the load fails. Use the SaveAs method to save the current model in a new location and change the ModelPath property at the same time.
ModelPath can be either relative or full path (with drive letter or starting with hash). There are two kinds of relative paths:
 
1) Standard (like Models\Cube.glm), which is relative to the installation folder. The control reads the location of the installation folder from the registry. For example KerCADne.ocx reads the installation directory from the "InstallDir" string of the "HKEY_LOCAL_MACHINE\SOFTWARE\DInsight\KerCADne\2.1" key. This value can be set in installation packages for distribution of the application developed with KernelCAD, when control is not installed but only registered on the target computer. It is not recommended to modify the key with KernelCAD installed.
 
2) Relative path with modifier prefix, which specified the root. Currently supported modifiers are:     (a) <EXEPATH>. Path <EXEPATH>Models\Samples\Lines.glm means that the lines,glm is located in the Models\Samples subdirectory of the folder where the application's executable (.exe) file is located. Note that at design time control does not display any model when the Model Path has <EXEPATH> modifier. The <EXEPATH> modified paths are useful for distributing applications where location of the target directory is normally not known beforehand.
    (b) <OCXPATH>. Path <OCXPATH>Models\Std.glm means that the Std,glm is located in the Models\ subdirectory of the folder where the control's executable (.ocx) file is located. 
 
The model path can be an empty string, in which case the KernelCAD component will not attempt to load any file on start of the application, the model will have no objects and 3D window will be empty. This option can be useful when the model is constructed dynamically using Dynamic Object Creation to avoid references to external files or other reasons. Note that a model file is valid even if the saved model is empty (has no objects).

ModelPath strings for Pro level components must have .glm extension. KernelCAD Enterprise component can load and save files with other extensions. Supported formats are enumerated by the ECADFormat enumeration

When the control is being inserted for the first time into a form or dialog or created dynamically the default value of the property is taken from the Registry (see below). If the correspondent registry values are not present the ModelPathis set to empty string.

The default value of ModelPath is constructed by appending DefaultModel registry value from HKEY_LOCAL_MACHINE\SOFTWARE\DInsight\KernCAD\<version> key to InstallDir path string in the same key. For controls different from standard KernelCAD the "KernCAD" key name above should be replaced with specific ocx name. InstallDir and DefaultModel values can be changed (for controls only) to any suitable locations.


 
ShowGlobalAxes Property
 
Type: Boolean
 
Remarks:
 
If this property is set to true the global axes will appear in the control's window.

 
ShowLocalAxes Property
 
Type: Boolean
 
Remarks:
 
The component handles only runtime changes of this property. unless there is only one object in the model, this property is ignored on initialization of the control during application startup and in design mode (form editors). In these situations visibility of a local frame is controlled by the ShowLocalFrame value stored in the section.

When the property is being set to false at runtime all local frames will be hidden. When the property is being set  to true at runtime ShowLocalFrame of the current section will be set to true. If no section is selected as current, but the model has a single top level section ShowLocalFrame of the section will be set to true  If there is more than one top level section no action is taken.


 
DIBackColor Property
 
Type: Long integer
 
Remarks:
 
This property determines background color of the control window. To modify the color in Development Environment open Properties dialog box (right-click > Properties or similar option in the IDE menu) and go to the Render page. In Visual Studio 2003, 2005, 2008 click icon on top of the Properties Window to open the Property Pages Dialog. Programmatically the property needs to be cast to COLORREF standard C++/VB data type to use.

COLORREF is a DWORD (four bytes) size integral data. The first three bytes keep red, green and blue components of the color. The fours byte is not currently used in KernelCAD. To obtain KernelCAD style floating point number representing for example green component divide value of the third byte by the 255 and cast to float or double type. Samples\VC\Include\Misc.h file contains two C++ macros, which perform the above conversion both ways.

Use utility from tools menu of 3D Debugger to convert between COLOREF and rgb(a) colors

Background can be transparent to show the window behind. See the TransparBackgrEnabled property.

The background cal also have gradient colors. See details at Background.


 
RenderSolid Property
 
Type: Boolean
 
Remarks:
 
If this property is false the model will be displayed in wire frame mode. Otherwise it will be displayed as a solid object (Default).

 
EmbeddedModel Property
 
Type: Boolean
 
Default:  False
 
Remarks:
 
This property is not available in 64 bit edition. Contact us for more information
 
The EmbeddedModel property is a design-time only property. Is is supposed to be changed only in form designers or resource editors of a Development Environment. The property should not be modified at runtime. Use Property Pages Dialog or Properties Window to modify the property.
 
If this property is true the model will be embedded into the executable file of the application, which uses the KernelCAD component. This helps avoiding issues of locating or transmitting the model and makes sure the correct model is loaded by the component. Embedding model is particularly useful when model has significant value by itself or has restricted copyrights and is not intended to be accessible by the user.
If this property is false (default) the model is loaded on the application start up from location specified by ModelPath and the location is considered valid for persistence of the model, for example by the Save method

When this property is changed from false to true the model will be loaded from the location specified by ModelPath, after that ModelPath is not used by the component.

When this property is changed from true to false the user will be prompted to select the location where the previously embedded model will be saved to. After that ModelPath is considered as persistent location of the model.

To update or change an embedded model set the property in Property Pages Dialog or Properties Window to false. Make sure ModelPath points to the new model and change the property back to true.

Object Array sample uses embedded model.


 
TransparBackgrEnabled Property
 
Type: Boolean
 
Remarks:
 
When this property is true and the DIBackColor is 0 (zero in all components) the control will have transparent background so that the window behind will be visible instead of any background. .NET applications must also set the Visible property of the KernelCAD control to false using form editor at design time.
TransparBackgrEnabled property is a design-time property: Changes to its value only have effect at runtime and only if they are made in a form or resource editor.

This property is ignored on Windows prior to Windows Vista, where value of DIBackColor 0 will make the background black.


Methods

LPUNKNOWN GetModel()  

Return Values

A reference  to IUnknown interface (IUnknown* in C++) implemented by the model object of the control. Type of return can be interpreted differently by different environments to suite its object structure.
 
Remarks
 
GetModel method returns a reference to IUnknown interface implemented by the model. IModel interface and hence all other interfaces, defining geometry of the model, can be accessed via this interface. Actual reference returned by the method already has inherited type of IModel. This means that often (definitely in a C++ and C# code) the pointer can be simply cast directly to IModel type. In addition to that, GetModel method is declared in the type library of the control as returning IModel pointer, which means that high level Development Environments like Visual Basic will treat the method as returning IModel interface. See also Interface List

BOOL Save()

Returns 

TRUE in case of success.

Remarks

 Call to save the model in its current location.

 
BOOL SaveAs(BSTR strFilePath)

Parameters

strFilePath - Full path of the file to save to. Type of return will be interpreted differently by different environments to suite its type system.

Returns

 TRUE in case of success.

Remarks

Call to save the model to a new file. The ModelPath property will be changed to strFilePath.
Normally the Development Environment used to insert the KernelCAD Control into an application project will create a wrapper class or use a different way to represent the property like the Object Browser in Visual Basic, where BSTR object will be replaced with a type more suitable for the Environment you are using.

KernelCAD Enterprise only: If strFilePath has .stl or .wrl extensions the model will be saved in STL or VRMl formats. If strFilePath has no extension it is interpreted as an STL directory path. The new STL directory tree will be created and objects of the model will be saves as separate .stl files in the directory. See "STL Tree" topic of KernelCAD Enterprise documentation for more details.

When the KernelCAD component is in Two Dimensional mode strFilePath can have .emf or .wmf extension and the scene will be saved in the Extended Windows Metafile or older Windows Metafile format, which can be used for embedding in different documents for printing etc.


BOOL UpdateSurface()

Returns 

TRUE in case of success.

Remarks

This method is equivalent to Update method of IModel interface with the addition that UpdateSurface redraws the control's window automatically. See MiniCAD sample

The method recalculates the surface of the model after any changes to parameters of the model. This method or Update method has to be called after a any modification of the models parameters that affects the shape of the object. Most commonly this is done after call(s)  to one of SetParam methods of IElement or IElem interface. In contrast, for example, object movements with I3DObject do not change internal geometry of the object, so the UpdateSurface method does not have to be called.

A valid sequence of modifications  should involve only one modification per parameter. Before making another modification to the same geometrical parameter UpdateSurface or Update has to be called. For example 

    iElemPoint.SetParam(0, 0.5);
    iElemPoint.SetParam(1, 0.9);
    iModel.Update();

is a valid sequence, but 

    iElemPoint.SetParam(0, 0.5);
    iElemPoint.SetParam(0, 0.9);
    iModel.Update();

is not.

Note that this method is costly in terms of computational load, so it is recommended to call it once per logically complete sequence of user input.


LPUNKNOWN GetView()

Returns 

Pointer to IUnknown interface implemented by the View object of the control.   

Remarks

Although the return type is declared as LPUNKNOWN, GetView method actually returns the pointer to the IView interface implemented by the View object of the control. IView interface gives access to rendering properties of the control. In addition, it gives access to ILook interface, which can be retrieved either using QueryInterface in C++ or by coercion of the reference to ILook type in Visual Basic. The actual pointer returned by the method already has an inherited type of IView. This means that in a C++ code this pointer can be simply cast directly to IView type. Additionally, GetModel method is declared in the type library of the control as returning IView pointer, which means that high level Development Environments like Visual Basic will treat the method as returning IView interface. See also Interface List

void RequestClientDraw(boolean request)

Parameters

request - [in] true if ClientDraw event needs to be raised and false otherwise.

Remarks

 As invoking ClientDraw event involves some performance cost, this event is not raised by default. This method has to be called to enable or disable the event.

void RequestEvent(int event, boolean request)

Parameters

event - [in] id of the event to be requested. Valid values are listed in EDIEvent enumeration.

request - [in] true if the event needs to be raised and false otherwise.

Remarks

 Some events in the KernelCAD software (such as MouseHover event) involve additional computational load and are not enabled by default. This method allows programmatic enabling of them.  

LPUNKNOWN UpdateView()

Remarks

This method forces redrawing the window of the control. For performance reasons it should be used instead of UpdateSurface when there are no modifications to geometry of surface, for example when some objects have been moved without changing their internal parameters.

Events


void OnMouseDownKernelCAD(short Button, short Shift, long x, long y)     

Parameters  

Button - [in] 1 if left button pressed, 2 - if right mouse button pressed. Shift - [in] equals to 1 if Shift key is down and 0 otherwise. x, y - [in] - window coordinates of the mouse pointer. 

Remarks

The name of the handler for the event can be selected during implementation. OnMouseDownKernelCAD method is called when the user clicks  in the control display area using mouse buttons.

Notice: This event is not raised in the Dual Mode. Use MouseEx in this mode instead


void OnMouseMoveKernelCAD(short Button, short Shift, long x, long y)     

Parameters  

Button - [in] 1 if left button pressed, 2 - if right mouse button pressed. Shift - [in] equals to 1 if Shift key is down and 0 otherwise. x,y - [in] - window coordinates of the mouse pointer. 

Remarks

The name of the handler for the event can be selected during implementation. OnMouseMoveKernelCAD method is called when the user moves the mouse in the control display area.

Notice: This event is not raised in the Dual Mode. Use MouseEx in this mode instead


void OnMouseUpKernelCAD(short Button, short Shift, long x, long y)     

Parameters  

Button - [in] 1 if left button pressed, 2 - if right mouse button pressed. Shift - [in] equals to 1 if Shift key is down and 0 otherwise. x,y - [in] - window coordinates of the mouse pointer. 

Remarks

The name of the handler for the event can be selected during implementation. OnMouseDownKernelCAD method is called when user releases a mouse button while the pointer is positioned over the control display.


void OnClientDraw()    

Remarks

ClientDraw event is raised when the controls view needs to be repainted and after the rest of the model has been drawn. Query IDraw interface via path: control->GetModel -> IModel ->IDraw and use its methods to perform custom drawing operations. Important: As client drawing involves some performance cost this event is not raised by default. To enable or disable it RequestClientDraw method has to be called.


void CurrentObjectChanged(VARIANT iSect)   

Remarks

CurrentObjectChanged event is raised in Modify mode when the user selects a different object as current. punkVal member of iSect  is a reference to ISection interface (can be safely cast to ISection type) of the newly selected object.

When the passed reference is NULL it means that user clicked outside any objects in the components view.

There are two context properties which modify behaviour related to this event. See more at Selection via the current object


void MouseEx(long eventType, long xMouse, long yMouse, long data)   

Parameters  

eventType [in] - Type of the event 

xMouse, yMouse [in] - window coordinates of the mouse pointer. The coordinates are relative to the top left corner of the window of the control. 

data[in] -Currently unused. Reserved for different types of events to be added in future releases

Remarks

The MouseEx event is used for detection of mouse behaviour slightly more complex than standard Mouse Up/Down/Move events. The actual type of event is described by the eventType parameter. Valid values of  eventType are enumerated by EDIEvent. In this release only eEventMouseHover, eEventMouseRButtonDown, eEventMouseRButtonMove and eEventMouseRButtonUp are passed trough via this event. Consider disabling conext menu for the right hand mouse button actions

The MouseHover event type occurs when the mouse pointer has stopped in a small area for about half a second after some movement . This is similar to behaviour detected for displaying tool tips in Windows User Interface.

Note: To receive notification about one of MouseEx events it has to be enabled with a call to RequestEvent with the same eventType value.


void KernelCADEvent( long eventType, const VARIANT& param0, VARIANT* param1 ) 

Parameters  

eventType [in] - Type of the event. Valid values are enumerated in EDIEvent

param0 [in] - Parameter of the event. Meaning depends on eventType and is documented in each particular case

param1 [in,out] - Parameter of the event. Meaning depends on eventType and is documented in each particular case

Remarks

Meaning of param0 and param1 depends on the eventType. Most often the KernelCADEvent event is used to notify the application that the user selected a context menu item. eventType in this case coincides with EDIEvent.eEventUICommand. See more details in Context Menu topic