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.
|