陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Quintiq file version 2.0
#parent: #root
Method PopulateXPosition (
  shadow[SCVNode] root
) id:Method_FormSupplyChainVisualization_PopulateXPosition
{
  #keys: '[132894.0.868223396]'
  Body:
  [*
    // Go to all child nodes and populate their position
    // We know the depth of the node, so depending if they
    // are upstream or downstream, their X pos are just
    // OffsetX * depth, to the left or to the right of the root
    scvconfig := DataHolderSCVConfiguration.Data();
    
    traverse( scvconfig, SCVNode, node )
    {
      offset := node.Depth() * scvconfig.OffsetX();
      if( node.IsUpstream() )
      {
        // Upstream to the left of root
        node.X( root.X() - offset );
      }
      else
      {
        // Downstream to the right of root
        node.X( root.X() + offset );
      } 
    }
  *]
}