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 > Overlay Editor
2D Editor

Two Dimensional Editor

At the time of writing this topic Two Dimensinal editor means only Overlay Editor, which may change in future releases.

2D Editors interact with end user to allow direct modification of a 2D Model

Access to a 2D editor is implemented via I2DEditor_KC. See Overlay topic about obtaining this interface.

Objects which implement I2DEditor_KC also implement I2DView_KC (see overlays). Methods of I2DView_KC allow mapping between screen points (pixels) and geometric 2D coordinates in the 2D plane.

Call I2DEditor_KC.GetObject() to obtain ISection of the overlay. Query IModel_KC from ISection of the overlay to access its 2D geometry. Use methods of IModel_KC to modify structure of the 2D model and parametrs of its items and elements. More details.

Event Notifcations

To notify the application about different actions by the end user, 2D editors raise KernelCADEvent events with the eventType parameter set to eEvent2DEditor. The param0 parameter of KernelCADEvent is an integer with value one of EEditorEvent_KC:

ID Event Raised
eEditEventActivated The editor has been activated Always
eEditEventModelStructureChanged A new item aded to the 2D model or deleted If context boolean parameter 0 is true. See below
eEditEventItemStructureChanged Number of elements in an item has chanded. New element added or deleted If context boolean parameter 1 is true. See below
 eEditEventClosing The editor is about to be closed Always

For performance frequent events eEditEventModelStructureChanged and eEditEventItemStructureChanged are not raised by default. They have to be requested with:

Query IKCContext from I2DEditor_KC. Call IKCContex.SetBoolParam(0, true) to request eEditEventModelStructureChanged. Call IKCContex.SetBoolParam(1, true) to request eEditEventItemStructureChanged.