Hi All I've been trying to understand symbol-show and symbol-hide a little better as they relate to pdf outputs. How do I display the text associated with fixed points? I have some map objects defined for various caves in a large system. These are comprised of scrap drawings. I also have a map object with the minor surface features nearby, such as sinks, dolines, isolated entrances and significant navigational features such as fence posts or trees (for example). This is comprised of a survey only (mostly fixed points, and no scrap drawings) however and uses flags such as doline or sink, and most points have a text string associated ie. fix 15 2521640 6042938 581 10 10 30 station 15 "Concrete water trough" I would like to show the caves as outlines with all the rest of their symbology turned off, and the surface features with each of the points labelled with appropriate symbol and associated text. This is for an area map, at scales of say 1:5000 or 1:10,000 I can turn the cave symbols off with symbol-hide statements, and so far I think that is working out OK. However. -layout-symbol-show point flag:entrance \ -layout-symbol-show point flag:sink \ -layout-symbol-show point flag:spring \ -layout-symbol-show point flag:doline \ -layout-symbol-show point flag:dig \ The above layout statements cause the special entrance and sink etc symbols to be displayed, AND show the text string associated with the point. These are not displayed by default as far as I can tell, but these statements rectify that. -layout-symbol-show group all And the group all statement has pretty much the same effect in a more comprehensive and compact format. However none of the above enables me to display the text for my "Concrete water trough" example above. It is always just a cross with no text, or with '15' if debug station-names is on. It shows up in Loch, but not in pdfs. So, how do I display the text associated with fixed points? Is there a need for. -layout-symbol-show point fixed . or something similar? Also, sometimes I would like to display the point symbols (for the likes of the above flags) OR the text strings associated with the points, but not both at once. Is there a way of doing this? Thanks Bruce
Well, it is quite complicated, but it is possible. When point symbol is exported from centerline, system _text attribute is set in metapost. To dipsplay label, use code code metapost def p_continuation(expr pos,theta,sc,al) = etc... shown in: http://therion.speleo.sk/samples.doc/60.html But you will need to redefine corresponding symbol (e.g. p_sink). In that code, you can also control, whether symbol and/or text should be displayed. Feel free to ask more, if this does not help you. Regards, S. On 7 February 2011 21:10, Bruce <dangle@tomo.co.nz> wrote:
Hi All
I’ve been trying to understand symbol-show and symbol-hide a little better as they relate to pdf outputs. How do I display the text associated with fixed points?
I have some map objects defined for various caves in a large system. These are comprised of scrap drawings.
I also have a map object with the minor surface features nearby, such as sinks, dolines, isolated entrances and significant navigational features such as fence posts or trees (for example). This is comprised of a survey only (mostly fixed points, and no scrap drawings) however and uses flags such as doline or sink, and most points have a text string associated ie.
fix 15 2521640 6042938 581 10 10 30
station 15 "Concrete water trough"
I would like to show the caves as outlines with all the rest of their symbology turned off, and the surface features with each of the points labelled with appropriate symbol and associated text. This is for an area map, at scales of say 1:5000 or 1:10,000
I can turn the cave symbols off with symbol-hide statements, and so far I think that is working out OK.
However…
-layout-symbol-show point flag:entrance \
-layout-symbol-show point flag:sink \
-layout-symbol-show point flag:spring \
-layout-symbol-show point flag:doline \
-layout-symbol-show point flag:dig \
The above layout statements cause the special entrance and sink etc symbols to be displayed, AND show the text string associated with the point. These are not displayed by default as far as I can tell, but these statements rectify that.
-layout-symbol-show group all
And the group all statement has pretty much the same effect in a more comprehensive and compact format.
However none of the above enables me to display the text for my “Concrete water trough” example above.
It is always just a cross with no text, or with ‘15’ if debug station-names is on. It shows up in Loch, but not in pdfs.
So, how do I display the text associated with fixed points?
Is there a need for…
-layout-symbol-show point fixed
… or something similar?
Also, sometimes I would like to display the point symbols (for the likes of the above flags) OR the text strings associated with the points, but not both at once. Is there a way of doing this?
Thanks
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Thanks Stacho I think you are pointing me in the direction of answering my second question; redefinition of each type of point that I might be interested in. ie p_sink, p_doline, p_entrance. (Admittedly I have not delved into the code to see how it currently works, and I should perhaps educate myself some more before asking.) Some of my points would have all three (or more) flags set (sink, doline, entrance). Are they just layered one above the other in the output? So there may be three copies of the (identical) text layered one above the other if each definition included printing of the text? When I have time I can look into the TMPDIR outputs and perhaps figure it out. Anyway I digress. My most pressing need and interest is (the first question in my original post) adding the text output to fixed points that do not have any other flags set. The ones that show up in Loch as red circles that do not have doline or other flag set, but do not show up with labels included in the pdf output. Is there a p_fixed? Thanks Bruce _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Thursday, 10 February 2011 10:48 p.m. To: List for Therion users Subject: Re: [Therion] symbol-show fixed points Well, it is quite complicated, but it is possible. When point symbol is exported from centerline, system _text attribute is set in metapost. To dipsplay label, use code code metapost def p_continuation(expr pos,theta,sc,al) = etc... shown in: http://therion.speleo.sk/samples.doc/60.html But you will need to redefine corresponding symbol (e.g. p_sink). In that code, you can also control, whether symbol and/or text should be displayed. Feel free to ask more, if this does not help you. Regards, S. On 7 February 2011 21:10, Bruce <dangle@tomo.co.nz> wrote: Hi All I've been trying to understand symbol-show and symbol-hide a little better as they relate to pdf outputs. How do I display the text associated with fixed points? I have some map objects defined for various caves in a large system. These are comprised of scrap drawings. I also have a map object with the minor surface features nearby, such as sinks, dolines, isolated entrances and significant navigational features such as fence posts or trees (for example). This is comprised of a survey only (mostly fixed points, and no scrap drawings) however and uses flags such as doline or sink, and most points have a text string associated ie. fix 15 2521640 6042938 581 10 10 30 station 15 "Concrete water trough" I would like to show the caves as outlines with all the rest of their symbology turned off, and the surface features with each of the points labelled with appropriate symbol and associated text. This is for an area map, at scales of say 1:5000 or 1:10,000 I can turn the cave symbols off with symbol-hide statements, and so far I think that is working out OK. However. -layout-symbol-show point flag:entrance \ -layout-symbol-show point flag:sink \ -layout-symbol-show point flag:spring \ -layout-symbol-show point flag:doline \ -layout-symbol-show point flag:dig \ The above layout statements cause the special entrance and sink etc symbols to be displayed, AND show the text string associated with the point. These are not displayed by default as far as I can tell, but these statements rectify that. -layout-symbol-show group all And the group all statement has pretty much the same effect in a more comprehensive and compact format. However none of the above enables me to display the text for my "Concrete water trough" example above. It is always just a cross with no text, or with '15' if debug station-names is on. It shows up in Loch, but not in pdfs. So, how do I display the text associated with fixed points? Is there a need for. -layout-symbol-show point fixed . or something similar? Also, sometimes I would like to display the point symbols (for the likes of the above flags) OR the text strings associated with the points, but not both at once. Is there a way of doing this? Thanks Bruce _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3433 - Release Date: 02/09/11
Bruce, Andrew, et al, I noticed your posts from February about this topic, which I also happen to be struggling with at the moment. I'm trying to produce two maps, one showing fixed survey stations and another showing continuations. In particular, I'm a bit confused about the subtle difference between the 'mark', 'flags', and 'station' commands in centreline, and the various point commands in scrap. How are these related in metapost, and how can I distinguish between them in selecting what is displayed? As with Bruce's "concrete water trough" below, I'd rather not have to use the "continuation" flag just to get the text to display. Any suggestions? I have made some progress by using the "continuation" flag for both my needs, but it's not ideal, and I had trouble getting it to work. I'm currently using the mark <station> fixed and station <station> "text" continuation in the centreline, but it also seems to work for the point continuation in the scrap. In the thconfig layout I've used: symbol-hide group all symbol-show line wall # seems to be needed to force display of the cave itself symbol-show point station:painted symbol-show point station:fixed symbol-show point station:natural symbol-show point flag:continuation To display the text I've then used, as per thbook. code metapost def p_continuation(expr pos,theta,sc,al) = ...etc I'd like to be able to use a different symbol to the question mark for my fixed stations, but I don't know how to do that. To get the points to display, I found I had to use the -stations option in the 'scrap' command, even if the scrap included the station already! I'm not sure why this is so, but it works. It also gave me an idea to create an "overlay" scrap, that includes nothing other than the -stations option (plus a couple of point stations to calibrate the scale and avoid the "scrap too large" error). I've got two such scrap files, one called "fixed" and the other called "continuations", and it seems to be working. In my source file, I've added two map definitions map Map_mFixedStations UF_mFixed preview below UF_m1 endmap and map Map_Continuations UF_mContinuations preview below UF_m1 endmap where UF_m1 is the master map of the whole cave, UF_mFixed is a map containing the Fixed point scrap, and UF_mContinuations is the map containing the Continuations scrap. It might be that because of the preview below, I no longer need symbol-hide all, but I haven't tried that yet. In this way I can select the various different points to show in each overlay. The limitation is that I can't have a station that is both a fixed station and a continuation; and I have to manually search my whole cave survey to manually identify all of the fixed points and list them in the scrap. It would be nicer to have Therion display these automatically using symbol-show! The attached shows my "proof of concept" output (it's a bit rough and still incomplete) and I've currently turned off the text output because my points are too close together at this scale (1:4000) and the texts collide. The fixed stations without the question mark have no "stations" command and no text. Regards, - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Bruce Sent: 10 February 2011 19:28 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points Thanks Stacho I think you are pointing me in the direction of answering my second question; redefinition of each type of point that I might be interested in. ie p_sink, p_doline, p_entrance. (Admittedly I have not delved into the code to see how it currently works, and I should perhaps educate myself some more before asking.) Some of my points would have all three (or more) flags set (sink, doline, entrance). Are they just layered one above the other in the output? So there may be three copies of the (identical) text layered one above the other if each definition included printing of the text? When I have time I can look into the TMPDIR outputs and perhaps figure it out. Anyway I digress. My most pressing need and interest is (the first question in my original post) adding the text output to fixed points that do not have any other flags set. The ones that show up in Loch as red circles that do not have doline or other flag set, but do not show up with labels included in the pdf output. Is there a p_fixed? Thanks Bruce _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Thursday, 10 February 2011 10:48 p.m. To: List for Therion users Subject: Re: [Therion] symbol-show fixed points Well, it is quite complicated, but it is possible. When point symbol is exported from centerline, system _text attribute is set in metapost. To dipsplay label, use code code metapost def p_continuation(expr pos,theta,sc,al) = etc... shown in: http://therion.speleo.sk/samples.doc/60.html But you will need to redefine corresponding symbol (e.g. p_sink). In that code, you can also control, whether symbol and/or text should be displayed. Feel free to ask more, if this does not help you. Regards, S. On 7 February 2011 21:10, Bruce <dangle@tomo.co.nz> wrote: Hi All I've been trying to understand symbol-show and symbol-hide a little better as they relate to pdf outputs. How do I display the text associated with fixed points? I have some map objects defined for various caves in a large system. These are comprised of scrap drawings. I also have a map object with the minor surface features nearby, such as sinks, dolines, isolated entrances and significant navigational features such as fence posts or trees (for example). This is comprised of a survey only (mostly fixed points, and no scrap drawings) however and uses flags such as doline or sink, and most points have a text string associated ie. fix 15 2521640 6042938 581 10 10 30 station 15 "Concrete water trough" I would like to show the caves as outlines with all the rest of their symbology turned off, and the surface features with each of the points labelled with appropriate symbol and associated text. This is for an area map, at scales of say 1:5000 or 1:10,000 I can turn the cave symbols off with symbol-hide statements, and so far I think that is working out OK. However. -layout-symbol-show point flag:entrance \ -layout-symbol-show point flag:sink \ -layout-symbol-show point flag:spring \ -layout-symbol-show point flag:doline \ -layout-symbol-show point flag:dig \ The above layout statements cause the special entrance and sink etc symbols to be displayed, AND show the text string associated with the point. These are not displayed by default as far as I can tell, but these statements rectify that. -layout-symbol-show group all And the group all statement has pretty much the same effect in a more comprehensive and compact format. However none of the above enables me to display the text for my "Concrete water trough" example above. It is always just a cross with no text, or with '15' if debug station-names is on. It shows up in Loch, but not in pdfs. So, how do I display the text associated with fixed points? Is there a need for. -layout-symbol-show point fixed . or something similar? Also, sometimes I would like to display the point symbols (for the likes of the above flags) OR the text strings associated with the points, but not both at once. Is there a way of doing this? Thanks Bruce _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3433 - Release Date: 02/09/11
Ben Feels like a long time ago, although I have not resolved the issues I was having. Keep finding too much new cave. So my quick initial thoughts only for now, preceded by a longer than intended dissertation on how I think various station and leg properties relate. We may have had a slight difference in understanding of the terminology and concepts. Station properties In my old posts that you copied into your message, I was thinking of 'fixed' stations as a station that is located by giving it coordinates with the fix statement (from within in a survey, not scrap), like this; fix 804 2503213 6020327 649 4 4 12 station 804 "hole beside track, rocks rumble down" entrance \ continuation attr who "Oz, Deb, Greg" attr what pit attr priority medium attr ref centreline2011.02.19 \ not explored In the context in which my original question was asked, such points do not usually have survey shots attached to them as usually they are features in a karst area, not caves, but some do. Obviously these are unlikely to be underground stations (but they might be sometimes, say by radio location). Knowledge about their coordinates usually comes from a gps. From Therions perspective their locations are 'fixed' in space (with a bit of fuzzyness if you add the standard deviations as I have above). Stations that are not fixed in this manner depend on the calculation of the survey network to determine their location in space. By fixed, you are referring in your post generally to stations in the cave that have some means of future identification (a label, a cairn, a drill hole). The 'mark' statement sets these characteristics of the station(s) -ie is it fixed or painted, or is it temporary (ephemeral, no one can find it for sure 10 minutes later). 'Mark' can be a stand alone statement or it can specify the particular stations it applies to. Eg Near the start of all my surveys I include; mark temporary #makes sure the default is explicitly set for all the stations in the survey legs that follow. and then at the end of all the shots I include something like; mark 1 27 32 48 57 72 fixed This ensures it is always very easy to grab a list of all the 'mark fixed' stations, because they are defined in one place (for each individual survey). Stations can also have 'flags', and they are set using; station <stn> "some words that appear in Loch and I wish could be made to appear in pdfs selectively" <none, one or more flags> Station flags can be entrance, continuation, sink, dig, air-draught etc As I have described above, these are all how you would define them in a centerline (ie part of a survey, not part of a map object). Alternatively in scrap drawings you can override the 'mark' specified for a station in the centerline. Perhaps confusingly, it is called '-subtype' and not '-mark'. (An opportunity for a future feature, synonym option for station -mark = -subtype) The mark properties described above are the properties that the symbol-show points that you have enumerated in your post refer to. I don't think you can specify the continuation flag to stations from within scraps. You can however use points independent of stations; point continuation .with similar syntax to what you would use for the stations (as in example above) with flag continuation set. See http://therion.speleo.sk/wiki/doku.php?id=drawingchecklist#points and look for 'continuation'. Survey leg properties 'Flags' also sets characteristics of the survey leg(s) but the allowable flags are different to those used for stations-ie Are they surface, approximate, duplicate, splay? 'Flags' for shots can be set up in a survey as a stand alone statement, and all stations and legs defined below will inherit those characteristics. So quite often it will be like this; data normal etc flags surface <some surface shots> flags not surface <underground shots> I don't think these can be set or modified in the scraps. So the above does not solve your problem nor mine, but it should make clearer the differences and similarities about what we are each trying to achieve. While we are wanting to isolate or identify different types of station property (you the mark, me the fixity in space) I think the solution to both these will be the same - better control of point symbol display and any associated text. The method you have used to isolate the 'mark fixed' and continuations seems overly complicated, but I guess it could be an interim workaround to gaining better control of how the stations are displayed in pdfs generally. As far as continuations go, I just use the metapost def p_continuation(expr pos,theta,sc,al) = ...etc and then change nothing else, the continuation text is added to the map with all the other detail and labels. If I wanted to hide all passage detail to emphasize the continuations as you have done, I would; symbol-hide group all symbol-show line wall # to display the cave itself symbol-show point flag:continuation (or better, see LayoutScale10000 and LayoutScale10000 in the layoutscales.txt file at http://therion.speleo.sk/wiki/doku.php?id=templates#general_setup to get a better description of the control you can get) This way you could probably get exactly the same effect as in the example you posted, but not have to make a Map_Continuations . Should be easier just to use a layout. The scrap -stations option you highlighted looks like one I've missed. Thanks, I'll think about whether that can help me! Bruce _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Ben Cooper Sent: Sunday, 27 November 2011 11:55 a.m. To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Bruce, Andrew, et al, I noticed your posts from February about this topic, which I also happen to be struggling with at the moment. I'm trying to produce two maps, one showing fixed survey stations and another showing continuations. In particular, I'm a bit confused about the subtle difference between the 'mark', 'flags', and 'station' commands in centreline, and the various point commands in scrap. How are these related in metapost, and how can I distinguish between them in selecting what is displayed? As with Bruce's "concrete water trough" below, I'd rather not have to use the "continuation" flag just to get the text to display. Any suggestions? I have made some progress by using the "continuation" flag for both my needs, but it's not ideal, and I had trouble getting it to work. I'm currently using the mark <station> fixed and station <station> "text" continuation in the centreline, but it also seems to work for the point continuation in the scrap. In the thconfig layout I've used: symbol-hide group all symbol-show line wall # seems to be needed to force display of the cave itself symbol-show point station:painted symbol-show point station:fixed symbol-show point station:natural symbol-show point flag:continuation To display the text I've then used, as per thbook. code metapost def p_continuation(expr pos,theta,sc,al) = ...etc I'd like to be able to use a different symbol to the question mark for my fixed stations, but I don't know how to do that. To get the points to display, I found I had to use the -stations option in the 'scrap' command, even if the scrap included the station already! I'm not sure why this is so, but it works. It also gave me an idea to create an "overlay" scrap, that includes nothing other than the -stations option (plus a couple of point stations to calibrate the scale and avoid the "scrap too large" error). I've got two such scrap files, one called "fixed" and the other called "continuations", and it seems to be working. In my source file, I've added two map definitions map Map_mFixedStations UF_mFixed preview below UF_m1 endmap and map Map_Continuations UF_mContinuations preview below UF_m1 endmap where UF_m1 is the master map of the whole cave, UF_mFixed is a map containing the Fixed point scrap, and UF_mContinuations is the map containing the Continuations scrap. It might be that because of the preview below, I no longer need symbol-hide all, but I haven't tried that yet. In this way I can select the various different points to show in each overlay. The limitation is that I can't have a station that is both a fixed station and a continuation; and I have to manually search my whole cave survey to manually identify all of the fixed points and list them in the scrap. It would be nicer to have Therion display these automatically using symbol-show! The attached shows my "proof of concept" output (it's a bit rough and still incomplete) and I've currently turned off the text output because my points are too close together at this scale (1:4000) and the texts collide. The fixed stations without the question mark have no "stations" command and no text. Regards, - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Bruce Sent: 10 February 2011 19:28 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points Thanks Stacho I think you are pointing me in the direction of answering my second question; redefinition of each type of point that I might be interested in. ie p_sink, p_doline, p_entrance. (Admittedly I have not delved into the code to see how it currently works, and I should perhaps educate myself some more before asking.) Some of my points would have all three (or more) flags set (sink, doline, entrance). Are they just layered one above the other in the output? So there may be three copies of the (identical) text layered one above the other if each definition included printing of the text? When I have time I can look into the TMPDIR outputs and perhaps figure it out. Anyway I digress. My most pressing need and interest is (the first question in my original post) adding the text output to fixed points that do not have any other flags set. The ones that show up in Loch as red circles that do not have doline or other flag set, but do not show up with labels included in the pdf output. Is there a p_fixed? Thanks Bruce _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Stacho Mudrak Sent: Thursday, 10 February 2011 10:48 p.m. To: List for Therion users Subject: Re: [Therion] symbol-show fixed points Well, it is quite complicated, but it is possible. When point symbol is exported from centerline, system _text attribute is set in metapost. To dipsplay label, use code code metapost def p_continuation(expr pos,theta,sc,al) = etc... shown in: http://therion.speleo.sk/samples.doc/60.html But you will need to redefine corresponding symbol (e.g. p_sink). In that code, you can also control, whether symbol and/or text should be displayed. Feel free to ask more, if this does not help you. Regards, S. On 7 February 2011 21:10, Bruce <dangle@tomo.co.nz> wrote: Hi All I've been trying to understand symbol-show and symbol-hide a little better as they relate to pdf outputs. How do I display the text associated with fixed points? I have some map objects defined for various caves in a large system. These are comprised of scrap drawings. I also have a map object with the minor surface features nearby, such as sinks, dolines, isolated entrances and significant navigational features such as fence posts or trees (for example). This is comprised of a survey only (mostly fixed points, and no scrap drawings) however and uses flags such as doline or sink, and most points have a text string associated ie. fix 15 2521640 6042938 581 10 10 30 station 15 "Concrete water trough" I would like to show the caves as outlines with all the rest of their symbology turned off, and the surface features with each of the points labelled with appropriate symbol and associated text. This is for an area map, at scales of say 1:5000 or 1:10,000 I can turn the cave symbols off with symbol-hide statements, and so far I think that is working out OK. However. -layout-symbol-show point flag:entrance \ -layout-symbol-show point flag:sink \ -layout-symbol-show point flag:spring \ -layout-symbol-show point flag:doline \ -layout-symbol-show point flag:dig \ The above layout statements cause the special entrance and sink etc symbols to be displayed, AND show the text string associated with the point. These are not displayed by default as far as I can tell, but these statements rectify that. -layout-symbol-show group all And the group all statement has pretty much the same effect in a more comprehensive and compact format. However none of the above enables me to display the text for my "Concrete water trough" example above. It is always just a cross with no text, or with '15' if debug station-names is on. It shows up in Loch, but not in pdfs. So, how do I display the text associated with fixed points? Is there a need for. -layout-symbol-show point fixed . or something similar? Also, sometimes I would like to display the point symbols (for the likes of the above flags) OR the text strings associated with the points, but not both at once. Is there a way of doing this? Thanks Bruce _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3433 - Release Date: 02/09/11
On 27.11.2011, at 10:02, Bruce wrote:
Bruce, Andrew, et al, I noticed your posts from February about this topic, which I also happen to be struggling with at the moment. I'm trying to produce two maps, one showing fixed survey stations and another showing continuations.
Just repeat two things, many times mentioned before: 1. surveys and maps are ABSOLUTELY independent. The survey structure follows the way how data were achieved or as surveying/documentation of particular cave continued in time. Main goal of scrap and map structure is to create the way for therion how the objects could be corretly rendered in output. It means you may divide your surveys into as many scraps as is usefull or you may create interconnect (join) scrap where will be stations from 2, 3 or more surveys. 2. any text (I hope so) could have the language versions (from list of therion language localisations), so you may generate from one set of data map in English for you or map in Albanian for local cavers if you was on expe in Albania mountains. Symbol names, header terms, ... are translated automaticaly. Martin Sluka
Ben I think the following (dumped below) from the therion sources mpost\thPoint.mp holds the solution to what we are looking for. And I think the smartlabel is the wonderous self organising label routine. I have not had time to verify all this however. Stacho tried to point me to it http://article.gmane.org/gmane.comp.gis.therion/2468/match=symbol+show+fixed +points+text but I did not follow up on it. The first definition below is the code for drawing the ? symbol of a continuation point. You just need to replace the thdraw statements with the symbol you would like. Don't ask me how - my approach is to trawl the rest of the therion code for a symbol I like and perhaps tweak it a little. The second shows how mark is used to decide what station 'x' mark to use, and then how the flags control how the secondary symbols are added. The %% comments are mine, so may not be correct. It shows that station comment text is only added if the station is flagged entrance. I think moving the smartlabel into all but the station_temporary conditional statements might be what we are after. Bruce def p_continuation_UIS(expr pos,theta,sc,al) = U:=(.15u,.3u); T:=identity aligned al shifted pos; %% draw ? symbol pickup PenC; thdraw (-.1u,.2u){up}..{down}(.1u,.2u)..{down}(0,-.05u); pickup PenX; thdraw (0,-.2u); enddef; def p_station_SKBB(expr pos,mark,txt)(text flags) = T:=identity shifted pos; if mark=4: p_station_fixed(pos) elseif mark=3: p_station_natural(pos) elseif mark=2: p_station_painted(pos) elseif mark=1: p_station_temporary(pos) fi; path path_cave; %% = omega symbol path_cave = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0, .25u) .. {dir 225}(.2u,-.25u) -- (.3u,-.25u); for i=flags: pickup PenX; if i="entrance": % thfill fullcircle scaled 1 cm withtransparentcolor tr_blue; thdraw path_cave; % p_label.urt(txt,pos+(0.4u,0),0,0); %% move this if block outside of for loop to label all stations, not just flagged entrance if not numeric txt: p_smartlabel(txt,pos); %% This is the wonderous self organising label i think fi; %% elseif i="sink": thdraw path_cave cutbefore ((-u,0)--(u,0)) cutafter ((-u,0)--(u,0)); pickup PenA; thdraw (0,-.45u) -- (0,.05u) withcolor blue; thdraw (-.15u,-.02u) -- (0,.05u) -- (.15u,-.02u) withcolor blue; elseif i="spring": thdraw path_cave cutbefore ((-u,0)--(u,0)) cutafter ((-u,0)--(u,0)); pickup PenA; thdraw (0,-.45u) -- (0,.05u) withcolor blue; thdraw (-.15u,-.38u) -- (0,-.45u) -- (.15u,-.38u) withcolor blue; elseif i="doline": thdraw (-.5u,.05u){down}..(0,-0.6u)..{up}(.5u,.05u); elseif i="dig": thdraw (-.5u,.25u) -- (-.35u,.25u)--(-.23u,-.25u)--(.23u,-.25u)--(.35u,.25u)--(.5u,.25u); elseif substring(0,11) of i = "air-draught": pickup PenB; thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)); thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)) shifted (.11u,0); thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)) shifted (-.11u,0); elseif i="continuation": if picture(txt): picture ATTR__text; ATTR__text := txt; fi; begingroup; save T; transform T; p_continuation(pos+(0,.25u),0,1,(0,1)); endgroup; if picture(txt): save ATTR__text; fi; elseif i="arch": thdraw (-.5u,-.25u)--(-.5u,.25u)--(.5u,.25u)--(.5u,-.25u)..(0,.2u)..cycle; thfill (-.5u,-.25u)--(-.5u,.25u)--(.5u,.25u)--(.5u,-.25u)..(0,.2u)..cycle; elseif i="overhang": thdraw (.2u,-.25u)--(-.2u,-.25u){up}..{right}(.2u,.25u); fi; endfor; % thdraw (0,0) withpen PenX withcolor red; enddef;
Hi Bruce, You beat me to it! I've spent the last few days learning metapost and rummaging around the bowels of the Therion's source code and have more or less got to what you have summarised below. I also spotted the smartlabel, though haven't yet tried it in the re-definition of p_continuation. I surmise that stations with fixed co-ordinates are not exported by Therion in any detectable way; while the th2 mark "fixed" is exported as "mark", and the th2 flags are exported as "flags". The items that are exported are accessible in metapost. In the debug output data.mp file, I saw that "attr code" is exported by Therion as ATTR_code, where "code" is whatever attr has been declated in the th2 file. Note that it only has one "_" whereas ATTR__text has two "_". So one thing I tried that did work is to print the value of my user define attr statements instead of the text, which is potentially quite useful, as I can display a short code, and use continuation.html for the longer description. However, this still relies on having the "continuation" flag set. I used the following re-definition of p_continuation using ATTR_code instead of the example's ATTR__text, as follows **THE FOLLOWING WORKS** code metapost def p_continuation(expr pos,theta,sc,al) = % draw default continuation symbol p_continuation_UIS(pos,theta,sc,al); % if attr code is set if known(ATTR_code): % set labeling color to light orange push_label_fill_color(1.0, 0.9, 0.8); % draw filled label with text next to ? p_label.urt(ATTR_code,(.5u,-.25u) transformed T,0.0,8); % restore original labeling color pop_label_fill_color; fi; enddef; endcode Looking at p_station_SKBB, the problem you and I are facing is that it's only for the "continuation" flags that ATTR__text has been set. It occurred to me that if it was possible to refedine p_station_SKBB in the thconfig file, then it would be possible to output ATTR__text if an "attr code" has been declared in the th2 file. For example, th2 file:- station 1 "Some text to output" entrance attr print "true" My example p_station_SKBB is below. Unfortunately, I've so far not managed to see it being executed. I can see it appear in the data.mp debug file, but the changes I've made to it don't appear to work - the text is not yet being output to my pdf file. Also, I don't understand yet the purpose of the metapost "save" command, and the manual doesn't really shed much light on it! So it's possible that I've just not yet properly understood metapost syntax. This is the sort of thing I've got in mind ** WARNING, THE FOLLOWING IS NOT YET WORKING ** def p_station_SKBB(expr pos,mark,txt)(text flags) = T:=identity shifted pos; if mark=4: p_station_fixed(pos) elseif mark=3: p_station_natural(pos) elseif mark=2: p_station_painted(pos) elseif mark=1: p_station_temporary(pos) fi; path path_cave; path_cave = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0, .25u) .. {dir 225}(.2u,-.25u) -- (.3u,-.25u); for i=flags: % ... etc. No change to contents of for-loop endfor; % if the "print" attribute is set to true, display the text if known (ATTR_print) and ATTR_print="true": if picture(txt): picture ATTR__text; ATTR__text := txt; % set labeling color to light orange push_label_fill_color(1.0, 0.9, 0.8); % draw filled label with text next to ? p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); % restore original labeling color pop_label_fill_color; save ATTR__text; fi; % thdraw (0,0) withpen PenX withcolor red; enddef; You're welcome to try it to see if you can get it to work! Regards, - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Bruce Sent: 29 November 2011 18:20 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Ben I think the following (dumped below) from the therion sources mpost\thPoint.mp holds the solution to what we are looking for. And I think the smartlabel is the wonderous self organising label routine. I have not had time to verify all this however. Stacho tried to point me to it http://article.gmane.org/gmane.comp.gis.therion/2468/match=symbol+show+fixed +points+text but I did not follow up on it. The first definition below is the code for drawing the ? symbol of a continuation point. You just need to replace the thdraw statements with the symbol you would like. Don't ask me how - my approach is to trawl the rest of the therion code for a symbol I like and perhaps tweak it a little. The second shows how mark is used to decide what station 'x' mark to use, and then how the flags control how the secondary symbols are added. The %% comments are mine, so may not be correct. It shows that station comment text is only added if the station is flagged entrance. I think moving the smartlabel into all but the station_temporary conditional statements might be what we are after. Bruce def p_continuation_UIS(expr pos,theta,sc,al) = U:=(.15u,.3u); T:=identity aligned al shifted pos; %% draw ? symbol pickup PenC; thdraw (-.1u,.2u){up}..{down}(.1u,.2u)..{down}(0,-.05u); pickup PenX; thdraw (0,-.2u); enddef; def p_station_SKBB(expr pos,mark,txt)(text flags) = T:=identity shifted pos; if mark=4: p_station_fixed(pos) elseif mark=3: p_station_natural(pos) elseif mark=2: p_station_painted(pos) elseif mark=1: p_station_temporary(pos) fi; path path_cave; %% = omega symbol path_cave = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0, .25u) .. {dir 225}(.2u,-.25u) -- (.3u,-.25u); for i=flags: pickup PenX; if i="entrance": % thfill fullcircle scaled 1 cm withtransparentcolor tr_blue; thdraw path_cave; % p_label.urt(txt,pos+(0.4u,0),0,0); %% move this if block outside of for loop to label all stations, not just flagged entrance if not numeric txt: p_smartlabel(txt,pos); %% This is the wonderous self organising label i think fi; %% elseif i="sink": thdraw path_cave cutbefore ((-u,0)--(u,0)) cutafter ((-u,0)--(u,0)); pickup PenA; thdraw (0,-.45u) -- (0,.05u) withcolor blue; thdraw (-.15u,-.02u) -- (0,.05u) -- (.15u,-.02u) withcolor blue; elseif i="spring": thdraw path_cave cutbefore ((-u,0)--(u,0)) cutafter ((-u,0)--(u,0)); pickup PenA; thdraw (0,-.45u) -- (0,.05u) withcolor blue; thdraw (-.15u,-.38u) -- (0,-.45u) -- (.15u,-.38u) withcolor blue; elseif i="doline": thdraw (-.5u,.05u){down}..(0,-0.6u)..{up}(.5u,.05u); elseif i="dig": thdraw (-.5u,.25u) -- (-.35u,.25u)--(-.23u,-.25u)--(.23u,-.25u)--(.35u,.25u)--(.5u,.25u); elseif substring(0,11) of i = "air-draught": pickup PenB; thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)); thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)) shifted (.11u,0); thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)) shifted (-.11u,0); elseif i="continuation": if picture(txt): picture ATTR__text; ATTR__text := txt; fi; begingroup; save T; transform T; p_continuation(pos+(0,.25u),0,1,(0,1)); endgroup; if picture(txt): save ATTR__text; fi; elseif i="arch": thdraw (-.5u,-.25u)--(-.5u,.25u)--(.5u,.25u)--(.5u,-.25u)..(0,.2u)..cycle; thfill (-.5u,-.25u)--(-.5u,.25u)--(.5u,.25u)--(.5u,-.25u)..(0,.2u)..cycle; elseif i="overhang": thdraw (.2u,-.25u)--(-.2u,-.25u){up}..{right}(.2u,.25u); fi; endfor; % thdraw (0,0) withpen PenX withcolor red; enddef;
Hi Bruce, I've solved the problem - obvious really - I need to use p_station, not p_station_SKBB. I'll send the example through later - I need to copy it off another computer. Regards, - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Ben Cooper Sent: 30 November 2011 22:35 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Hi Bruce, You beat me to it! I've spent the last few days learning metapost and rummaging around the bowels of the Therion's source code and have more or less got to what you have summarised below. I also spotted the smartlabel, though haven't yet tried it in the re-definition of p_continuation. I surmise that stations with fixed co-ordinates are not exported by Therion in any detectable way; while the th2 mark "fixed" is exported as "mark", and the th2 flags are exported as "flags". The items that are exported are accessible in metapost. In the debug output data.mp file, I saw that "attr code" is exported by Therion as ATTR_code, where "code" is whatever attr has been declated in the th2 file. Note that it only has one "_" whereas ATTR__text has two "_". So one thing I tried that did work is to print the value of my user define attr statements instead of the text, which is potentially quite useful, as I can display a short code, and use continuation.html for the longer description. However, this still relies on having the "continuation" flag set. I used the following re-definition of p_continuation using ATTR_code instead of the example's ATTR__text, as follows **THE FOLLOWING WORKS** code metapost def p_continuation(expr pos,theta,sc,al) = % draw default continuation symbol p_continuation_UIS(pos,theta,sc,al); % if attr code is set if known(ATTR_code): % set labeling color to light orange push_label_fill_color(1.0, 0.9, 0.8); % draw filled label with text next to ? p_label.urt(ATTR_code,(.5u,-.25u) transformed T,0.0,8); % restore original labeling color pop_label_fill_color; fi; enddef; endcode Looking at p_station_SKBB, the problem you and I are facing is that it's only for the "continuation" flags that ATTR__text has been set. It occurred to me that if it was possible to refedine p_station_SKBB in the thconfig file, then it would be possible to output ATTR__text if an "attr code" has been declared in the th2 file. For example, th2 file:- station 1 "Some text to output" entrance attr print "true" My example p_station_SKBB is below. Unfortunately, I've so far not managed to see it being executed. I can see it appear in the data.mp debug file, but the changes I've made to it don't appear to work - the text is not yet being output to my pdf file. Also, I don't understand yet the purpose of the metapost "save" command, and the manual doesn't really shed much light on it! So it's possible that I've just not yet properly understood metapost syntax. This is the sort of thing I've got in mind ** WARNING, THE FOLLOWING IS NOT YET WORKING ** def p_station_SKBB(expr pos,mark,txt)(text flags) = T:=identity shifted pos; if mark=4: p_station_fixed(pos) elseif mark=3: p_station_natural(pos) elseif mark=2: p_station_painted(pos) elseif mark=1: p_station_temporary(pos) fi; path path_cave; path_cave = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0, .25u) .. {dir 225}(.2u,-.25u) -- (.3u,-.25u); for i=flags: % ... etc. No change to contents of for-loop endfor; % if the "print" attribute is set to true, display the text if known (ATTR_print) and ATTR_print="true": if picture(txt): picture ATTR__text; ATTR__text := txt; % set labeling color to light orange push_label_fill_color(1.0, 0.9, 0.8); % draw filled label with text next to ? p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); % restore original labeling color pop_label_fill_color; save ATTR__text; fi; % thdraw (0,0) withpen PenX withcolor red; enddef; You're welcome to try it to see if you can get it to work! Regards, - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Bruce Sent: 29 November 2011 18:20 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Ben I think the following (dumped below) from the therion sources mpost\thPoint.mp holds the solution to what we are looking for. And I think the smartlabel is the wonderous self organising label routine. I have not had time to verify all this however. Stacho tried to point me to it http://article.gmane.org/gmane.comp.gis.therion/2468/match=symbol+show+fixed +points+text but I did not follow up on it. The first definition below is the code for drawing the ? symbol of a continuation point. You just need to replace the thdraw statements with the symbol you would like. Don't ask me how - my approach is to trawl the rest of the therion code for a symbol I like and perhaps tweak it a little. The second shows how mark is used to decide what station 'x' mark to use, and then how the flags control how the secondary symbols are added. The %% comments are mine, so may not be correct. It shows that station comment text is only added if the station is flagged entrance. I think moving the smartlabel into all but the station_temporary conditional statements might be what we are after. Bruce def p_continuation_UIS(expr pos,theta,sc,al) = U:=(.15u,.3u); T:=identity aligned al shifted pos; %% draw ? symbol pickup PenC; thdraw (-.1u,.2u){up}..{down}(.1u,.2u)..{down}(0,-.05u); pickup PenX; thdraw (0,-.2u); enddef; def p_station_SKBB(expr pos,mark,txt)(text flags) = T:=identity shifted pos; if mark=4: p_station_fixed(pos) elseif mark=3: p_station_natural(pos) elseif mark=2: p_station_painted(pos) elseif mark=1: p_station_temporary(pos) fi; path path_cave; %% = omega symbol path_cave = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0, .25u) .. {dir 225}(.2u,-.25u) -- (.3u,-.25u); for i=flags: pickup PenX; if i="entrance": % thfill fullcircle scaled 1 cm withtransparentcolor tr_blue; thdraw path_cave; % p_label.urt(txt,pos+(0.4u,0),0,0); %% move this if block outside of for loop to label all stations, not just flagged entrance if not numeric txt: p_smartlabel(txt,pos); %% This is the wonderous self organising label i think fi; %% elseif i="sink": thdraw path_cave cutbefore ((-u,0)--(u,0)) cutafter ((-u,0)--(u,0)); pickup PenA; thdraw (0,-.45u) -- (0,.05u) withcolor blue; thdraw (-.15u,-.02u) -- (0,.05u) -- (.15u,-.02u) withcolor blue; elseif i="spring": thdraw path_cave cutbefore ((-u,0)--(u,0)) cutafter ((-u,0)--(u,0)); pickup PenA; thdraw (0,-.45u) -- (0,.05u) withcolor blue; thdraw (-.15u,-.38u) -- (0,-.45u) -- (.15u,-.38u) withcolor blue; elseif i="doline": thdraw (-.5u,.05u){down}..(0,-0.6u)..{up}(.5u,.05u); elseif i="dig": thdraw (-.5u,.25u) -- (-.35u,.25u)--(-.23u,-.25u)--(.23u,-.25u)--(.35u,.25u)--(.5u,.25u); elseif substring(0,11) of i = "air-draught": pickup PenB; thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)); thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)) shifted (.11u,0); thdraw ((0,.11u){dir-120} ..{dir-70}(0,0) .. {dir-120}(0,-.11u)) shifted (-.11u,0); elseif i="continuation": if picture(txt): picture ATTR__text; ATTR__text := txt; fi; begingroup; save T; transform T; p_continuation(pos+(0,.25u),0,1,(0,1)); endgroup; if picture(txt): save ATTR__text; fi; elseif i="arch": thdraw (-.5u,-.25u)--(-.5u,.25u)--(.5u,.25u)--(.5u,-.25u)..(0,.2u)..cycle; thfill (-.5u,-.25u)--(-.5u,.25u)--(.5u,.25u)--(.5u,-.25u)..(0,.2u)..cycle; elseif i="overhang": thdraw (.2u,-.25u)--(-.2u,-.25u){up}..{right}(.2u,.25u); fi; endfor; % thdraw (0,0) withpen PenX withcolor red; enddef;
Hi Bruce, Here is my re-defined p_station code that now works. For each station that you want to print the text for, set attr print "true" in the th2 file as I illustrated in my earlier email. If you want to turn off printing you can set the text to "false". This works for any station, no matter what its subtype or flags that are set. The code is as follows: layout l_p_station_text code metapost def p_station(expr pos,mark,txt)(text flags) = % draw default station p_station_SKBB(pos, mark, txt, flags); % now print the text if picture(txt): picture ATTR__text; ATTR__text := txt; if known(ATTR_print): if (ATTR_print="true"): if not numeric txt: p_smartlabel(txt,pos); else: % draw filled label with text next p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); fi; fi; fi; save ATTR__text; fi; enddef; endcode endlayout _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Ben Cooper Sent: 01 December 2011 19:56 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Hi Bruce, I've solved the problem - obvious really - I need to use p_station, not p_station_SKBB. I'll send the example through later - I need to copy it off another computer. Regards, - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Ben Cooper Sent: 30 November 2011 22:35 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Hi Bruce, You beat me to it! I've spent the last few days learning metapost and rummaging around the bowels of the Therion's source code and have more or less got to what you have summarised below. I also spotted the smartlabel, though haven't yet tried it in the re-definition of p_continuation. I surmise that stations with fixed co-ordinates are not exported by Therion in any detectable way; while the th2 mark "fixed" is exported as "mark", and the th2 flags are exported as "flags". The items that are exported are accessible in metapost. In the debug output data.mp file, I saw that "attr code" is exported by Therion as ATTR_code, where "code" is whatever attr has been declated in the th2 file. Note that it only has one "_" whereas ATTR__text has two "_". So one thing I tried that did work is to print the value of my user define attr statements instead of the text, which is potentially quite useful, as I can display a short code, and use continuation.html for the longer description. However, this still relies on having the "continuation" flag set. I used the following re-definition of p_continuation using ATTR_code instead of the example's ATTR__text, as follows **THE FOLLOWING WORKS** code metapost def p_continuation(expr pos,theta,sc,al) = % draw default continuation symbol p_continuation_UIS(pos,theta,sc,al); % if attr code is set if known(ATTR_code): % set labeling color to light orange push_label_fill_color(1.0, 0.9, 0.8); % draw filled label with text next to ? p_label.urt(ATTR_code,(.5u,-.25u) transformed T,0.0,8); % restore original labeling color pop_label_fill_color; fi; enddef; endcode Looking at p_station_SKBB, the problem you and I are facing is that it's only for the "continuation" flags that ATTR__text has been set. It occurred to me that if it was possible to refedine p_station_SKBB in the thconfig file, then it would be possible to output ATTR__text if an "attr code" has been declared in the th2 file. For example, th2 file:- station 1 "Some text to output" entrance attr print "true" My example p_station_SKBB is below. Unfortunately, I've so far not managed to see it being executed. I can see it appear in the data.mp debug file, but the changes I've made to it don't appear to work - the text is not yet being output to my pdf file. Also, I don't understand yet the purpose of the metapost "save" command, and the manual doesn't really shed much light on it! So it's possible that I've just not yet properly understood metapost syntax.
That looks good Ben Seems like 'we' have full control now. Although ultimately it would be good to move away from having to modify each station with text in the th2 files each time we wanted to toggle the output of text for individual point types (mark or flag), and move towards putting this type of control back into the layout files. A symbol-show, symbol-hide that pertained to the text comment for stations with specific mark and flag combinations would perhaps be ideal. So we could have control of printing each of the three components of station individually (mark, flag symbol, text) dependant on the mark and flag status of each point. Of course having a fourth controlling factor or override, ATTR_print, as you have come up with is useful as well. Bruce _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Ben Cooper Sent: Friday, 2 December 2011 9:59 a.m. To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Hi Bruce, Here is my re-defined p_station code that now works. For each station that you want to print the text for, set attr print "true" in the th2 file as I illustrated in my earlier email. If you want to turn off printing you can set the text to "false". This works for any station, no matter what its subtype or flags that are set. The code is as follows: layout l_p_station_text code metapost def p_station(expr pos,mark,txt)(text flags) = % draw default station p_station_SKBB(pos, mark, txt, flags); % now print the text if picture(txt): picture ATTR__text; ATTR__text := txt; if known(ATTR_print): if (ATTR_print="true"): if not numeric txt: p_smartlabel(txt,pos); else: % draw filled label with text next p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); fi; fi; fi; save ATTR__text; fi; enddef; endcode endlayout
Of course you can define as many attr xyz as you need, and create different layout definitions to select them at will. - Ben _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Bruce Sent: 02 December 2011 09:43 To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text That looks good Ben Seems like 'we' have full control now. Although ultimately it would be good to move away from having to modify each station with text in the th2 files each time we wanted to toggle the output of text for individual point types (mark or flag), and move towards putting this type of control back into the layout files. A symbol-show, symbol-hide that pertained to the text comment for stations with specific mark and flag combinations would perhaps be ideal. So we could have control of printing each of the three components of station individually (mark, flag symbol, text) dependant on the mark and flag status of each point. Of course having a fourth controlling factor or override, ATTR_print, as you have come up with is useful as well. Bruce _____ From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Ben Cooper Sent: Friday, 2 December 2011 9:59 a.m. To: 'List for Therion users' Subject: Re: [Therion] symbol-show fixed points / point text Hi Bruce, Here is my re-defined p_station code that now works. For each station that you want to print the text for, set attr print "true" in the th2 file as I illustrated in my earlier email. If you want to turn off printing you can set the text to "false". This works for any station, no matter what its subtype or flags that are set. The code is as follows: layout l_p_station_text code metapost def p_station(expr pos,mark,txt)(text flags) = % draw default station p_station_SKBB(pos, mark, txt, flags); % now print the text if picture(txt): picture ATTR__text; ATTR__text := txt; if known(ATTR_print): if (ATTR_print="true"): if not numeric txt: p_smartlabel(txt,pos); else: % draw filled label with text next p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); fi; fi; fi; save ATTR__text; fi; enddef; endcode endlayout
participants (5)
-
Ben Cooper -
Bruce -
Bruce -
Martin Sluka -
Stacho Mudrak