Skip to content

Instantly share code, notes, and snippets.

@mdornseif
Last active September 3, 2019 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdornseif/3b3764844cae2f6274726674a9c68a0f to your computer and use it in GitHub Desktop.
Save mdornseif/3b3764844cae2f6274726674a9c68a0f to your computer and use it in GitHub Desktop.
Make Therion honor Station Flags and display Station Comments
diff --git i/thexpmap.cxx w/thexpmap.cxx
index 118323a..f41f165 100644
--- i/thexpmap.cxx
+++ w/thexpmap.cxx
@@ -2756,7 +2756,7 @@ thexpmap_xmps thexpmap::export_mp(thexpmapmpxs * out, class thscrap * scrap,
thexpmat_station_type_export_mp(TT_DATAMARK_PAINTED,SYMP_STATION_PAINTED)
}
flagexp = false;
-#define thexpmatselected_stationflag(flag,mid) if (((slp->station->flags & flag) == flag) && out->symset->is_assigned(mid)) flagexp = true;
+#define thexpmatselected_stationflag(flag,mid) if (((slp->station->flags & flag) == flag)) flagexp = true;
thexpmatselected_stationflag(TT_STATIONFLAG_ENTRANCE, SYMP_FLAG_ENTRANCE)
thexpmatselected_stationflag(TT_STATIONFLAG_SINK, SYMP_FLAG_SINK)
thexpmatselected_stationflag(TT_STATIONFLAG_SPRING, SYMP_FLAG_SPRING)
@@ -2783,12 +2783,12 @@ thexpmap_xmps thexpmap::export_mp(thexpmapmpxs * out, class thscrap * scrap,
this->db->db1d.m_station_attr.export_mp_object_begin(out->file, slp->station_name.id);
slp->station->export_mp_flags(out->file);
out->symset->export_mp_symbol_options(out->file, macroid);
- fprintf(out->file,"p_station((%.2f,%.2f),%d,%s,\"\"",
+ fprintf(out->file,"p_station((%.2f,%.2f),%d,%s) \"\"",
thxmmxst(out, slp->stx, slp->sty),
out->symset->is_assigned(macroid) ? slp->station->mark : 0,
commentstr.c_str()
);
-#define thexpmat_stationflag(flag,mid,str) if (((slp->station->flags & flag) == flag) && out->symset->is_assigned(mid)) fprintf(out->file,",\"%s\"", str);
+#define thexpmat_stationflag(flag,mid,str) if (((slp->station->flags & flag) == flag)) fprintf(out->file,",\"%s\"", str);
thexpmat_stationflag(TT_STATIONFLAG_ENTRANCE, SYMP_FLAG_ENTRANCE, "entrance")
thexpmat_stationflag(TT_STATIONFLAG_SINK, SYMP_FLAG_SINK, "sink")
thexpmat_stationflag(TT_STATIONFLAG_SPRING, SYMP_FLAG_SPRING, "spring")
@@ -2800,7 +2800,7 @@ thexpmap_xmps thexpmap::export_mp(thexpmapmpxs * out, class thscrap * scrap,
thexpmat_stationflag(TT_STATIONFLAG_AIRDRAUGHT, SYMP_FLAG_AIRDRAUGHT, "air-draught")
thexpmat_stationflag(TT_STATIONFLAG_AIRDRAUGHT_SUMMER, SYMP_FLAG_AIRDRAUGHT, "air-draught:summer")
thexpmat_stationflag(TT_STATIONFLAG_AIRDRAUGHT_WINTER, SYMP_FLAG_AIRDRAUGHT, "air-draught:winter")
- fprintf(out->file,");\n");
+ fprintf(out->file,";\n");
this->db->db1d.m_station_attr.export_mp_object_end(out->file, slp->station_name.id);
if (out->layout->is_debug_stationnames() && (slp->station_name.id != 0)) {
tmps = &(thdb.db1d.station_vec[slp->station_name.id - 1]);
layout l_topo # Schwarzpläne etc
symbol-show point station:natural
symbol-show group surface-centreline
symbol-show group centreline
code metapost
def p_station(expr pos,mark,txt) text flags =
p_station_SKBB(pos,mark,txt) (flags);
% thdraw (0,0) withpen PenX withcolor red;
enddef;
endcode
endlayout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment