Feature selection box in Goal Model view does not show all the features or crashes

Issue #410 new
Berk Duran created an issue

Create a concern (or use AA.core attached) with a root feature that has at least 6 features as its children. Add a children to one of the features at the first level. Save the feature model and create a goal model. In the feature selection box at the bottom right corner, expand the root feature and expand the child of the root that has its own children. Notice some of the features are not shown in the resultant feature selection box.

Use TC.core attached which has 80 features and a depth of 4, create a goal model. In the feature selection box at the bottom right corner, expand the root feature and expand F1, F6 and newChild10 sequentially. Notice the following exception:

Exception in thread "Animation Thread" java.lang.RuntimeException: java.lang.RuntimeException: Too many calls to pushMatrix().
    at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
    at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
    at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
    at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
    at javax.media.opengl.Threading.invoke(Threading.java:191)
    at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
    at processing.opengl.PJOGL.requestDraw(PJOGL.java:688)
    at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1651)
    at processing.core.PApplet.run(PApplet.java:2256)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Too many calls to pushMatrix().
    at processing.opengl.PGraphicsOpenGL.pushMatrix(PGraphicsOpenGL.java:3798)
    at org.mt4j.components.MTComponent.preDraw(MTComponent.java:1706)
    at org.mt4j.components.visibleComponents.AbstractVisibleComponent.preDraw(AbstractVisibleComponent.java:105)
    at org.mt4j.components.MTCanvas.drawUpdateRecursive(MTCanvas.java:406)
    at org.mt4j.components.MTCanvas.drawUpdateRecursive(MTCanvas.java:430)

Comments (3)

  1. Matthias Schoettle

    It seems that this is caused by a limit of the matrix stack depth. It is fixed to 32 in Processing. The recursiveness of the expandable list seems to reach that limit once the 4th or 5th level is expanded.

    The bug still remains but the feature container will be flattened. See #416.

  2. Matthias Schoettle

    Given the concern SEER provided by Jörg, when opening the Goal Increase Awareness, and then in the feature container expanding SEER -> Knowledge Management -> Data Management -> Data Creation. Upon selecting the last one, it crashes.

    I noticed that the expandable component created in ImpactFeatureNamer line 126 has a depth of 29. When drawing it's children the matrix stack depth is reached causing the error.

    In MTCanvas.drawUpdateRecursive the process can be summarized into this for each component c

    1. c.preDraw()
    2. c.drawComponent()
    3. c.postDraw()
    4. for all children c_i of c, recursively call drawUpdateRecursive(c_i)
    5. c.postDrawChildren()

    What happens is that preDraw calls pushMatrix and postDrawChildren calls popMatrix. As you can see, this means that if hierarchy of children is very deep, this causes the matrix stack to exceed its limit.

    I am wondering if popMatrix could be called in postDraw instead...

    See explanations here about this topic: https://forum.processing.org/two/discussion/5022/understanding-the-concept-of-a-matrix-stack

  3. Matthias Schoettle

    The answer to above idea is unfortunately no. Since the matrix stack depth is a constant, it cannot be changed easily as well. But I believe it's still possible by providing our own implementation of PGraphicsOpenGL.

  4. Log in to comment