- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/dot/SimpleDotVisitor.cpp
r12292 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 21 21 SimpleDotVisitor::~SimpleDotVisitor() { 22 22 } 23 23 24 24 void SimpleDotVisitor::handle(osg::Node& node, int id) { 25 25 std::stringstream label; … … 68 68 drawEdge( parentID, childID, "dashed" ); 69 69 } 70 70 71 71 void SimpleDotVisitor::handle(osg::Drawable& drawable, osg::StateSet& stateset, int parentID, int childID ) { 72 72 drawEdge( parentID, childID, "dashed" ); … … 75 75 void SimpleDotVisitor::drawNode( int id, const std::string& shape, const std::string& style, const std::string& label, const std::string& color, const std::string& fillColor ) { 76 76 _nodes << id << 77 "[shape=\"" << shape << 77 "[shape=\"" << shape << 78 78 "\" ,label=\"" << label << 79 79 "\" ,style=\"" << style << … … 82 82 "\"]" << std::endl; 83 83 } 84 84 85 85 void SimpleDotVisitor::drawEdge( int sourceId, int sinkId, const std::string& style ) { 86 86 _edges 87 << sourceId << ":top -> " 88 << sinkId << ":top [style=\"" 89 << style << "\"];" 87 << sourceId << ":top -> " 88 << sinkId << ":top [style=\"" 89 << style << "\"];" 90 90 << std::endl; 91 91 }
