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 );
|
}
|
}
|
*]
|
}
|