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

Home » Public Forums » archive » problem:symbol not be showed in IdlgrPlot object etc.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
problem:symbol not be showed in IdlgrPlot object etc. [message #46013] Wed, 26 October 2005 19:35 Go to next message
shengbaojun is currently offline  shengbaojun
Messages: 8
Registered: October 2005
Junior Member
Hello,I have draw the background map.Thanks for Mr.Rick Towler and
Mr.Mark Hadfield a lot.
But I met some difficulties when I try something else,so could you give
me some adivce please.

1, I want to draw some cities above the background map,but the symbols
can not be showed.
I use the code as follows:
;-----------------------------------------------------
;draw cities
cityUV = map_proj_forward(lon, lat, $
map=map_info.smap $
)
;define the symbol
pentagon=OBJ_NEW('IDLgrPolygon', [0.1,0.5,0.9,0.7,0.3], $
[0.6,0.9,0.6,0.1,0.1], $
COLOR=Color_cities $
)
symModel = OBJ_NEW('IDLgrModel')
symModel -> Add, pentagon
symModel -> Scale, 8, 8, 1
symModel -> Translate, -1, -1, 0
ocitiesSymbol = OBJ_NEW('IDLgrSymbol', symModel)
; ocitiesSymbol=OBJ_NEW('IDLgrSymbol',4,$
; color=Color_NoData,$
; thick=8.0,$
; size=[9.0,9.0]$
; )
map_info.ocitiesSymbol=ocitiesSymbol

oPlotCities=OBJ_NEW('IDLgrPlot',cityUV[0,*],cityUV[1,*], $
Symbol=ocitiesSymbol,$
_Extra=extra,$
;Thick=2 ,$
LINESTYLE =6 $
)

map_info.omodel->ADD,oPlotCities
map_info.owindow->DRAW,map_info.oview,/draw_instance
;--------------------------------------------------------
If I change the LINESTYLE value from 6 to 3,The lines has been
showed,but the Symbols also can not be showed .

2,I use the develop model of C# plus axIDLWidgetControl 3.0,I write
the mouse event in C#,so I must obtain the value of IDL's variable from
IDL's .pro file.But I can not get them .The code is as follows:

IDL's code
//////////////////////////////////////////////////////////// ///////////

PRO MouseMove,drawid,x,y

common lonlat_mousemovex,lonlat_mousemovey
widget_control,drawid,get_uvalue=map_info,/no_copy

if size(map_info, /type) eq 0 then return
result = map_info.owindow -> pickdata(map_info.oview, $
map_info.omodel,$
[x,y], xy)
lonlat_mousemove = map_proj_inverse(xy, map = map_info.smap)
map_info.lonlat_mousemovex=lonlat_mousemove[0]
map_info.lonlat_mousemovey=lonlat_mousemove[1]
widget_control,drawid,set_uvalue=map_info,/no_copy
END

C# 's code
///////////////////////////////////////////////////////
private void axIDLDrawWidget1_MouseMoveEvent(object sender,
AxIDLDRAWX3Lib._DIDLDrawX3Events_MouseMoveEvent

e)
{

int myYY=axIDLDrawWidget1.Height-e.y;
string
command="MouseMove,IDLDrawWidget1,"+e.x.ToString()+","+myYY.ToString();
int temp=axIDLDrawWidget1.ExecuteStr(command);
temp=axIDLDrawWidget1.ExecuteStr("widget_control,IDLDrawWidget1,get_value=map_info ");
object
lonlat_mousemovex=axIDLDrawWidget1.GetNamedData("map_info.lonlat_mousemovex ");
object
lonlat_mousemovey=axIDLDrawWidget1.GetNamedData("map_info.lonlat_mousemovey ");
}

I try my best to test above codes,but did not success.
I wish you can help me.

Thanks you
Re: problem:symbol not be showed in IdlgrPlot object etc. [message #46127 is a reply to message #46013] Mon, 31 October 2005 11:03 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
shengbaojun wrote:

<sigh>

> The Second, VB、VC etc. must use axIDLDrawWidget1.DrawID as draw
> id;But,C# can use IDLDrawWidget1 as draw id directly,I have filfulled
> it.The world map can be draw corretly.

Are you sure? You are drawing the map, but maybe you're just lucky. I
don't know why you wouldn't pass the DrawID property even if it does
work without it? It's confusing. Have you even tried passing the draw
ID in the method I suggested?

I find it hard to believe that the AX control behaves so differently in
C#. For instance, why, in C#, would the control parse the command you
send via ExecuteStr to pull out the string "IDLDrawWidget1" and use that
to get a reference to the draw widget when in the VB and VC case you
need to pass the draw ID as a long value which represents the drawID
converted to a string? I'm not saying it can't work in this way, but I
would be surprised.

Surprised enough that if something wasn't working that I would try a
different approach. *Maybe one similar to the examples shipped with IDL
and suggestions posted to the news group* And in the end, if they both
work the same at least your code would be a little more understandable.


> My quesion is:
> 1. I have filfull the background map drawing,using the IDLgrPolyLine
> and the data source is *.shp,I want to overlay some symbols to this
> background map,the polylines can be drawn,but the symbols can't be
> drawn.

Did you try applying any of the changes I suggested? Especially the
changes to the transformations to your symbols? Asking the same
question again without telling us what you have tried is not productive.


> 2. Are there a good method to get variable value from IDL 's Object
> program model in C# environment.And now ,I use SetOutputWnd but not
> GetNamedData.

As we have said before, I suggest that you attack this problem in two
steps. Get the IDL code working in IDL as a first step, then work on
the C# side of things. *S-I-M-P-L-I-F-Y*


-Rick
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: rebinning histogram
Next Topic: IDLgrWindow Setting - Why render image gets erased?

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

Current Time: Fri Oct 10 11:17:43 PDT 2025

Total time taken to generate the page: 1.44152 seconds