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

Home » Public Forums » archive » Success!! Add and manipulate a visualization in standard iTool - Part II
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
Success!! Add and manipulate a visualization in standard iTool - Part II [message #76192] Fri, 20 May 2011 04:28 Go to next message
kidpix is currently offline  kidpix
Messages: 23
Registered: July 2007
Junior Member
After a lot of learning-by-doing (where doing means take the manual, search for undocumented class, open the class definition and read it there), I succeed in the post topic: add and manipulate a visualization in standard iTool.

The acutal iTool is an iPlot (IDLitTOOLPLOT) and the visualization is a IDLitVisPolyline encapsulating a IDLgrPolyline objects.

The resulting IDLitVisPolyline obeject in the iTool is working as desired: user can manipulate all the properties via the Visualization Browser and via command line or programmatically using an IDL program or a widget.

I try the same for IDLitVisPolygon object, but the interactive manipulation is somehow forbidden.
From the iTool's Visualization Browser I can just change the STYLE property, but thing like COLOR or LINE_STYLE are unchangeable.

Do anyone have experience on this particular point?

That's my example code, where I'm using Coyote CGS functions too (thanks David!) for the polylines RGB color code.

;-- IDL code Area

iplot,[-2,3],[-2,4],IDENTIFIER=plotID,/overplot
idTool = ITGETCURRENT(TOOL=oTool) ;- redundant if we are going to work on the current iTool
oPlot=oTool->IDLitContainer::GetByIdentifier(plotID)

;- 2 ROIs generation
X_roi=[0,0,1,1,0]
Y_roi=[0,1,1,0,0]
X_roi=[X_roi,X_roi+2]
Y_roi=[Y_roi,Y_roi+2]

;- Definition of ROI's number and shape
n_poly= 2
n_vertex=5

;- Generation of connectivity Array based on input parameter
poly_unit=indgen(n_vertex)
poly_vertex_pos=indgen(n_poly)*n_vertex
POLYLINES=[n_vertex,poly_unit+poly_vertex_pos(0)]
for pl=1,n_poly-1 do POLYLINES=[POLYLINES,n_vertex,poly_unit+poly_vertex_pos(pl)]

;- Instantiation of polyline (IDLgrPolyline) object, setting of calculated POLYLINES property
oPolyl = OBJ_NEW('IDLgrPolyline',X_roi,Y_roi,POLYLINES=POLYLINES,/REG ISTER_PROPERTIES)

;- Instantiation of visualization (IDLitVisPolyline) object
visPOLY = OBJ_NEW('IDLitVisPolyline' ,$
/REGISTER_PROPERTIES ,$
/MANIPULATOR_TARGET ,$ ;- that was my long lasting problem!!!
IMPACTS_RANGE=1 ,$
NAME='FOV' ,$
ICON='front' ,$
DESCRIPTION='FOV polyline plot')

;- add&aggregate IDLgrPolyline to the IDLitVisPolyline
visPOLY->IDLitVisPolyline::Add,oPolyl,/AGGREGATE

;- add&aggregate IDLitVisPolyline to the iPlot
oTool ->IDLitTool::Add, visPOLY,/AGGREGATE

;- get identifier & reference
idvisPOLY = oTool->IDLitTool::FindIdentifiers('*FOV*', /VISUALIZATIONS,/LEAF_NODES)
refvisPOLY = oTool->IDLitContainer::GetByIdentifier(idvisPOLY)


;- VERT_COLORS overwrite COLOR! Set it to 0 to leave COLOR free to act
success=oPlot->IDLitTool::DoSetProperty(idvisPOLY, 'VERT_COLORS',0)

refPoly_MASCS.ref->IDLITVISPOLYLINE::GetProperty, VERT_COLORS=vrt
success=oPlot->IDLitTool::DoSetProperty(idvisPOLY, 'COLOR', [255,0,0])
oPlot->IDLitTool::CommitActions

;- Set polyline color for a single shape (similar to single ROI)
colors=[80,254]
triple_col=transpose(cgColor(stringer(color,/INT), /Triple))
VERT_COLORS=lonarr(3,n_vertex*n_poly)
for i=0,n_poly-1 do VERT_COLORS(*,i*n_vertex:i*n_vertex+n_vertex-1)=rebin(triple _col(*,i),3,n_vertex)

success=oPlot->IDLitTool::DoSetProperty(refPoly_MASCS.id, 'VERT_COLORS', VERT_COLORS) & oPlot->IDLitTool::CommitActions

;-- END IDL code Area
Re: Success!! Add and manipulate a visualization in standard iTool - Part II [message #76223 is a reply to message #76192] Tue, 24 May 2011 01:54 Go to previous message
kidpix is currently offline  kidpix
Messages: 23
Registered: July 2007
Junior Member
David Fanning wrote:
> Absolutely, and I've already sent a note to the IEPA
> committee recommending you for a Meritorious Valor commendation.
> You should be hearing something soon. :-)

I'm looking forward to hear the IEPA! What Honor!

> Well, at least the riffraff will be able to program
> that part of it. ;-)

Hey,without all your efforts (website,books, tips, this mailing list and so on) I'still try to print out 2 +2 in IDL...so thanks!

Have good holidays this summer, I've read you'll be away from us for a long!

Cheers,
Mario.


--
Dr. Mario D'Amore

Deutsches Zentrum für Luft- und Raumfahrt
Institut für Planetenforschung
Experimentelle Planetenphysik
Rutherfordstraße 2
12489 Berlin

Email : Mario.Damore.dlr.de
Internet : http://www.dlr.de/pf

Deutscher Akademischer Austauschdienst (DAAD)
Email : Mari...@daad-alumni.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Constant Size Array in Class Init
Next Topic: Re: Displaying thicker lines on an image

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

Current Time: Wed Oct 08 15:22:33 PDT 2025

Total time taken to generate the page: 0.00853 seconds