Exemplo n.º 1
0
 internal EdgeLayout(GraphLayout graph, NodeLayout source, NodeLayout target, object edgeObject)
 {
     _graph        = graph;
     _edgeObject   = edgeObject;
     _source       = source;
     _target       = target;
     _graphVizEdge = CGraphLib.agedge(_graph.GraphVizGraph, source.GraphVizNode, target.GraphVizNode, null, true);
 }
Exemplo n.º 2
0
        internal NodeLayout CreateSubGraph(NodeLayout parent, object nodeObject)
        {
            _dirty = true;
            var n = new NodeLayout(parent, nodeObject, true);

            _objectToNodeMap.Add(nodeObject, n);
            return(n);
        }
Exemplo n.º 3
0
        internal EdgeLayout CreateEdge(NodeLayout source, NodeLayout target, object edgeObject)
        {
            _dirty = true;
            var e = new EdgeLayout(this, source, target, edgeObject);

            CGraphLib.agxset(e.GraphVizEdge, _edgeDirAttribute, "none");
            _objectToEdgeMap.Add(edgeObject, e);
            return(e);
        }
Exemplo n.º 4
0
        internal NodeLayout(NodeLayout parent, object nodeObject, bool isSubGraph = false)
        {
            _nodeObject = nodeObject;
            _isSubGraph = isSubGraph;
            _parentNode = parent;
            if (parent != null)
            {
                Debug.Assert(parent.IsSubGraph);
                _graph = parent.Graph;
                if (_isSubGraph)
                {
                    _graphVizSubGraph = CGraphLib.agsubg(parent.GraphVizSubGraph, "cluster" + (++SubGraphCounter), true);
                }
                else
                {
                    _graphVizSubGraph = parent.GraphVizSubGraph;
                }
                if (!_isSubGraph)
                {
                    _graphVizNode = CGraphLib.agnode(_graphVizSubGraph, null, true);
                }
                //else _graphVizNode = _graphVizSubGraph;

                /*if (_isSubGraph)
                 * {
                 *  CGraphLib.agxset(_graphVizNode, _graph._nodeWidthAttribute, "0");
                 *  CGraphLib.agxset(_graphVizNode, _graph._nodeHeightAttribute, "0");
                 *  CGraphLib.agxset(_graphVizNode, _graph._nodeStyleAttribute, "invis");
                 * }*/
            }
            else
            {
                _graph            = (GraphLayout)this;
                _graphVizSubGraph = CGraphLib.agopen(null, Agdesc_t.none, IntPtr.Zero);
                _graphVizNode     = CGraphLib.agnode(_graphVizSubGraph, null, true);
            }
        }