zoukankan      html  css  js  c++  java
  • 7月23日

    搞清楚平面布局类的各个参数

    orthoLayout

    此类的getBoundingBox()函数可以返回包围盒

    separationcOverhangoptionsmargin结果
    200.4
    00
    myGraph.png 

    10.400myGraph(1).png 

    可见separation控制线之间的距离

    此值不能是0

    20 
    1000myGraph(3).png 
    cOverhang似乎没什么影响,但是它的值也不能是0
    200.40100myGraph(4).png 
    margin对结果没有什么影响

    当结果有多个连通分量时,margin控制不同连通分量之间的距离
    200.410myGraph(5).png 

    200.420myGraph(6).png 
    发生了一些变化,但不知道有什么意义
    200.440myGraph(7).png 
    发生了一些变化,但不知道
    有什么意义


    一些参数的意义

    pageRatio 放置不同的连通分量时,最终结果的要求宽高比,一般为1

    margin 当结果有多个连通分量时,控制不同连通分量之间的距离


    布局聚类图的代码


    ClusterGraph   CG(G);

    SList<node>     c1List, c2List, c3List;

    for (int i = 0; i < nNodes/3; ++i)

    c1List.pushBack(nodeArray[i]);

    for (int i = nNodes/3; i < nNodes/3*2; ++i)

    c2List.pushBack(nodeArray[i]);

    for (int i = nNodes/3*2; i < nNodes; ++i)

    c3List.pushBack(nodeArray[i]);

    cluster c1 = CG.createCluster(c1List);

    cluster c2 = CG.createCluster(c2List);

    cluster c3 = CG.createCluster(c3List);

    ClusterGraphAttributes   CGA(CG, 

    ClusterGraphAttributes::nodeId|

    ClusterGraphAttributes::nodeGraphics|

    ClusterGraphAttributes::edgeGraphics);

    CGA.setAllWidth(20);

    CGA.setAllHeight(20);

    CGA.clusterLineWidth(c1) = 5;

    CGA.clusterLineWidth(c2) = 5;

    CGA.clusterLineWidth(c3) = 5;


    ClusterPlanarizationLayout cpl;

    ClusterOrthoLayout* col = new ClusterOrthoLayout;

    col->separation(10);

    col->margin(30);

    cpl.setPlanarLayouter(col);

    cpl.call (G, CGA, CG,false);

    结果如下:

    myGraph(8).png 





  • 相关阅读:
    列举面向对象中的特殊成员以及应用场景
    python中os和sys模块
    谈谈你对闭包的理解?
    Python面试题(练习一)
    logging模块的作用以及应用场景
    Python的垃圾回收机制
    Python的深浅copy
    rust 支持的CPU架构
    Rust 数据类型
    网站用https访问的问题
  • 原文地址:https://www.cnblogs.com/dydx/p/4236159.html
Copyright © 2011-2022 走看看