Drawing3d documented Class Library

IEvents Interface

The interface IEvents encapsulates mouse- and keyevents. Additionally it has an EventServer

For a list of all members of this type, see IEvents Members .

[Visual Basic]
Public Interface IEvents
[C#]
public interface IEvents

Types that implement IEvents

Type Description
ActiveCtrl The ActiveCtrl inherits from DrawCtrl. It holds properties and methods to implement interactive manipulations of graphical datas.
With the Mouse- and Keyevents you have an instrument to handle actions of an user. By a click you get information about the tag, which is set as parameter to these methods.
...
protected override void draw(MNDevice device)
    { 
    ...
        ctrlMarker(new xyz(4, 4, 0), 2006);
        // draws a marker at position (4 / 4/ 0)
        // if the mouse moves over this marker, it will be highlighted with 
        //hovercolor
        ctrlMarker(new xyz(0, 4, 0), 2007);
        ctrlMarker(new xyz(0, 0, 0), 2008);
        
    ...
        
    }

protected override void MouseMove( System.Windows.Forms.MouseEventArgs e)
    {
    if (CurrentHit!=null)
     switch ((int)CurrentHit.Tag)
     {
        case 2006 :// Mouse is at Marker  4/ 4/ 0 
                    break;
        case 2007 :// Mouse is at Marker  0/ 4/ 0 
                    break;
        case 2008 :// Mouse is at Marker  0/ 0/ 0 
                    break;
     }
    }
...
Cursor3d The class can be used to get interactively some 3D-cordinates. The Cursor3d catches the mouse position and calculates the nearest point to the cordinate axes, which is associated to the Base. This point you get from the Posxyz-property.
With the Position-property you set the Base.BaseO.
TaskCtrl The class TaskCtrl is specially made for bigger interactive actions. He inherits from ActiveCtrl and has additionally two important parts: The taskhandling with StateBusy and Terminate
. The Undo-Redo-handling: Most of them is static. So CommitList, RedoListMaxCommitUnDoReDoLastCommit Only Commit are not static and the virtual Undo- and Redo-methods, which are called from the static ones.
The handling is easier as it seems to be.
1. You have to override GetUndoData and GetRedoData
2. Override UnDo and ReDo
3. You have to call "Commit" at several points in your code.
In GetUndoData you return the data that you need in Undo.
The correspondence is given by an id.

Requirements

Namespace: Drawing3d

Assembly: Drawing3d (in Drawing3d.dll)

See Also

IEvents Members | Drawing3d Namespace