There are a few easy steps that should be carried out to add support for rendering new objects:
Create a new class that will represent the renderable object. This should inherit from the GlSvgRenderable class.
Implement the render(bool) function. See the section on implementing the render function for further details on this.
In the GlSvgRenderer::createGlSvgGeometry(SugElement*, GlSvgGroup*) function, add code that will create an instance of your new class when the appropriate node is found in the Sugar Object hierarchy. Don't forget to set the new object's isStored flag at this point as well. You must set this flag because you only want a symbol rendered when it is requested, not on the actual symbol definition. You must also set the new object's renderer to the this pointer, and add the element to the current group being created. This should all be very clear if you look at the examples already coded up in the renderer.
At this point, your new object should be all ready to render to the screen when the appropriate SVG element is defined!
You must follow these two guidelines for your render function to operate correctly.
Call the GlSvgRenderable::applyTransforms() function before you call your drawing code. Every SVG element could have associated transformation definitions. The GlSvgRenderable::applyTransforms() function will check to see if it does, and apply the necessary transformations.
The render function has a single boolean parameter. This parameter indicates whether drawing should be forced or not. If this parameter is true, rendering should be done. If it is false, you should check the mIsStored member variable which indicates if the object defines a stored SVG element or not. If mIsStored is false, or the forceRender parameter is true, rendering should be done. In any other case, you should not render the object. This logic is necessary because SVG has the capability of storing elements for future reference via crosslinks. You don't want to render a stored object unless it referenced by the crosslink.