Quintiq file version 2.0 
 | 
#parent: #root 
 | 
FunctionOverride CalcToAndFrom 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Calculate initial and final point 
 | 
    x0 := 0; 
 | 
    x1 := 0; 
 | 
    y0 := 0; 
 | 
    y1 := 0; 
 | 
     
 | 
    rcv := this.RoutingConfiguratorView(); 
 | 
    if( not isnull( rcv ) ) 
 | 
    { 
 | 
      xmid := [Number](rcv.OperationInputOutputWidth() / 2); 
 | 
     
 | 
      fromop := this.OperationOutput(); 
 | 
      toop := this.OperationInput(); 
 | 
     
 | 
      if( not isnull( toop ) and not isnull( fromop ) ) 
 | 
      { 
 | 
        x0 := fromop.X() + xmid; 
 | 
        y0 := fromop.Y() + rcv.OperationInputOutputHeight(); 
 | 
        x1 := toop.X() + xmid; 
 | 
        y1 := toop.Y(); 
 | 
     
 | 
        if( toop.IsElementOfInputGroup() ) 
 | 
        { 
 | 
          xminimid := [Number](toop.MinWidth() / 2); 
 | 
     
 | 
          // Taken care of by the If-stmt. No need to guard for null operation input group. 
 | 
          x1 := toop.MinX() + xminimid; 
 | 
          y1 := toop.OperationInputGroup().Y(); 
 | 
        } 
 | 
     
 | 
     
 | 
      } 
 | 
    } 
 | 
     
 | 
    // Set 
 | 
    this.FromX( x0 ); 
 | 
    this.FromY( y0 ); 
 | 
    this.ToX( x1 ); 
 | 
    this.ToY( y1 ); 
 | 
  *] 
 | 
} 
 |