avSetColorSource from FORTRAN

avSetColorSource from FORTRAN

I have a 3D graph in which there are several plots. One of the plots is intended to have a color source using index and a palette. I can create these tables in FORTRAN and then subsequently while viewing the graph I can manualy change the properties of the plot Color properties to point to the ColorSource table and Palette Data Source.

The problem I am having is the call to avSetColorSource is failing. In tracing the problem it appears that I require theavPlotColor object for the plot but there is no such call in FORTRAN (when using hPlot as the object). I canuse avColor(hPlot) toget the handle to the avColor objectof the plot and use that to set items on theColor property sheet for the hPlot such as Front and Backetc... Note, when manualy using the Array Viewer the same property sheet(Color)contains the Color Source and Palette Data Source. I wish to set these from FORTRAN but I cannot access these because apparentlyColor Source and Palette Data Source are a property of avPlotColor and not avColor.

Can anyone shed some light on this.

Jim Dempsey

11 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I think this problem had been fixed ina 9.0 update. What package are you using (i.e. if you run ifort on the command line what do you see for the Package ID)?

If you are seeing this problem with the latest update, could you post a code snippet? I tried the following and it worked fine:


hPlotColor = avColor(hPlot)
call avSetColorSource(hPlotColor, "/foo", status)

Message Edited by jlreadey on 10-14-2005 03:29 PM

The version is: W_FC_C_9.0.021

I've tried what you suggested.

When I call avGetErrorMessage and examine the text it says something like the object is not a PlotColor object. In looking at the code it appears that avColor(hPlot) returns a Color object and not a PlotColor object. And I've tried every which way to obtain a hPlotColor from my hPlot but to no avail. I believe the problem lies in where C++ has "class PlotColor : Color" and provides inheridencethe FORTRAN implimentation did not. Either that or there was a typeo somewhere.

 ! the following gets valid hColor
    hColor = avColor(Earth.hPlot)
! this fails
    call avSetColorSource(hColor, '/Display/EarthColors', iAvStatus)
    call avGetErrorMessage(LastErrorMessage, iAvStatus)
! something like not PlotColor object
! The following fails to obtain handle to PlotColor object
    hColor = avPlotColor(Earth.hPlot)

! The following fails to obtain handle to PlotColor object
   call avGetProperty(Earth.hPlot,"PlotColor", hPlotColor, iAvStatus)

The type of plot is a Quad Mesh.

Jim Dempsey

The fix was put in after w_fc_c_9.0.021. The w_fc_c_9,0.024 kit will work. Could you upgrade to that kit and let me know if you still see the problem?

Will upgrade. FWIW I did not upgrade to .24 because the README.TXT did not indicate it fixed something important to my application (e.g. avSetColorSource). And because there were some complaints about .24. Will download tonight and let you know what happens.

Jim Dempsey

I installed .024. Build Allseems to build some projects more than once.

The main problem now is

hRoot = avGetObject("/")

Gets an error reading location 0 in the constructor CRootObj::CRootObj

Your quick reply is urgently needed as I am stuck now.

During Installation of the IA32 compiler the installer could not find Platform SDK. I have VS .NET 2003 installed and the SDK is elsewhere. The message indicated that this was required for Itanium processors so I did not point the path at the SDK inside of VS .NET as it is not technicaly Platform SDK.

Jim Dempsey

Figgured out the avGetObject problem

It appears that

Run program with old AV

Exit above program

Uninstall AV, Fortran, (and two other things)

Install V .024

Run VS

Build program


Then problem occures.

Reboot fixed the ab-end

Also found another "bug"

In my code I have

call avSetColorSource(hColor, '/Display/EarthColors', iAvStatus)

call avGetErrorMessage(LastErrorMessage, iAvStatus)

Note, avGetErrorMessage called regardless of iAvStatus. If no errors occure since start of applicatioin then avGetErrorMessage bombs out.

The avSetColorSource works, However...

When I grab the screen with the mouse to perform a rotate the sphere doesn't rotate in sync with the rest of the graph.

I will look at this tomorrow (later today)

Jim Dempsey

On the QuadMesh Surface Property sheet I have cull back checked. This looks like I have the outside color (front) but the pattern on my sphere looks like I am looking at the inside of the surface opposite from me. i.e the surface facing me, and the back side of the surface facing me are transparent.

If I check the cull front and uncheck the cull back then the color is messed up but the pattern rotates properly.

This was not the case with the prior version of AV

Jim Dempsey

RE: sphere not rotating with view pane

The problem is not with the version of AV, .021 behaves the way .024 does.

In my application I construct a sphere with QuadMesh and color source it with palette to build a facsimile of Earth. I got that working fine. However I wanted to edit the color source table on the fly to paint in some continents. When I did this I noticed that East and West appeared backwards. Or I can rephrase that it appeared as if you had to fill in the points as if you were looking from inside the sphere. As a fix I change the sign on the one of the coordinates. (probably should have done two).

! original code that worked (with East/West reversed
! swap Z and X to rotate to side
Earth.plot(i,j)%v(3) = sin(v)*cos(u)*RE ! U/D East/West
Earth.plot(i,j)%v(2) = sin(v)*sin(u)*RE ! I/O East/West
Earth.plot(i,j)%v(1) = cos(v)*RE ! L/R North/South
! code that rotates wierd.
! swap Z and X to rotate to side, Negate E/W for view from outside vs inside
Earth.plot(i,j)%v(3) = -sin(v)*cos(u)*RE ! U/D East/West
Earth.plot(i,j)%v(2) = sin(v)*sin(u)*RE ! I/O East/West
Earth.plot(i,j)%v(1) = cos(v)*RE ! L/R North/South

Additional note.

The table Earth.plot(i,j)%v is not the table being avWatched. Instead there is a separate table constructed from the contents of this table. The second table permits the application to stretch and/or flip the viewed plots without altering the data table. i.e.I display the modified "original" data verses modifying the original data.

Now, when I display the image and then inhibit avUpdates the Array Viewer will be showing a static set of display data. That is my application is now no longer affecting the display data. So when I rotate the view pane I would expect what is viewed to rotate as viewed. But the globe rotates in a weird manner. It is as if you bisect the sphere with a plane normal to your viewpoint and what you are viewing is the inside of the hemisphere opposite of your viewpoint and with the hemisphere on your side transparent. Further, the inside of the opposing hemisphere is painted with the color installed on the outside.

Jim Dempsey

Could you post an .h5 file with your graph (or submit it to Premier Support)?

I'm not sure what went wrong with your update install. I guess if you have an AV project open when you do the update, the install can't replace the avlib.dll. So to be safe, close anything you might have running. For example VB6 will have avlib.dll open if you have an av reference in your project.

Did the update fix the problem with avSetColorSource?

Never mind my question; I see you mentioned that the update fixed the avSetColorSource problem above.

I've made afix for the avGetErrorMessage bug. It will be available in the update after next.

Leave a Comment

Please sign in to add a comment. Not a member? Join today