#include "graph.h" void _F_grsteps::step3 (GRAPH_MODE, GR_NODE &node) { } void _F_grsteps::step4 (GRAPH_MODE, GR_NODE &node) { } void _F_grsteps::step5 (GRAPH_MODE, GR_NODE &node) { } void _F_grsteps::step6 (GRAPH_MODE, GR_NODE &node) { } void _F_grsteps::link1(GR_NODE &node1, GR_NODE &node2) { linkline (node1,ANCHOR_BOTTOM,node2,ANCHOR_TOP); } void _F_grsteps::link2(GR_NODE &node1, GR_NODE &node2) { linkline (node1,ANCHOR_BOTTOM,node2,ANCHOR_TOP); } void _F_grsteps::link3(GR_NODE &node1, GR_NODE &node2) { linkline (node1,ANCHOR_BOTTOM,node2,ANCHOR_TOP); } void _F_grsteps::link4(GR_NODE &node1, GR_NODE &node2) { linkline (node1,ANCHOR_BOTTOM,node2,ANCHOR_TOP); } void _F_grsteps::link5(GR_NODE &node1, GR_NODE &node2) { linkline (node1,ANCHOR_BOTTOM,node2,ANCHOR_TOP); } void grsteps (_F_grsteps &c, GRAPH_MODE mode, GR_NODE &node, bool centered) { node.width = node.height = node.depth = 0; node.margin.top = node.margin.right = node.margin.left = 0; node.margin.bottom = 0; GR_NODE tbnode[6]; for (int i=0; i<2; i++){ GRAPH_MODE emode = i==0 ? GR_EVAL : GR_DRAW; int x = node.x; int y = node.y; for (int j=0; j<6; j++){ GR_NODE *snode = tbnode + j; if (centered){ snode->x = x + (node.depth - snode->depth)/2; }else{ snode->x = x; } snode->y = y; switch (j){ case 0: c.step1(emode,*snode); break; case 1: c.step2(emode,*snode); break; case 2: c.step3(emode,*snode); break; case 3: c.step4(emode,*snode); break; case 4: c.step5(emode,*snode); break; case 5: c.step6(emode,*snode); break; } if (j==0){ node.left.x = snode->x; node.left.y = node.y + snode->width/2; } if (i==0){ if (snode->width != 0){ node.width += snode->width + 10; if (snode->depth > node.depth) node.depth = snode->depth; } } y += snode->width + 10; } if (mode == GR_EVAL){ break; }else if (emode == GR_DRAW){ for (int j=0; j<5; j++){ GR_NODE *ptn1 = tbnode + j; GR_NODE *ptn2 = ptn1 + 1; if (ptn1->width != 0 && ptn2->width != 0){ switch (j){ case 0: c.link1 (*ptn1,*ptn2); break; case 1: c.link2 (*ptn1,*ptn2); break; case 2: c.link3 (*ptn1,*ptn2); break; case 3: c.link4 (*ptn1,*ptn2); break; case 4: c.link5 (*ptn1,*ptn2); break; } } } } } }