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

Home » Public Forums » archive » IDLgrWindow (?) bug
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDLgrWindow (?) bug [message #19139] Mon, 28 February 2000 00:00 Go to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
Hello everyone,
I think there is a bug in the way IDL creates an independent object
graphics window. Once you change things in it, the viewport (or
something else) changes, messing the displayed axes up. Try the code at
the bottom of this message. I use PPC IDL 5.2 and tried it in PPC IDL 5.3.

IDL> test, All_objects=All_objects, window=window, scene=scene, $
IDL> x_axis=x_axis, x_top=x_axis_top
IDL> mod_axis, window=window, x_axis=x_axis, scene=scene, x_top=x_axis_top

Use obj_destroy, objects toclean up after you saw the results.
After mod_axis is executed, the all axes lengthen and reach the edges of
the window. However, if you try using the widget_draw in object graphics
mode, it does not happen:

IDL> test, All_objects=All_objects, window=window, scene=scene, $
IDL> x_axis=x_axis, x_top=x_axis_top, /wid
IDL> mod_axis, window=window, x_axis=x_axis, scene=scene, x_top=x_axis_top

Everything looks normal, scaling changes; of course, the labels are
messed up because size recalculation is left out in the sample code.
Use obj_destroy, objects toclean up after you saw the results.
Does anyone know if this is a feature or a bug? It took me half-day
yesterday to figure out why my axes act up, until I tried to put my
development object window into a widget.

Cheers,
Pavel

pro test, All_objects=All_objects, window=window, scene=scene, $
x_axis=x_axis, x_top=x_axis_top, wid=wid

if keyword_set(wid) then begin
base = widget_base()
draw = widget_draw(base, xsize=400, ysize=300, graphics=2)
widget_control, base, /realize
widget_control, draw, get_value=Window
endif else Window = obj_new('IDLgrWindow')

All_objects = obj_new('IDL_Container')
Scene = obj_new('IDLgrScene')

; Fill the entire window with the default view.
View = obj_new('IDLgrView', viewplane_rect=[-0.1, -0.1, 1.12, 1.16],
location=[0.0, 0.0])
Model = obj_new('IDLgrModel')

; Initialize axes.
x_axis_top = obj_new('IDLgrAxis', 0, ticklen=0.03, tickdir=1,
loc=[1000, 1, 0], /notext, /exact)
y_axis_top = obj_new('IDLgrAxis', 1, ticklen=0.03, tickdir=1, loc=[1,
1000, 0], /notext, /exact)
x_axis = obj_new('IDLgrAxis', 0, ticklen=0.03, name='X_AXIS',
location=[1000, 0, 0], /exact)
y_axis = obj_new('IDLgrAxis', 1, ticklen=0.03, name='Y_AXIS',
location=[0, 1000, 0], /exact)

Model -> add, x_axis
Model -> add, y_axis
Model -> add, x_axis_top
Model -> add, y_axis_top

View -> add, Model
Scene -> add, View

; Put all objects in container, for easy destruction.
All_objects -> add, Scene
All_objects -> add, Window

window -> draw, Scene

end

pro mod_axis, window=window, x_axis=x_axis, scene=scene, x_top=x_axis_top

x_nr = normalize([20.,120.])
x_axis -> setProperty, range=[20.,120.], xcoord_conv=x_nr
x_axis_top -> setProperty, range=[20.,120.], xcoord_conv=x_nr
window -> draw, scene

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ION and color mapping bug ?
Next Topic: Re: Some special behaviour of ROUTINE_NAMES

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

Current Time: Fri Oct 10 10:01:44 PDT 2025

Total time taken to generate the page: 0.55532 seconds