comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Keyword precedence
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Keyword precedence [message #21508 is a reply to message #21389] Tue, 29 August 2000 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Mark Hadfield wrote:
>
> for each element foo add a single keyword,
> foo_properties, thus:
>
> pro my_visualisation $
> , VIEW_PROPERTIES=view_properties $
> , XAXIS_PROPERTIES=xaxis_properties $
> , YAXIS_PROPERTIES=yaxis_properties $
> , SURFACE_PROPERTIES=surface_properties $
> , WINDOW_PROPERTIES=window_properties
>
> theview = new_view(UNITS=2, DIMENSIONS=, _EXTRA=view_properties)
> thexaxis = new_axis(DIRECTION=0, TICKFORMAT=...,
> _EXTRA=xaxis_properties)
> theyaxis = new_axis(DIRECTION=1, TICKFORMAT=...,
> _EXTRA=yaxis_properties)
> ; Add the axes to a model & add that to the view
> ; Get data
> thesurface = new_surface(STYLE=2, DATAX=..., _EXTRA=surface_properties)
> ; add the surface to the model
> new_window, GRAPHICS_TREE=theview, RETAIN=2, _EXTRA=window_properties
> end
>
> Now to control (say) the X axis the caller just sets xaxis_properties equal
> to a structure containing the appropriate keyword:value pairs, e.g.:
>
> my_visualisation, XAXIS_PROPERTIES={notext:1, minor:0}
>
> Now this approach obviously relies on the "_properties" structures
> overriding the defaults. When I first tried this I found that the
> xaxis_properties keyword was not working and that this was because I had
> happened to use inheritance by reference in new_axis. The rest (as they say)
> is history...

If you follow this approach, you might almost as well pass the
structure explicitely instead of relying on the _extra passing
mechanism. Things like this prompted me a while ago to write my
little ChkStru routine, where you test (a) if the thing you test
is a structure, and (b) if it contains what you are looking for.
An example for setting axis properties could look like:
IF ChkStru(xaxis_properties, 'DIRECTION') THEN
thexaxis->SetProperty, $
direction=xaxis_properties.direction
IF ...

But I realize, this may get a bit lengthy from time to time ;-)

Thanks for the thoughtful discussion,

Martin

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie
[[
[[ Bundesstr. 55, 20146 Hamburg
[[
[[ phone: +49 40 41173-308
[[
[[ fax: +49 40 41173-298
[[
[[ martin.schultz@dkrz.de
[[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: From PV-WAVE to IDL
Next Topic: Re: Gridding options

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 00:08:33 PDT 2025

Total time taken to generate the page: 1.27855 seconds