Re: [osg-users] osgdot graph generation tool
Hi Richard, I have written an osgDot some time ago, maybe you can use it as a base for yours. It's designed as a plugin, contains the cmake makefiles and uses the visitor concept. Curious, is this a similar tool you wrote yourself, or is this my original tool completely restructured? It's hard to tell :) I created it based on your idea. Do you still have the source of your dot plugin? If so, could you submit it for inclusion into OSG? If there's any work needed before it's included, I volunteer to do it - you can send the source to me and I'll have a look at it. I think it's a very useful tool to be able to see the structure of your scene graph, and I would very much like it to be integrated. Let me know if you agree with this. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Jean-Sébastien Guay wrote: Hi Richard, I have written an osgDot some time ago, maybe you can use it as a base for yours. It's designed as a plugin, contains the cmake makefiles and uses the visitor concept. Curious, is this a similar tool you wrote yourself, or is this my original tool completely restructured? It's hard to tell :) I created it based on your idea. Do you still have the source of your dot plugin? If so, could you submit it for inclusion into OSG? If there's any work needed before it's included, I volunteer to do it - you can send the source to me and I'll have a look at it. I think it's a very useful tool to be able to see the structure of your scene graph, and I would very much like it to be integrated. Let me know if you agree with this. I think I saw Richard's submission come in on osg-submission today... Paul J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Hi again, Weird, I didn't get that message though I'm on osg-submissions... I also didn't get Richard's first message about osgdot the other day (the one where he said he had an osgdot that's a plugin with cmake files) - I only got the second one (where he said it was based on your idea)... Sure enough, I see the message on the archives. http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/3775 Really weird. In any case, the important thing is that it's submitted. Thanks Richard. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Hi Paul, I think I saw Richard's submission come in on osg-submission today... Weird, I didn't get that message though I'm on osg-submissions... I also didn't get Richard's first message about osgdot the other day (the one where he said he had an osgdot that's a plugin with cmake files) - I only got the second one (where he said it was based on your idea)... I don't use spam filtering locally, perhaps my mail host does, but why would it let one message pass and not the other? Weird... J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Jean-Sébastien Guay wrote: I wanted to see what the graph for a file looked like, and I remembered the osgdot tool that Paul Melis had made. I got it off Mike's osgtoy SVN, and I quickly did a few modifications which I'd like to recontribute. Mike, would you care to integrate my changes? * Uses second command line argument as output filename * Checks that there are exactly two command line arguments, prints usage if not * Gives count of vertices in addition to primitive sets (I'd like to add the detail of primitive types in the future - i.e. 60 triangles, 15 quad strips, etc.) * Fixed the casting pointer to unsigned int issue by using uintptr_t. Hopefully this is supported by all compilers and works on 64 bit machines, I don't have one to test on... I think it's a useful tool, and I'd really like to make it into an output plugin sometime, so it could be integrated into OSG proper. Too much stuff on my plate right now, but I'm keeping it in mind. Hey, that's very nice! I'm happy to see other people find this thingy useful (I knew I did ;-)) Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Schmidt, Richard wrote: I have written an osgDot some time ago, maybe you can use it as a base for yours. It's designed as a plugin, contains the cmake makefiles and uses the visitor concept. Curious, is this a similar tool you wrote yourself, or is this my original tool completely restructured? It's hard to tell :) Paul Richard Richard Schmidt System Designer EADS Deutschland GmbH Organisationseinheit (SDGE1) EADS Deutschland GmbH Registered Office: Ottobrunn District Court of Munich HRB107648 Chairman of the Supervisory Board: Dr. Thomas Enders Managing Directors: Dr. Stefan Zoller (chairman), Michael Hecht This E-mail And any attachment(s) to it are for the addressee's use only. It is strictly confidential and may contain legally privileged information. No confidentiality Or privilege is waived or lost by any mistransmission. If you are not the intended addressee, then please delete it from your system and notify the sender immediately. You are hereby notified that any use, disclosure, copying or any action taken in reliance on it is strictly prohibited and may be unlawful. - Thank you. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Thrall, Bryan Gesendet: Montag, 6. Oktober 2008 18:23 An: OpenSceneGraph Users Betreff: Re: [osg-users] osgdot graph generation tool Jean-Sébastien Guay wrote on Monday, October 06, 2008 10:19 AM: Hi Bryan, Another improvement I'd be interested in seeing applied is: http://sourceforge.net/tracker/index.php?func=detailaid=1866010group_id=139833atid=744686 Yes, I saw that, I just wanted to keep the modifications small w.r.t. Mike's version of osgdot.cpp in the osgtoy SVN. But I agree, doing that in a visitor is more in keeping with OSG's normal practices. If I make an output plugin out of this, I'll make it with a visitor, as then the modifications will be pretty large anyways. :-) I just didn't want my patch to be forgotten, and thought this was a good opportunity to bring it up :) I'm glad I'm not the only one who thinks this is a nifty tool and is working to improve it. Thanks! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Hi Paul I created it based on your idea. Richard Schmidt, Richard wrote: I have written an osgDot some time ago, maybe you can use it as a base for yours. It's designed as a plugin, contains the cmake makefiles and uses the visitor concept. Curious, is this a similar tool you wrote yourself, or is this my original tool completely restructured? It's hard to tell :) Paul Richard Richard Schmidt System Designer EADS Deutschland GmbH Organisationseinheit (SDGE1) EADS Deutschland GmbH Registered Office: Ottobrunn District Court of Munich HRB107648 Chairman of the Supervisory Board: Dr. Thomas Enders Managing Directors: Dr. Stefan Zoller (chairman), Michael Hecht This E-mail And any attachment(s) to it are for the addressee's use only. It is strictly confidential and may contain legally privileged information. No confidentiality Or privilege is waived or lost by any mistransmission. If you are not the intended addressee, then please delete it from your system and notify the sender immediately. You are hereby notified that any use, disclosure, copying or any action taken in reliance on it is strictly prohibited and may be unlawful. - Thank you. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Thrall, Bryan Gesendet: Montag, 6. Oktober 2008 18:23 An: OpenSceneGraph Users Betreff: Re: [osg-users] osgdot graph generation tool Jean-Sébastien Guay wrote on Monday, October 06, 2008 10:19 AM: Hi Bryan, Another improvement I'd be interested in seeing applied is: http://sourceforge.net/tracker/index.php?func=detailaid=1866010group_id=139833atid=744686 Yes, I saw that, I just wanted to keep the modifications small w.r.t. Mike's version of osgdot.cpp in the osgtoy SVN. But I agree, doing that in a visitor is more in keeping with OSG's normal practices. If I make an output plugin out of this, I'll make it with a visitor, as then the modifications will be pretty large anyways. :-) I just didn't want my patch to be forgotten, and thought this was a good opportunity to bring it up :) I'm glad I'm not the only one who thinks this is a nifty tool and is working to improve it. Thanks! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Jean-Sébastien Guay wrote on Monday, October 06, 2008 9:37 AM: Hi all, I wanted to see what the graph for a file looked like, and I remembered the osgdot tool that Paul Melis had made. I got it off Mike's osgtoy SVN, and I quickly did a few modifications which I'd like to recontribute. Mike, would you care to integrate my changes? * Uses second command line argument as output filename * Checks that there are exactly two command line arguments, prints usage if not * Gives count of vertices in addition to primitive sets (I'd like to add the detail of primitive types in the future - i.e. 60 triangles, 15 quad strips, etc.) * Fixed the casting pointer to unsigned int issue by using uintptr_t. Hopefully this is supported by all compilers and works on 64 bit machines, I don't have one to test on... I think it's a useful tool, and I'd really like to make it into an output plugin sometime, so it could be integrated into OSG proper. Too much stuff on my plate right now, but I'm keeping it in mind. Thanks, J-S Another improvement I'd be interested in seeing applied is: http://sourceforge.net/tracker/index.php?func=detailaid=1866010group_id=139833atid=744686 -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Hi Bryan, Another improvement I'd be interested in seeing applied is: http://sourceforge.net/tracker/index.php?func=detailaid=1866010group_id=139833atid=744686 Yes, I saw that, I just wanted to keep the modifications small w.r.t. Mike's version of osgdot.cpp in the osgtoy SVN. But I agree, doing that in a visitor is more in keeping with OSG's normal practices. If I make an output plugin out of this, I'll make it with a visitor, as then the modifications will be pretty large anyways. :-) J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Hi all, * Fixed the casting pointer to unsigned int issue by using uintptr_t. Hopefully this is supported by all compilers and works on 64 bit machines, I don't have one to test on... I had overlooked a few places where this was used. Now fixed. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ /* osgdot -- Output the relations between scenegraph nodes and drawables in graphviz's dot tool format. Paul E.C. Melis ([EMAIL PROTECTED]), November, 2007 This software is hereby placed in the public domain. Use in whichever way you see fit. HE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. This is a small tool that reads in a model file (in any format readable by OSG) and outputs a text file (graph.dot) that describes the connections between nodes and some other details. The text file is in a format that can be read by the dot tool from the graphviz package. With dot you can generate a picture representing the scenegraph. For example, to generate a PNG file from the graph.dot file use the command: dot -Tpng -ograph.png graph.dot * osgdot takes two arguments, the model file to read and the output filename * The graph will show nodes and drawable as boxes, labeled with their OSG class name. If the node/drawable's getName() method returned a non-empty string this will also be shown in the node (below the horizontal line). * Nodes are shown with a thick border, drawables with a thin border * Nodes or drawables that have a stateset assigned to them will be filled with a grey color. * Arrows between nodes/drawables indicate a parent - child relationship. Arrows from node to node are shown with a solid line, arrows from node to drawable with a dashed line. * For drawables of the class Geometry the number of primitive sets held by that object is shown below the horizontal line. The graphviz package can be found at http://www.graphviz.org/. Or check your Linux distro for the package. It is also available for Windows and MacOS. Compile (on Linux and using gcc) with: g++ -W -Wall -o osgdot osgdot.cpp -I osg-dir/include -L osg-dir/lib -losg -losgDB Version used during development: OSG 2.1.1, graphviz 2.12 */ #include cstdio #include string #include map #include osg/Node #include osg/Drawable #include osg/Geometry #include osg/Group #include osg/Geode #include osgDB/ReadFile class GraphNode { public: GraphNode(osg::Node *node) { char s[1024]; _node = node; mem_location = (uintptr_t) node; osg_class = node-className(); name = node-getName(); has_stateset = node-getStateSet() != NULL; sprintf(s, %s_%08x, osg_class.c_str(), mem_location); dot_id = std::string(s); type = node; extra_label = ; } GraphNode(osg::Drawable *drawable) { char s[1024]; _drawable = drawable; mem_location = (uintptr_t) drawable; osg_class = drawable-className(); name = drawable-getName(); has_stateset = drawable-getStateSet() != NULL; sprintf(s, %s_%08x, osg_class.c_str(), mem_location); dot_id = std::string(s); type = drawable; extra_label = ; extra_label2 = ; osg::Geometry* geometry = dynamic_castosg::Geometry*(drawable); if (geometry) { // include count of primitive sets sprintf(s, %d psets, geometry-getNumPrimitiveSets()); extra_label = std::string(s); // include count of vertices sprintf(s, %d vertices, geometry-getVertexArray()-getNumElements()); extra_label2 = std::string(s); } } void add_target(uintptr_t t) { target_mem_locations.push_back(t); } protected: osg::ref_ptrosg::Node _node; osg::ref_ptrosg::Drawable _drawable; public: uintptr_t mem_location; std::string osg_class; std::string name; std::string type; boolhas_stateset; std::string dot_id; std::string extra_label; std::string extra_label2; // stores nodes (mem locations) that this node references // (i.e. other nodes) std::vectoruintptr_t target_mem_locations; }; typedef std::mapuintptr_t, GraphNode*GraphNodeMap; void
Re: [osg-users] osgdot graph generation tool
Jean-Sébastien Guay wrote on Monday, October 06, 2008 10:19 AM: Hi Bryan, Another improvement I'd be interested in seeing applied is: http://sourceforge.net/tracker/index.php?func=detailaid=1866010group_id=139833atid=744686 Yes, I saw that, I just wanted to keep the modifications small w.r.t. Mike's version of osgdot.cpp in the osgtoy SVN. But I agree, doing that in a visitor is more in keeping with OSG's normal practices. If I make an output plugin out of this, I'll make it with a visitor, as then the modifications will be pretty large anyways. :-) I just didn't want my patch to be forgotten, and thought this was a good opportunity to bring it up :) I'm glad I'm not the only one who thinks this is a nifty tool and is working to improve it. Thanks! -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgdot graph generation tool
Hi Bryan, I just didn't want my patch to be forgotten, and thought this was a good opportunity to bring it up :) Don't worry, I often have trouble with my memory so I'm a big fan of searching the archives, and I spotted your messages on that thread. It's on my todo list :-) J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org