From Cory Riddell, "I've been using the dot plugin and found that our application which sets

the global locale was generating bad dot files. Specifically, the node
numbers had comma separators in them (like 1,234 rather than 1234).

The attached file simply forces the stringstreams used to build up the
dot file to use the "C" locale."
This commit is contained in:
Robert Osfield 2012-02-06 13:29:38 +00:00
parent 2298cc520c
commit ec08c4dfea

View File

@ -27,6 +27,12 @@ namespace osgDot {
BaseDotVisitor::BaseDotVisitor()
{
_rankdir = "rankdir = LR;";
// Set the locale used by the _nodes and _edges streams to the
// classic or "C" locale. This is needed because most of the
// Graphviz tools are not locale sensitive and get confused
// by id numbers containing commas or periods.
_nodes.imbue(std::locale("C"));
_edges.imbue(std::locale("C"));
}
BaseDotVisitor::~BaseDotVisitor() {