Page MenuHomePhabricator

Feedback contours in Interaction need to be re-implemented
Closed, ResolvedPublic


Problem exists in Livewire, Paintbrush and erase tool.

the feedback contour: in Liverwire the green thingy, paint /erase red lines before action is finished)

every time SetData() is called on a DataNode,
a new mapper is generated (costly!),

when updating the feedback contour, in the three cases above,
instead of updating the actual data, new feedback objects are genarated and then assigned the DataNode using ->SetData().

this has the effect that every tiny mouse movement a mapper is destroyed and a new one is again created.


instead of creating a new contour object and replacing the old one,
the actual contour should be modified, this way the mapper can stay the same,
thus speeding up rendering.

Event Timeline

An additional problem is the recreation of the contour model for every tiny mouse movement, although a simple position shift would be sufficient.

Replacing SetData() by using the ITK Modified flag wasn't successful, because with every new ContourModel a new pointer is used. The data in the FeedbackNode is therefore not adressed by the modification.

In order to get rid of SetData() it is necessary to perform changes directly on the contour model, which is referrenced in the datanode. The contour model provides a clear() method that could be helpful for this task.

User kleesiek has pushed new remote branch:


We created a test branch to investigate the impact of removing the unnecessary ContourModel recreations. A PaintBrushInteractionTool test was added and investigated with valgrind callgrind.

We found out, that our branch is 5 times faster in each mouse movement step (instruction fetch cost). Interestingly, the ->SetData() method didn't have a considerable impact.

It might be helpful to reimplement the FeedbackContour so that all contained methods work on a ContourModel reference and do not create ContourModel objects.

User heime has pushed new remote branch:


[1e53ae]: Merge branch 'bug-19106-feedbackcontour'

Merged commits:

2015-09-09 13:33:04 Eric Heim [1f7f6c]
cleaned paint tool

2015-09-02 17:10:17 Eric Heim [6835d1]
temporary fixed paint tool

2015-09-02 16:16:45 Eric Heim [cfc030]
removed temporary fix for 3m3

2015-09-02 16:13:38 Eric Heim [c28b1d]
changed feedbacktool setter to pointer