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 





  • 相关阅读:
    【学习】CodeUi
    【C#】权限修饰符
    链表_初步认识
    关于mysql8.0及以上版本连接navicat时候报错(密码加密方式需要修改)
    docker 运行mysql最新版本用navicat连接报错:1251
    spring5的基本组成(6个模块)
    关于java中设计原则总结(7)
    java中String中的endsWith()方法
    mysql中基本的语句
    mysql中索引类型
  • 原文地址:https://www.cnblogs.com/dydx/p/4236159.html
Copyright © 2011-2022 走看看