The basic class hierarchy of libsugar-gl closely mimics the class hierarchy of libsugar, with a few important exceptions. Some of the classes in libsugar-gl have been generalized to cover multiple SVG elements. This has the affect of stripping away unnecessary information to streamline OpenGL rendering process. For example, the Sugar grouping objects (SugGroupElement, SugDefsElement, SugSymbolElement), are all generalized into a single class in libsugar-gl: GlSvgGroup. Likewise; SugRectElement, SugPathElement, SugPolygon, and SugPolyline are generalized into the GlSvgGeometry class.
The rest of libsugar-gl's architecture is straightforward. All the source files that make up the renderable hierarchy for libsugar-gl can be found in the sugar/src/libsugar-gl/renderer directory.
The workhorse of libsugar-gl is GlSvgRenderer, which takes a Sugar object hierarchy and translates it into the rendering hierarchy. It also provides functions to render the hierarchy (obviously), as well as functions to retrieve global information about the SVG document.
The objects contained in this hierarchy represent the "OpenGL-ized" SVG element. These objects are responsible for the accurate rendering of the element they represent. There are a few utility classes, namely GlSvgOutline and GlSvgOutlinePoint which aid in the rendering of these objects.
All objects created by GlSvgRenderer inherit from the GlSvgRenderable class. This class implements some high level functionality needed by every renderable object, but its main purpose is to facilitate the homogenous storage of renderable objects.
Unlike the objects in the Sugar hierarchy, not all the renderable objects can have children. Only GlSvgGroup objects are capable of having children. In fact, there is no concept of siblings or parents in the renderable object hierarchy. These relationships are not needed, as a simple in-order traversal of the object tree is sufficient to render the SVG document in OpenGL.