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 > KernelCAD Components > Interfaces > Viewing Interfaces > IPick
IPick Interface

IPick Interface

GetItemAt
GetItemAt3D
GetItemAtDepth
GetSurfacePointAt

IPick interface gives programmatic access to 3D selection The mechanism provided by this interface is different from CurrentObjectChanged event raised in Modify Mode.

IPick can be queried from the IView interface

Query path: KernelCAD > GetView > IView > IPick

See also Pick Sample, Interface List


HRESULT GetItemAt( int xWnd, int yWnd, IItem** item )

Parameters

xWnd, int yWnd - [in] Window coordinates in pixels measured from the top left corner

 item - [out] The returned IItem interface.

Remarks:

The method detects whether there is an object at the specified window point and returns IItem interface implemented by the object. If there are several objects at the point the top one (the visible one) is returned.  See also the Advanced note below, which applies to this method too.


HRESULT GetItemAt3D( int xWnd, int yWnd, DIPoint* point, IItem** item )

xWnd, int yWnd -[in] Window coordinates in pixels measured from the top left corner.

point - [out] Returned global coordinates of 3D point on surface of the object at the specified window point. Coordinates of the point are random if there is no object at the window location.

 item - [out] The returned IItem interface. The item rreference can be NULL if the return is not required. 

Remarks:

The method is an enhancement of the GetItemAt above. It detects whether there is an object at the specified window point and returns IItem interface implemented by the object. If there are several objects at the point the top one (the visible one) is returned. 

The point is the 3D point on surface of the object, if there is one. It is the intersection point of surface of the object with 3D line orthogonal to the screen at the specified window point. Coordinates of the point are relative to the global 3D axes.

Advanced:: As the method uses relatively complex computations for high frequency programmatic usage it is recommended to experiment with graphic-only algorithm. To change the algorithm set the PrecisePointPicking property in context of the KernelCAD component to false. In many situations the graphic-only algorithm determines the point on the surface with acceptable precision. An exception is the case when surface approximation is very rough (See Geometric Resolution) or the object consist only of few triangular simplexes. In the later case z-coordinate of point relative to the Viewing Frame is the maximum among all vertexes of the simplex. 


HRESULT GetItemAtDepth( int xWnd, int yWnd, float* minZ, float* maxZ, IItem** item )

Parameters

xWnd, int yWnd - [in] Window coordinates in pixels measured from the top left corner.

 minZ, maxZ - [out] Minimum and maximum of z coordinates in Viewing Frame among all intersections of 3D line orthogonal to the screen at the specified window point with the picked object

item - [out] The returned IItem interface. The item rreference can be NULL if the return is not required. 

Remarks:

The method is an enhancement of the GetItemAt above. It detects whether there is an object at the specified window point and returns IItem interface implemented by the object. If there are several objects at the point the top one (the visible one) is returned. 

When the selected object is a closed surface, the 3D line orthogonal to the screen at the specified point intersects it at least twice. The method returns minimum and maximum of z coordinates in Viewing Frame for those intersections.

See also note at the end of GetItemAt3D.


HRESULT GetSurfacePointAt( int xWnd, int yWnd, ISurfacePointKC** surfPoint )

Parameters

xWnd, int yWnd - [in] Window coordinates in pixels measured from the top left corner.

 surfPoint - [out,retval] The returned surface point

Remarks:

The method is an enhancement of the GetItemAt above. It detects whether there is an object at the specified window point and returns ISurfacePointKC interface implemented by the object. Use ISurfacePointKC.GetItem() > ISection to obtain information about the object. Query ISurfacePointKC > IMeshPointKC for objects with meshed surface to obtain extended information about simplex and other mesh elements under the mouse.

Unless there was an error, the method always retuns a non-null surface point. When there is no object at the screen location ISurfacePointKC.GetPoint() returns the correspondent point at x and y plane of eye frame and ISurfacePointKC.GetItem() returns null