MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / calcLayout

Method calcLayout

tools/monitor/NodeGenerator.cpp:41–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void
42Monitor::NodeGenerator::calcLayout(TreeNode *t, int w, int h)
43{
44 static int xpos = 0;
45 static int ypos = 0;
46
47 // reset width and height of scene
48 if (t == 0) {
49 return;
50 }
51
52 QString text;
53
54 if (isNodeValid(t, text)) {
55
56 xpos = w * 100;
57 ypos += 50;
58
59 // create nodes to figure out width and height of layout
60 Node node(text, xpos, ypos, t);
61 sceneWidth_ = xpos + node.boundingRect().width();
62 sceneHeight_ = ypos + node.boundingRect().width();
63
64 ++w;
65 for (int i = 0; i < t->size(); ++i) {
66 calcLayout(t->operator[](i), w, ++h);
67 }
68 }
69}
70
71void
72Monitor::NodeGenerator::findConnections(TreeNode * t)

Callers 1

updateNodeViewMethod · 0.80

Calls 4

widthMethod · 0.80
boundingRectMethod · 0.80
sizeMethod · 0.45
operator[]Method · 0.45

Tested by

no test coverage detected