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 > I2DView_KC
I2DView_KC Interface

I2DView_KC Interface

I2DView_KC interface provides access to 2D View in 2D mode of KernelCAD component

I2DView_KC can be queried from IView interface of the component.. Query path: KernelCAD > GetView > IView > I2DView_KC

See also Interface List


HRESULT GetContext(IKCContext **context)

Parameters

context - [out, retval] IKCContext implemented by the view

Remarks:

Gives access to properties of the 2D View


HRESULT AddText(int xLoc, int yLoc, char* text, IText **iText)

Parameters

xLoc, yLoc- [in] location of the text in pixels relative to the upper left corner of the control's window

text - [in] string of the text item to be added to the scene

iText- [out, retval] - Not used in this update. The return is always NULL

Returns

S_OK in case of success.

Remarks:

Adds a text string at the location. Use DeviceToGeom and GeomToDevice to convert to geometric coordinates in x and y axes. It is recommended to call this method in the end of scene definition, after geometric objects have been added.


HRESULT DeviceToGeom(int k, int coord, double *val)

Parameters

k- [in] Window coordinate in pixels from the left edge of the window if coord = 0 and from the top edge of the window if coord = 1

coord - [in] indicates the coordinate. Valid values: 0 (horizontal) and 1 - (vertical)

val - [out, retval] The returned value of the geometric coordinate along x (coord = 0) or y axis (coord = 1)

Remarks:

The method converts a window coordinate to geometric coordinate along x (coord = 0) or y axis (coord = 1). The operation is inverse to GeomToDevice()


HRESULT GeomToDevice(double val, int coord, int *k)

Parameters

val - [in] Geometric coordinate along x (coord = 0) or y axis (coord = 1)

coord - [in] indicates the coordinate. Valid values: 0 (horizontal) and 1 - (vertical)

k- [out, retval] Window coordinate in pixels from the left edge of the window if coord = 0 and from the top edge of the window if coord = 1

Remarks:

The method converts geometric coordinate along x (coord = 0) or y axis (coord = 1) to the correspondent window coordinate. The operation is inverse to DeviceToGeom()


HRESULT RemoveAll()

Remarks:

Removes all items from the 2D View (clears the scene).


HRESULT AddText2(double x, double y, char* text, IText **iText)

Parameters

x, y - [in] 2D geometric coordinates for the location of the text

text - [in] string of the text item to be added to the scene

iText- [out, retval] - Not used in this update. The return is always NULL

Returns

S_OK in case of success.

Remarks:

Adds a text string at the location. Use GeomToDevice and DeviceToGeom to convert to window coordinates (pixels). It is recommended to call this method in the end of scene definition, after geometric objects have been added.