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

Home » Public Forums » archive » VERT_COLORS Problem
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: VERT_COLORS Problem [message #86773 is a reply to message #86637] Mon, 02 December 2013 09:57 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Monday, November 25, 2013 7:00:14 AM UTC-7, David Fanning wrote:
> Udo Grabowski writes:
>
>
>
>> I struggle with an animated tool that uses the "new style"
>
>> surface function, and I'm trying to update the vert_colors
>
>> option (which is tagged as updateable in the docs), but
>
>> it does not work at all. What I'm doing wrong here ?
>
>>
>
>> ; boring flat grey semi-transparent surface
>
>> ; (poor man's transparency, as always in IDL....)
>
>> v = dist(10)
>
>> rgba = intarr(4,100)
>
>> rgba[0:*,0:*] = 110
>
>> S = surface(v,vert_colors=rgba)
>
>>
>
>> ; update to light grey nearly transparent
>
>> rgba[0:*,0:*] = 210
>
>> S.vert_colors=rgba
>
>> ; still the same boring grey !
>
>>
>
>> I tried several variants, setting vert_colors to 0,
>
>> refresh, different sequences in doing that, using
>
>> S->SetProperty,vert_colors=..., etc.etc.,
>
>> no help, it seems that this is just an immutable
>
>> variable and the documentation is wrong.
>
>
>
> It would seem so, although I just tested this with my cgSurface program
>
> and it would appear it is *possible* to change the vert_colors. In my
>
> case, though, it is necessary to first turn the vert colors off, then on
>
> again. In my test case, the code looks like this:
>
>
>
> rgba = info.rgba
>
> rgba[2,*] = 0
>
> info.thisSurface -> SetProperty, Vert_Colors=0
>
> info.thisSurface -> SetProperty, Vert_Colors=rgba
>
>
>
> I did confirm this does NOT work with the Surface function though, so
>
> something else is broken there.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Hi all,

This is indeed a bug. For whatever reason, the vert_colors property is being swallowed. I've fixed the code for the next IDL release (after IDL 8.3), but in the meantime, you have two options: you can either pass in the vert_colors when you create the surface, or you can hack in the fix. To fix the code, edit <idl_dir>/lib/itools/components/idlitvissurface__define.pro. In the ::SetProperty method, look for the following line:
VERT_COLORS=swallow, $
Change this to:
VERT_COLORS=vertColors, $

Then, right after the compile_opt line, add the following code:
if (N_ELEMENTS(vertColors) gt 0) then begin
oVertColor = self->getParameter('VERTEX COLORS')
if (ISA(oVertColor)) then begin
success = oVertColor->SetData(vertColors)
endif else begin
self._oSurface->SetProperty, VERT_COLORS=vertColors
endelse
endif

Hope this helps!
Cheers,
Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Errorbar plot with max-min boundaries and bar plot with !P.Multi
Next Topic: IDL code - problem to convert string to float

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

Current Time: Wed Oct 08 19:51:35 PDT 2025

Total time taken to generate the page: 0.00484 seconds