I am starting a new project (Windows application), which needs a simple graphical interface. The graphics are not the main point of the application, the algorithms behind them are, so I’d like to spend as little time as possible thinking about graphics.
I need to draw simple shapes, connect them with lines, and label both the shapes and the edges. My ideal API would look something like
n1 = Rectangle(width, height, center1);
n1->label("Node1");
n2 = Circle(radius, center2);
l = Line(n1->rightEdge()->midpoint()), (n2->center()-Point(n2->radius,0));
l->label("pathway",BELOW);
I know I could certainly use a low-level library to build up to this level of abstraction. But I’d rather not, if it has already been done. Does a graphics library with this level of abstraction exist? I’d be equally happy with C/C++. C# would be an option too.
Due to the general ease of writing that kind of high-level system, given a low-level drawing API, you generally don’t see this kind of 2D scene graph library. The kind where there are explicit objects in the scene, and you move the objects around on the level of objects.
The closest I can think of is the way WPF handles drawing, where you create graphics objects and attach them to windows. And that’s .NET only.
Everything else, whether Cairo, AGG, Direct2D, etc are all immediate drawing APIs. There are no “objects” that you manipulate or attach labels to. You simply draw stuff in a location. If you want to move something, you have to draw the stuff in that new location.