Scenegraph (pre)rendering changes

I’ve just finished the cleanup on the scenegraph (pre)rendering. I’ve changed the following things:

  • renamed ViewState to ShaderState
  • renamed ViewStack to ShaderStateStack and modified it to be a subclass of java.util.Stack
  • renamed RenderFrame to FrameAtomsCollector and cleaned it up
  • moved all rendering code from the View to Renderer
  • cleaned up Renderer: renamed getRenderFrame() to collectAtoms(), renamed and splitted renderNode() to collectXXXAtoms()

Please refer to this posting for my reasons or ask me, if anything is not clear.

I thing the code is new much cleaner und easier to understand, ‘cause the classes’ and method names actually tell you what they stand for and do.

I have now a quite deep understanding of this part of the rendering code. Tomorrow I’ll look through the opengl rendering part and see what can be optimized.

Marvin

EDIT: btw. It took me about three hours of strange I-tell-you-nothing-stack-overflow-exceptions to figure out, why the HUD was broken. It was due to the recent BranchGroup related changes. WidgetContainers all implement a method called getGroup(). The HUD class implements WidgetContainer and extends Foreground. So there was a call getGroup().addChild(transformGroup); which now added the TransofrmGroup to itself. I’ve added a check to the addChild() method of the Group class to catch this. It would have been nice, if you checked, if your changes didn’t break anything, Amos. But hey, could have happened to me :wink:

Sorry sorry sorry sorry and sorry again. I know how painful it is to have things broken by changes of another Dev (well happened with some of your changes, dude :slight_smile: ). How surprising that there wasn’t a check in Group for addChild() when added to itself…