KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
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
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
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > Programming Samples and Tutorials > Overview > Pick
Pick Sample Overview

Pick Sample

Pick is a form application, which displays Light.glm model. It demonstrates programming and handling selection of  objects in 3D view by the end user.

The sample shows four different implementations of object selection based on three different approaches.

Running the application 

There are three groups of controls in the application related to three different ways of identification of the object at a point of the screen.   

Method one (Controls at the bottom): The KernelCAD Component can run in two modes: View and Modify. This is reflected by "Mode" radio buttons on the form of the application. In View mode the control works as normal rendering the model in 3D with rotation, zoom and pan. When "Select" option is on, mouse movements are blocked and mouse clicks are processed for selection of 3D objects in the view. Name of the selected object is displayed on the form.

Method two (Top right group of controls): It demonstrates a low-level detection of an object using GetItemAt method of  IPick interface. Its edit boxes allow entering the current screen position. The point on the screen is displayed in the window with cross-hair lines. Pressing the "Detect Object" button will display name of the object at the point or "No Object" text with green color.

Method three (Mouse Hovering group of controls): It demonstrates an efficient way to display the object name using  the GetItemAt method and MouseHover event triggered by the component similarly to tool tips in Windows User Interface. To see it in action, place the mouse pointer over different objects in 3D view without clicking and see the blue label showing name of the object.

For the last two methods the "Current surface point" group displays coordinates of the selected point on the surface of the object. The radio buttons allow choosing axes, relative to which the coordinates are calculated. When "Local Frame" option is selected the coordinates are relative to the local frame of the picked object.  

Method four (Multiple Object Selection group of controls): It demonstrates multiple object selection via a selection rectangle and handling the notification event. To select several objects turn on the "Notification Enabled" check box, in context menu of the KernelCAD control select Advanced>Edit>Select>Objects and define diagonal of a selection rectangle by clicking and dragging the mouse. When mouse is released the application processes the selection event and names of objects are displayed in the list

Implementation

Please select your programming language:

C#

VB.NET

Visual Basic 6

C++

Delphi