Select and Hide trouble in object graphics [message #44607] |
Mon, 04 July 2005 05:17 |
Ulan
Messages: 8 Registered: April 2005
|
Junior Member |
|
|
HI all,
I am running into the following 'select' and 'hide' trouble
with object graphics:
I have a 3D IDlgrModel (with option select_target =0). Axis of the
Model: x, y and time. The Model consists of Orbs (of varied radiuses
and positions) and IDLgrPolygons with texture_coord being one of images
(corresponding to the particular time position). Further I have an
image slider, and when the value of it is changed the corresponding
IDlgrPolygon with the image texture appears (HIDE=0, and for the other
one HIDE=1).
Now, I have constructed a Select button, that after pressing it and
pressing mouse button in widget_draw area it causes Tooltip (see code
below).
Now my trouble: In the beginning when the view is drawn - I get nice
Tooltips - works fine. But when I change the image slider value, the
select doesn't find any orbs. Also, setting the HIDE property on
(some) orbs causes the same trouble. After that, even if select
doesn't find anything (select=-1) IDL stops processing events from my
other widget buttons (zoom, translate etc..) and the view jus hangs up.
Moreover, if I press 'change the radius of orbs' button IDL crashes
saying that 'some memory references are not found'.
Any idea of what would be the cause and how I could fix it? Thanks in
advance for any help!
Ulan
;;;---------------
PRO Select_button, event
widget_control, event.top, get_uvalue=info
drawid=widget_info (event.top, FIND_BY_UNAME='widgetDraw')
widget_control, drawid, /DRAW_BUTTON_EVENTS
widget_control, drawid, EVENT_PRO='Select'
END
;;;--------------
PRO Select, event
widget_control, event.top, get_uvalue=info
IF event.type eq 0 THEN BEGIN
;first select the object from the IDLgrWindow
sel=info.Window->Select(info.oView, [event.x,event.y], $
DIMENSIONS=[5,5])
;select returns an object reference, so
;check if obj ref is valid
IF obj_valid(sel[0]) THEN BEGIN
FOR i=0, N_elements(sel)-1 do begin
;Since the IDLgrModel has SELECT_TARGET=0, the
;selected item is atomic graphic objects
;;find its parents
sel[i]->getproperty, PARENT=obj
if obj_class(obj) eq 'ORB' then begin
obj->getproperty, RADIUS=rad
str ='radius is'+' '+STRTRIM(rad, 2)
widget_control, event.id, Tooltip = str
endif
ENDFOR
ENDIF ;no selected objects
ENDIF ELSE BEGIN ;;expose events
info.window->Draw, info.oView
ENDELSE
END
|
|
|