Ash
Ash

Reputation: 21

Updating of the ILNumerics surface graphics

I'm currently using an ILPlotCube object to display a surface which is generated from user data and I have created a context menu and added options to change some of the plot settings such as the colourmap, lighting etc. The problem I am having is getting the graphics of the plot to update automatically once a change has been made; as it stands the only way I can update the added lights or changed colourmap is by invoking one of the many mouse events on the plot object. I have searched through the ILPlotCube, ILSurface and ILScene classes and can not find any functionality which would seem to do this (I originally thought the Reset() method of the ILPlotCube class would do what was required but it actually does not). Does anybody have any more information about the updating of the graphics and possibly a potential solution?

Upvotes: 2

Views: 701

Answers (1)

Haymo Kutschbach
Haymo Kutschbach

Reputation: 3362

Mouse events on nodes in ILNumerics provide arguments of ILMouseEventArgs. The type provides the Refresh property. Set this to true in your mouse event handler. It will trigger a redraw after all events are processed:

void iILNode_MouseClick(object sender, ILMouseEventArgs e) {
    if (e.DirectionUp) {
        //modify scene here
        // .. 
        // trigger redraw of the scene
        e.Refresh = true; 
    }
}

The documentation on mouse event handling: http://ilnumerics.net/mouse-events.html

Upvotes: 1

Related Questions