Hello Carsten,

 

I have slightly modified the DotFileGeneratorGraphOp class. Attached you
can find a patch. Could you please integrate the change in the
repository. The change does provide a little more information about name
attachments in the graph.

 

Best,

Johannes

 

P.S.: For the interested about this class, usage goes as follows on
windows...

 

Call somewhere ...

 

create_dot_file( node, 

    "d:/work/test_write.dot", 

    "max_node_children=10 no_name_attachments=true no_ranks=true",

    "ClipPlaneChunk,LightModelChunk",

    "");

 

... with little helper function ...

 

void create_dot_file(

    osg::Node* node, 

    const char* name, 

    const char* params, 

    const char* suppress_types,

    const char* suppress_derived_from_types)

{

    using namespace osg;

 

    GraphOpSeqRefPtr seq = GraphOpSeq::create();

    OSG::DotFileGeneratorGraphOpRefPtr go;

 

    go = DotFileGeneratorGraphOp::create();

 

    std::string param("filename=");

    go->setParams(param + name);

    if (params)

        go->setParams(params);

 

    typedef boost::char_separator<char>     SeparatorT;

    typedef boost::tokenizer< SeparatorT >  TokenizerT;

 

    SeparatorT sep(" \t,;:");

 

    if (suppress_types) {

        std::string str(suppress_types);

        TokenizerT tokenizer(str, sep);

        TokenizerT::iterator iter = tokenizer.begin();

        TokenizerT::iterator end  = tokenizer.end();

        for(; iter != end; ++iter) {

            std::string token = *iter;

            if (!token.empty()) {

                FieldContainerType* type =
FieldContainerFactory::the()->findType(token.c_str());

                go->insert(type);

            }

        }

    }

 

    if (suppress_derived_from_types) {

        std::string str(suppress_derived_from_types);

        TokenizerT tokenizer(str, sep);

        TokenizerT::iterator iter = tokenizer.begin();

        TokenizerT::iterator end  = tokenizer.end();

        for(; iter != end; ++iter) {

            std::string token = *iter;

            if (!token.empty()) {

                FieldContainerType* type =
FieldContainerFactory::the()->findType(token.c_str());

                go->insert(type, true);

            }

        }

    }

 

    seq->addGraphOp(go);

    seq->traverse(node);

}

 

... and finally process dot file from the command line

 

c:/utils/Graphviz/bin/dot.exe -T png d:/work/test_write.dot -o
d:/work/test_write.png

 

This operation is intended for small graphs. Otherwise the image will
contain too much information or the dot tool does not handle the input
file. However, for me it is nevertheless quite useful.

 

Attachment: OSGDotFileGeneratorGraphOp.cpp.dif
Description: OSGDotFileGeneratorGraphOp.cpp.dif

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to