summaryrefslogtreecommitdiff
path: root/app/bin/tcornu.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/tcornu.c')
-rw-r--r--app/bin/tcornu.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/app/bin/tcornu.c b/app/bin/tcornu.c
index 9d9587a..2299fd8 100644
--- a/app/bin/tcornu.c
+++ b/app/bin/tcornu.c
@@ -294,7 +294,7 @@ static descData_t cornuDesc[] = {
/*C1*/ { DESC_POS, N_("Center X,Y"), &cornData.center[1] },
/*Z1*/ { DESC_DIM, N_("Z2"), &cornData.elev[1] },
/*RA*/ { DESC_DIM, N_("Minimum Radius"), &cornData.minRadius },
-/*RR*/ { DESC_DIM, N_("Maximum Rate Of Change Of Curvature"), &cornData.maxRateOfChange },
+/*RR*/ { DESC_FLOAT, N_("Max Rate Of Curve Change/Scale"), &cornData.maxRateOfChange },
/*WA*/ { DESC_ANGLE, N_("Total Winding Angle"), &cornData.windingAngle },
/*LN*/ { DESC_DIM, N_("Length"), &cornData.length },
/*GR*/ { DESC_FLOAT, N_("Grade"), &cornData.grade },
@@ -309,59 +309,76 @@ static void UpdateCornu( track_p trk, int inx, descData_p descUpd, BOOL_T final
EPINX_T ep;
cornuParm_t cp;
-
-
if ( inx == -1 )
return;
updateEndPts = FALSE;
+ UndrawNewTrack(trk);
switch ( inx ) {
case P0:
if (GetTrkEndTrk(trk,0)) break;
updateEndPts = TRUE;
xx->cornuData.pos[0] = cornData.pos[0];
+ Translate(&xx->cornuData.c[0],xx->cornuData.pos[0],xx->cornuData.a[0]+90,xx->cornuData.r[0]);
+ cornData.center[0] = xx->cornuData.c[0];
cornuDesc[P0].mode |= DESC_CHANGE;
+ cornuDesc[C0].mode |= DESC_CHANGE;
/* no break */
case P1:
if (GetTrkEndTrk(trk,1)) break;
updateEndPts = TRUE;
xx->cornuData.pos[1]= cornData.pos[1];
+ Translate(&xx->cornuData.c[1],xx->cornuData.pos[1],xx->cornuData.a[1]-90,xx->cornuData.r[1]);
+ cornData.center[1] = xx->cornuData.c[1];
cornuDesc[P1].mode |= DESC_CHANGE;
+ cornuDesc[C1].mode |= DESC_CHANGE;
break;
case A0:
if (GetTrkEndTrk(trk,0)) break;
updateEndPts = TRUE;
xx->cornuData.a[0] = cornData.angle[0];
+ Translate(&xx->cornuData.c[0],xx->cornuData.pos[0],xx->cornuData.a[0]+90,xx->cornuData.r[0]);
+ cornData.center[0] = xx->cornuData.c[0];
cornuDesc[A0].mode |= DESC_CHANGE;
+ cornuDesc[C0].mode |= DESC_CHANGE;
break;
case A1:
if (GetTrkEndTrk(trk,1)) break;
updateEndPts = TRUE;
xx->cornuData.a[1]= cornData.angle[1];
+ Translate(&xx->cornuData.c[1],xx->cornuData.pos[1],xx->cornuData.a[1]-90,xx->cornuData.r[1]);
+ cornData.center[1] = xx->cornuData.c[1];
cornuDesc[A1].mode |= DESC_CHANGE;
+ cornuDesc[C1].mode |= DESC_CHANGE;
break;
case C0:
if (GetTrkEndTrk(trk,0)) break;
- updateEndPts = TRUE;
- xx->cornuData.c[0] = cornData.center[0];
- cornuDesc[C0].mode |= DESC_CHANGE;
+ //updateEndPts = TRUE;
+ //xx->cornuData.c[0] = cornData.center[0];
+ //cornuDesc[C0].mode |= DESC_CHANGE;
break;
case C1:
if (GetTrkEndTrk(trk,1)) break;
- updateEndPts = TRUE;
- xx->cornuData.c[1] = cornData.center[1];
- cornuDesc[C1].mode |= DESC_CHANGE;
+ //updateEndPts = TRUE;
+ //xx->cornuData.c[1] = cornData.center[1];
+ //cornuDesc[C1].mode |= DESC_CHANGE;
break;
case R0:
if (GetTrkEndTrk(trk,0)) break;
updateEndPts = TRUE;
xx->cornuData.r[0] = cornData.radius[0];
+ Translate(&xx->cornuData.c[0],xx->cornuData.pos[0],NormalizeAngle(xx->cornuData.a[0]+90),xx->cornuData.r[0]);
+ cornData.center[0] = xx->cornuData.c[0];
cornuDesc[R0].mode |= DESC_CHANGE;
+ cornuDesc[C0].mode |= DESC_CHANGE;
break;
case R1:
if (GetTrkEndTrk(trk,1)) break;
updateEndPts = TRUE;
xx->cornuData.r[1]= cornData.radius[1];
+ Translate(&xx->cornuData.c[1],xx->cornuData.pos[1],NormalizeAngle(xx->cornuData.a[1]-90),xx->cornuData.r[1]);
+ cornData.center[1] = xx->cornuData.c[1];
cornuDesc[R1].mode |= DESC_CHANGE;
+ cornuDesc[C1].mode |= DESC_CHANGE;
break;
case Z0:
case Z1:
@@ -396,13 +413,11 @@ static void UpdateCornu( track_p trk, int inx, descData_p descUpd, BOOL_T final
}
}
- EPINX_T new_ep[2];
track_p ts[2];
ts[0] = GetTrkEndTrk(trk,0);
ts[1] = GetTrkEndTrk(trk,1);
SetUpCornuParmFromTracks(ts,&cp,xx);
- CallCornu(xx->cornuData.pos, tracks, new_ep, &xx->cornuData.arcSegs, &cp);
-
+ CallCornu(xx->cornuData.pos, tracks, NULL, &xx->cornuData.arcSegs, &cp);
//FixUpCornu(xx->bezierData.pos, xx, IsTrack(trk));
ComputeCornuBoundingBox(trk, xx);
@@ -427,7 +442,7 @@ static void DescribeCornu( track_p trk, char * str, CSIZE_T len )
cornData.length = xx->cornuData.length;
cornData.minRadius = xx->cornuData.minCurveRadius;
- cornData.maxRateOfChange = xx->cornuData.maxRateofChange;
+ cornData.maxRateOfChange = xx->cornuData.maxRateofChange*GetScaleRatio(GetLayoutCurScale());
cornData.windingAngle = xx->cornuData.windingAngle;
cornData.layerNumber = GetTrkLayer(trk);
cornData.pos[0] = xx->cornuData.pos[0];
@@ -459,8 +474,8 @@ static void DescribeCornu( track_p trk, char * str, CSIZE_T len )
cornuDesc[A0].mode = !trk0?0:DESC_RO;
cornuDesc[A1].mode = !trk1?0:DESC_RO;
- cornuDesc[C0].mode = !trk0?0:DESC_RO;
- cornuDesc[C1].mode = !trk1?0:DESC_RO;
+ cornuDesc[C0].mode = DESC_RO;
+ cornuDesc[C1].mode = DESC_RO;
cornuDesc[R0].mode = !trk0?0:DESC_RO;
cornuDesc[R1].mode = !trk1?0:DESC_RO;
cornuDesc[GR].mode = DESC_RO;