summaryrefslogtreecommitdiff
path: root/app/bin/tease.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:55:58 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:55:58 +0100
commitd1a8285f818eb7e5c3d6a05709ea21a808490b8c (patch)
tree326578f0505cbed07cfe60de530022822dc237ac /app/bin/tease.c
parent16e9630b79f0a7a90c6cedb6781175bb8b337dc1 (diff)
New upstream version 5.1.0upstream/5.1.0
Diffstat (limited to 'app/bin/tease.c')
-rw-r--r--app/bin/tease.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/app/bin/tease.c b/app/bin/tease.c
index 3667fe1..ad281df 100644
--- a/app/bin/tease.c
+++ b/app/bin/tease.c
@@ -1,8 +1,5 @@
-/*
- * $Header: /home/dmarkle/xtrkcad-fork-cvs/xtrkcad/app/bin/tease.c,v 1.2 2008-01-20 23:29:15 mni77 Exp $
- *
+/** \file tease.c
* TRANSISTION-CURVES (JOINTS)
- *
*/
/* XTrkCad - Model Railroad CAD
@@ -63,12 +60,20 @@ For a better representation of this, build 'testjoin' and
do 'testjoin psplot 10 10 40 1 | lpr -Ppostscript'
*/
+#include <math.h>
-#include "track.h"
#include "ccurve.h"
+#include "cselect.h"
#include "cstraigh.h"
#include "cjoin.h"
+#include "cundo.h"
+#include "fileio.h"
#include "i18n.h"
+#include "layout.h"
+#include "messages.h"
+#include "param.h"
+#include "track.h"
+#include "utility.h"
static TRKTYP_T T_EASEMENT = -1;
@@ -404,7 +409,7 @@ static track_p NewJoint(
static coOrd qZero = { 0.0, 0.0 };
ANGLE_T az0, a01, b, b01, b1, d, d1;
trk = NewTrack( 0, T_EASEMENT, 2, sizeof *xx );
- SetTrkScale( trk, curScaleInx );
+ SetTrkScale( trk, GetLayoutCurScale() );
xx = GetTrkExtraData( trk );
SetTrkEndPoint( trk, 0, pos0, NormalizeAngle(angle0+180.0) );
SetTrkEndPoint( trk, 1, pos1, NormalizeAngle(angle1+180.0) );
@@ -491,15 +496,15 @@ static struct {
DIST_T l1;
FLOAT_T grade;
descPivot_t pivot;
- LAYER_T layerNumber;
+ unsigned int layerNumber;
} jointData;
typedef enum { E0, Z0, E1, Z1, OR, AL, RR, LL, L0, L1, GR, PV, LY } jointDesc_e;
static descData_t jointDesc[] = {
-/*E0*/ { DESC_POS, N_("End Pt 1: X"), &jointData.endPt[0] },
+/*E0*/ { DESC_POS, N_("End Pt 1: X,Y"), &jointData.endPt[0] },
/*Z0*/ { DESC_DIM, N_("Z"), &jointData.elev[0] },
-/*E1*/ { DESC_POS, N_("End Pt 2: X"), &jointData.endPt[1] },
+/*E1*/ { DESC_POS, N_("End Pt 2: X,Y"), &jointData.endPt[1] },
/*Z1*/ { DESC_DIM, N_("Z"), &jointData.elev[1] },
-/*OR*/ { DESC_POS, N_("Origin: X"), &jointData.orig },
+/*OR*/ { DESC_POS, N_("Origin: X,Y"), &jointData.orig },
/*AL*/ { DESC_ANGLE, N_("Angle"), &jointData.angle },
/*RR*/ { DESC_DIM, N_("R"), &jointData.r },
/*LL*/ { DESC_DIM, N_("L"), &jointData.l },
@@ -1289,7 +1294,7 @@ static BOOL_T MergeJoint(
static BOOL_T GetParamsJoint( int inx, track_p trk, coOrd pos, trackParams_t * params )
{
params->type = curveTypeStraight;
- params->ep = PickUnconnectedEndPoint( pos, trk );
+ params->ep = PickUnconnectedEndPointSilent( pos, trk );
if (params->ep == -1)
return FALSE;
params->lineOrig = GetTrkEndPos(trk,params->ep);
@@ -1516,8 +1521,11 @@ EXPORT void JointSegProc(
else
data->traverse1.dist = JoinD( segPtr->u.j.l1, segPtr->u.j.R, segPtr->u.j.L ) + JoinD( l, segPtr->u.j.R, segPtr->u.j.L );
}
- if ( segPtr->u.j.flip )
+ data->traverse1.reverse_seg = FALSE;
+ if ( segPtr->u.j.flip ) {
data->traverse1.backwards = !data->traverse1.backwards;
+ data->traverse1.reverse_seg = TRUE;
+ }
LOG( log_traverseJoint, 1, ( "TJ0: ?[%0.3f %0.3f] A=%0.3f l=%0.3f J[%0.3f %0.3f] A=%0.3f l0=%0.3f l1=%0.3f R=%0.3f L=%0.3f N:%d F:%d S:%d = a=%0.3f D=%0.3f B=%d\n",
data->traverse1.pos.x, data->traverse1.pos.y, data->traverse1.angle,
l,
@@ -1525,6 +1533,9 @@ LOG( log_traverseJoint, 1, ( "TJ0: ?[%0.3f %0.3f] A=%0.3f l=%0.3f J[%0.3f %0.3f]
segPtr->u.j.l0, segPtr->u.j.l1, segPtr->u.j.R, segPtr->u.j.L,
segPtr->u.j.negate, segPtr->u.j.flip, segPtr->u.j.Scurve,
a, data->traverse1.dist, data->traverse1.backwards ) );
+ data->traverse1.negative = FALSE;
+ data->traverse1.BezSegInx = 0;
+ data->traverse1.segs_backwards = FALSE;
break;
case SEGPROC_TRAVERSE2:
@@ -1632,6 +1643,7 @@ LOG( log_traverseJoint, 1, ( "TJ0: ?[%0.3f %0.3f] A=%0.3f l=%0.3f J[%0.3f %0.3f]
}
}
data->getAngle.angle = a;
+ data->getAngle.radius = 0.0;
break;
}
}